nRF Connect SDK API
3.4.99
Toggle main menu visibility
Loading...
Searching...
No Matches
hpf_mspi.h
Go to the documentation of this file.
1
/*
2
* Copyright (c) 2024 Nordic Semiconductor ASA
3
*
4
* SPDX-License-Identifier: LicenseRef-Nordic-5-Clause
5
*/
6
7
#ifndef DRIVERS_MSPI_HPF_MSPI_H
8
#define DRIVERS_MSPI_HPF_MSPI_H
9
10
#include <zephyr/drivers/pinctrl.h>
11
#include <zephyr/drivers/mspi.h>
12
#include <hal/nrf_timer.h>
13
14
#ifdef __cplusplus
15
extern
"C"
{
16
#endif
17
18
#if !defined(FLPR_VIO_PIN_INDICES) || !defined(FLPR_VIO_PIN_OFFSET) || !defined(FLPR_VIO_PORT)
19
#error "Unsupported SoC"
20
#endif
21
22
#define HPF_MSPI_PIN_COUNT NUM_VA_ARGS_LESS_1(FLPR_VIO_PIN_INDICES)
23
25
typedef
enum
{
26
HPF_MSPI_EP_BOUNDED
= 0,
27
HPF_MSPI_CONFIG_TIMER_PTR
,
/* hpf_mspi_flpr_timer_msg_t */
28
HPF_MSPI_CONFIG_PINS
,
/* hpf_mspi_pinctrl_soc_pin_msg_t */
29
HPF_MSPI_CONFIG_DEV
,
/* hpf_mspi_dev_config_msg_t */
30
HPF_MSPI_CONFIG_XFER
,
/* hpf_mspi_xfer_config_msg_t */
31
HPF_MSPI_TX
,
/* hpf_mspi_xfer_packet_msg_t + data buffer at the end */
32
HPF_MSPI_TXRX
,
33
HPF_MSPI_HPF_APP_HARD_FAULT
,
34
HPF_MSPI_WRONG_OPCODE
,
35
HPF_MSPI_OPCODES_COUNT
=
HPF_MSPI_WRONG_OPCODE
,
36
/* This is to make sizeof(hpf_mspi_opcode_t)==32bit, for alignment purpose. */
37
HPF_MSPI_OPCODES_MAX
= 0xFFFFFFFFU,
38
}
hpf_mspi_opcode_t
;
39
40
typedef
struct
{
41
enum
mspi_io_mode
io_mode
;
42
enum
mspi_cpp_mode
cpp
;
43
uint8_t
ce_index
;
44
enum
mspi_ce_polarity
ce_polarity
;
45
uint16_t
cnt0_value
;
46
}
hpf_mspi_dev_config_t
;
47
48
typedef
struct
{
49
uint8_t
device_index
;
50
uint8_t
command_length
;
51
uint8_t
address_length
;
52
bool
hold_ce
;
53
uint16_t
tx_dummy
;
54
uint16_t
rx_dummy
;
55
}
hpf_mspi_xfer_config_t
;
56
57
typedef
struct
{
58
hpf_mspi_opcode_t
opcode
;
/* HPF_MSPI_CONFIG_TIMER_PTR */
59
NRF_TIMER_Type *
timer_ptr
;
60
}
hpf_mspi_flpr_timer_msg_t
;
61
62
typedef
struct
{
63
hpf_mspi_opcode_t
opcode
;
/* HPF_MSPI_CONFIG_PINS */
64
uint8_t
pins_count
;
65
pinctrl_soc_pin_t
pin
[
HPF_MSPI_PIN_COUNT
];
66
}
hpf_mspi_pinctrl_soc_pin_msg_t
;
67
68
typedef
struct
{
69
hpf_mspi_opcode_t
opcode
;
/* HPF_MSPI_CONFIG_DEV */
70
uint8_t
device_index
;
71
hpf_mspi_dev_config_t
dev_config
;
72
}
hpf_mspi_dev_config_msg_t
;
73
74
typedef
struct
{
75
hpf_mspi_opcode_t
opcode
;
/* HPF_MSPI_CONFIG_XFER */
76
hpf_mspi_xfer_config_t
xfer_config
;
77
}
hpf_mspi_xfer_config_msg_t
;
78
79
typedef
struct
{
80
hpf_mspi_opcode_t
opcode
;
/* HPF_MSPI_TX or HPF_MSPI_TXRX */
81
uint32_t
command
;
82
uint32_t
address
;
83
uint32_t
num_bytes
;
/* Size of data */
84
#if (defined(CONFIG_MSPI_HPF_IPC_NO_COPY) || defined(CONFIG_HPF_MSPI_IPC_NO_COPY))
85
uint8_t *
data
;
86
#else
87
uint8_t
data
[];
/* Variable length data field at the end of packet. */
88
#endif
89
}
hpf_mspi_xfer_packet_msg_t
;
90
91
typedef
struct
{
92
hpf_mspi_opcode_t
opcode
;
93
uint8_t
data
;
94
}
hpf_mspi_flpr_response_msg_t
;
95
96
#ifdef __cplusplus
97
}
98
#endif
99
100
#endif
/* DRIVERS_MSPI_HPF_MSPI_H */
HPF_MSPI_PIN_COUNT
#define HPF_MSPI_PIN_COUNT
Definition
hpf_mspi.h:22
hpf_mspi_opcode_t
hpf_mspi_opcode_t
eMSPI opcodes.
Definition
hpf_mspi.h:25
HPF_MSPI_TXRX
@ HPF_MSPI_TXRX
Definition
hpf_mspi.h:32
HPF_MSPI_TX
@ HPF_MSPI_TX
Definition
hpf_mspi.h:31
HPF_MSPI_CONFIG_PINS
@ HPF_MSPI_CONFIG_PINS
Definition
hpf_mspi.h:28
HPF_MSPI_HPF_APP_HARD_FAULT
@ HPF_MSPI_HPF_APP_HARD_FAULT
Definition
hpf_mspi.h:33
HPF_MSPI_EP_BOUNDED
@ HPF_MSPI_EP_BOUNDED
Definition
hpf_mspi.h:26
HPF_MSPI_OPCODES_MAX
@ HPF_MSPI_OPCODES_MAX
Definition
hpf_mspi.h:37
HPF_MSPI_CONFIG_DEV
@ HPF_MSPI_CONFIG_DEV
Definition
hpf_mspi.h:29
HPF_MSPI_WRONG_OPCODE
@ HPF_MSPI_WRONG_OPCODE
Definition
hpf_mspi.h:34
HPF_MSPI_CONFIG_TIMER_PTR
@ HPF_MSPI_CONFIG_TIMER_PTR
Definition
hpf_mspi.h:27
HPF_MSPI_CONFIG_XFER
@ HPF_MSPI_CONFIG_XFER
Definition
hpf_mspi.h:30
HPF_MSPI_OPCODES_COUNT
@ HPF_MSPI_OPCODES_COUNT
Definition
hpf_mspi.h:35
hpf_mspi_dev_config_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:69
hpf_mspi_dev_config_msg_t::dev_config
hpf_mspi_dev_config_t dev_config
Definition
hpf_mspi.h:71
hpf_mspi_dev_config_msg_t::device_index
uint8_t device_index
Definition
hpf_mspi.h:70
hpf_mspi_dev_config_msg_t
Definition
hpf_mspi.h:68
hpf_mspi_dev_config_t::cpp
enum mspi_cpp_mode cpp
Definition
hpf_mspi.h:42
hpf_mspi_dev_config_t::io_mode
enum mspi_io_mode io_mode
Definition
hpf_mspi.h:41
hpf_mspi_dev_config_t::ce_index
uint8_t ce_index
Definition
hpf_mspi.h:43
hpf_mspi_dev_config_t::cnt0_value
uint16_t cnt0_value
Definition
hpf_mspi.h:45
hpf_mspi_dev_config_t::ce_polarity
enum mspi_ce_polarity ce_polarity
Definition
hpf_mspi.h:44
hpf_mspi_dev_config_t
Definition
hpf_mspi.h:40
hpf_mspi_flpr_response_msg_t::data
uint8_t data
Definition
hpf_mspi.h:93
hpf_mspi_flpr_response_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:92
hpf_mspi_flpr_response_msg_t
Definition
hpf_mspi.h:91
hpf_mspi_flpr_timer_msg_t::timer_ptr
NRF_TIMER_Type * timer_ptr
Definition
hpf_mspi.h:59
hpf_mspi_flpr_timer_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:58
hpf_mspi_flpr_timer_msg_t
Definition
hpf_mspi.h:57
hpf_mspi_pinctrl_soc_pin_msg_t::pin
pinctrl_soc_pin_t pin[NUM_VA_ARGS_LESS_1(FLPR_VIO_PIN_INDICES)]
Definition
hpf_mspi.h:65
hpf_mspi_pinctrl_soc_pin_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:63
hpf_mspi_pinctrl_soc_pin_msg_t::pins_count
uint8_t pins_count
Definition
hpf_mspi.h:64
hpf_mspi_pinctrl_soc_pin_msg_t
Definition
hpf_mspi.h:62
hpf_mspi_xfer_config_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:75
hpf_mspi_xfer_config_msg_t::xfer_config
hpf_mspi_xfer_config_t xfer_config
Definition
hpf_mspi.h:76
hpf_mspi_xfer_config_msg_t
Definition
hpf_mspi.h:74
hpf_mspi_xfer_config_t::tx_dummy
uint16_t tx_dummy
Definition
hpf_mspi.h:53
hpf_mspi_xfer_config_t::hold_ce
bool hold_ce
Definition
hpf_mspi.h:52
hpf_mspi_xfer_config_t::command_length
uint8_t command_length
Definition
hpf_mspi.h:50
hpf_mspi_xfer_config_t::address_length
uint8_t address_length
Definition
hpf_mspi.h:51
hpf_mspi_xfer_config_t::device_index
uint8_t device_index
Definition
hpf_mspi.h:49
hpf_mspi_xfer_config_t::rx_dummy
uint16_t rx_dummy
Definition
hpf_mspi.h:54
hpf_mspi_xfer_config_t
Definition
hpf_mspi.h:48
hpf_mspi_xfer_packet_msg_t::num_bytes
uint32_t num_bytes
Definition
hpf_mspi.h:83
hpf_mspi_xfer_packet_msg_t::data
uint8_t data[]
Definition
hpf_mspi.h:87
hpf_mspi_xfer_packet_msg_t::opcode
hpf_mspi_opcode_t opcode
Definition
hpf_mspi.h:80
hpf_mspi_xfer_packet_msg_t::address
uint32_t address
Definition
hpf_mspi.h:82
hpf_mspi_xfer_packet_msg_t::command
uint32_t command
Definition
hpf_mspi.h:81
hpf_mspi_xfer_packet_msg_t
Definition
hpf_mspi.h:79
include
drivers
mspi
hpf_mspi.h
Generated on
for nRF Connect SDK API by
1.17.0