nRF Connect SDK API 3.3.99
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
15extern "C" {
16#endif
17
18#if defined(CONFIG_SOC_NRF54L15) || defined(CONFIG_SOC_NRF54LM20A) || \
19 defined(CONFIG_SOC_NRF54LM20B)
20#define HPF_MSPI_PIN_COUNT 11
21#elif defined(CONFIG_SOC_NRF54LV10A) || defined(CONFIG_SOC_NRF54LC10A)
22#define HPF_MSPI_PIN_COUNT 10
23#else
24#error "Unsupported SoC for HPF MSPI"
25#endif
26
28typedef enum {
30 HPF_MSPI_CONFIG_TIMER_PTR, /* hpf_mspi_flpr_timer_msg_t */
31 HPF_MSPI_CONFIG_PINS, /* hpf_mspi_pinctrl_soc_pin_msg_t */
32 HPF_MSPI_CONFIG_DEV, /* hpf_mspi_dev_config_msg_t */
33 HPF_MSPI_CONFIG_XFER, /* hpf_mspi_xfer_config_msg_t */
34 HPF_MSPI_TX, /* hpf_mspi_xfer_packet_msg_t + data buffer at the end */
39 /* This is to make sizeof(hpf_mspi_opcode_t)==32bit, for alignment purpose. */
40 HPF_MSPI_OPCODES_MAX = 0xFFFFFFFFU,
42
43typedef struct {
44 enum mspi_io_mode io_mode;
45 enum mspi_cpp_mode cpp;
46 uint8_t ce_index;
47 enum mspi_ce_polarity ce_polarity;
48 uint16_t cnt0_value;
50
51typedef struct {
52 uint8_t device_index;
55 bool hold_ce;
56 uint16_t tx_dummy;
57 uint16_t rx_dummy;
59
60typedef struct {
61 hpf_mspi_opcode_t opcode; /* HPF_MSPI_CONFIG_TIMER_PTR */
62 NRF_TIMER_Type *timer_ptr;
64
65typedef struct {
66 hpf_mspi_opcode_t opcode; /* HPF_MSPI_CONFIG_PINS */
67 uint8_t pins_count;
68 pinctrl_soc_pin_t pin[HPF_MSPI_PIN_COUNT];
70
76
81
82typedef struct {
83 hpf_mspi_opcode_t opcode; /* HPF_MSPI_TX or HPF_MSPI_TXRX */
84 uint32_t command;
85 uint32_t address;
86 uint32_t num_bytes; /* Size of data */
87#if (defined(CONFIG_MSPI_HPF_IPC_NO_COPY) || defined(CONFIG_HPF_MSPI_IPC_NO_COPY))
88 uint8_t *data;
89#else
90 uint8_t data[]; /* Variable length data field at the end of packet. */
91#endif
93
98
99#ifdef __cplusplus
100}
101#endif
102
103#endif /* DRIVERS_MSPI_HPF_MSPI_H */
hpf_mspi_opcode_t
eMSPI opcodes.
Definition hpf_mspi.h:28
@ HPF_MSPI_TXRX
Definition hpf_mspi.h:35
@ HPF_MSPI_TX
Definition hpf_mspi.h:34
@ HPF_MSPI_CONFIG_PINS
Definition hpf_mspi.h:31
@ HPF_MSPI_HPF_APP_HARD_FAULT
Definition hpf_mspi.h:36
@ HPF_MSPI_EP_BOUNDED
Definition hpf_mspi.h:29
@ HPF_MSPI_OPCODES_MAX
Definition hpf_mspi.h:40
@ HPF_MSPI_CONFIG_DEV
Definition hpf_mspi.h:32
@ HPF_MSPI_WRONG_OPCODE
Definition hpf_mspi.h:37
@ HPF_MSPI_CONFIG_TIMER_PTR
Definition hpf_mspi.h:30
@ HPF_MSPI_CONFIG_XFER
Definition hpf_mspi.h:33
@ HPF_MSPI_OPCODES_COUNT
Definition hpf_mspi.h:38
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:72
hpf_mspi_dev_config_t dev_config
Definition hpf_mspi.h:74
uint8_t device_index
Definition hpf_mspi.h:73
Definition hpf_mspi.h:71
enum mspi_cpp_mode cpp
Definition hpf_mspi.h:45
enum mspi_io_mode io_mode
Definition hpf_mspi.h:44
uint8_t ce_index
Definition hpf_mspi.h:46
uint16_t cnt0_value
Definition hpf_mspi.h:48
enum mspi_ce_polarity ce_polarity
Definition hpf_mspi.h:47
Definition hpf_mspi.h:43
uint8_t data
Definition hpf_mspi.h:96
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:95
Definition hpf_mspi.h:94
NRF_TIMER_Type * timer_ptr
Definition hpf_mspi.h:62
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:61
Definition hpf_mspi.h:60
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:66
uint8_t pins_count
Definition hpf_mspi.h:67
Definition hpf_mspi.h:65
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:78
hpf_mspi_xfer_config_t xfer_config
Definition hpf_mspi.h:79
Definition hpf_mspi.h:77
uint16_t tx_dummy
Definition hpf_mspi.h:56
bool hold_ce
Definition hpf_mspi.h:55
uint8_t command_length
Definition hpf_mspi.h:53
uint8_t address_length
Definition hpf_mspi.h:54
uint8_t device_index
Definition hpf_mspi.h:52
uint16_t rx_dummy
Definition hpf_mspi.h:57
Definition hpf_mspi.h:51
uint32_t num_bytes
Definition hpf_mspi.h:86
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:83
uint32_t address
Definition hpf_mspi.h:85
uint32_t command
Definition hpf_mspi.h:84
Definition hpf_mspi.h:82