nRF Connect SDK API 3.4.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(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
25typedef enum {
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 */
36 /* This is to make sizeof(hpf_mspi_opcode_t)==32bit, for alignment purpose. */
37 HPF_MSPI_OPCODES_MAX = 0xFFFFFFFFU,
39
40typedef 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;
47
48typedef struct {
49 uint8_t device_index;
52 bool hold_ce;
53 uint16_t tx_dummy;
54 uint16_t rx_dummy;
56
57typedef struct {
58 hpf_mspi_opcode_t opcode; /* HPF_MSPI_CONFIG_TIMER_PTR */
59 NRF_TIMER_Type *timer_ptr;
61
62typedef 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];
67
73
78
79typedef 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
90
95
96#ifdef __cplusplus
97}
98#endif
99
100#endif /* DRIVERS_MSPI_HPF_MSPI_H */
#define HPF_MSPI_PIN_COUNT
Definition hpf_mspi.h:22
hpf_mspi_opcode_t
eMSPI opcodes.
Definition hpf_mspi.h:25
@ HPF_MSPI_TXRX
Definition hpf_mspi.h:32
@ HPF_MSPI_TX
Definition hpf_mspi.h:31
@ HPF_MSPI_CONFIG_PINS
Definition hpf_mspi.h:28
@ HPF_MSPI_HPF_APP_HARD_FAULT
Definition hpf_mspi.h:33
@ HPF_MSPI_EP_BOUNDED
Definition hpf_mspi.h:26
@ HPF_MSPI_OPCODES_MAX
Definition hpf_mspi.h:37
@ HPF_MSPI_CONFIG_DEV
Definition hpf_mspi.h:29
@ HPF_MSPI_WRONG_OPCODE
Definition hpf_mspi.h:34
@ HPF_MSPI_CONFIG_TIMER_PTR
Definition hpf_mspi.h:27
@ HPF_MSPI_CONFIG_XFER
Definition hpf_mspi.h:30
@ HPF_MSPI_OPCODES_COUNT
Definition hpf_mspi.h:35
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:69
hpf_mspi_dev_config_t dev_config
Definition hpf_mspi.h:71
uint8_t device_index
Definition hpf_mspi.h:70
Definition hpf_mspi.h:68
enum mspi_cpp_mode cpp
Definition hpf_mspi.h:42
enum mspi_io_mode io_mode
Definition hpf_mspi.h:41
uint8_t ce_index
Definition hpf_mspi.h:43
uint16_t cnt0_value
Definition hpf_mspi.h:45
enum mspi_ce_polarity ce_polarity
Definition hpf_mspi.h:44
Definition hpf_mspi.h:40
uint8_t data
Definition hpf_mspi.h:93
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:92
Definition hpf_mspi.h:91
NRF_TIMER_Type * timer_ptr
Definition hpf_mspi.h:59
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:58
Definition hpf_mspi.h:57
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:63
uint8_t pins_count
Definition hpf_mspi.h:64
Definition hpf_mspi.h:62
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:75
hpf_mspi_xfer_config_t xfer_config
Definition hpf_mspi.h:76
Definition hpf_mspi.h:74
uint16_t tx_dummy
Definition hpf_mspi.h:53
bool hold_ce
Definition hpf_mspi.h:52
uint8_t command_length
Definition hpf_mspi.h:50
uint8_t address_length
Definition hpf_mspi.h:51
uint8_t device_index
Definition hpf_mspi.h:49
uint16_t rx_dummy
Definition hpf_mspi.h:54
Definition hpf_mspi.h:48
uint32_t num_bytes
Definition hpf_mspi.h:83
hpf_mspi_opcode_t opcode
Definition hpf_mspi.h:80
uint32_t address
Definition hpf_mspi.h:82
uint32_t command
Definition hpf_mspi.h:81
Definition hpf_mspi.h:79