no-OS
stm32_xspi.h
Go to the documentation of this file.
1 /***************************************************************************/
33 #ifndef STM32_XSPI_H_
34 #define STM32_XSPI_H_
35 
36 #include <stdint.h>
37 #include <stdbool.h>
38 #include "no_os_spi.h"
39 #include "stm32_hal.h"
40 
47  uint32_t Instruction;
49  uint32_t InstructionMode;
51  uint32_t InstructionWidth;
53  uint32_t Address;
55  uint32_t AddressMode;
57  uint32_t AddressWidth;
59  uint32_t AlternateBytes;
65  uint32_t DataMode;
67  uint32_t DataLength;
69  uint32_t DummyCycles;
70 };
71 
81  uint32_t (*get_input_clock)(void);
83  uint32_t fifo_threshold;
87  uint32_t cs_high_time;
92  uint32_t irq_num;
93 };
94 
101  XSPI_HandleTypeDef hxspi;
103  void *command;
105  uint32_t input_clock;
107  uint32_t fifo_threshold;
111  uint32_t cs_high_time;
119  void (*stm32_xspi_dma_user_cb)(void *ctx);
124 };
125 
129 extern const struct no_os_spi_platform_ops stm32_xspi_ops;
130 
131 #endif // STM32_XSPI_H_
NO_OS_SPI_QUAD_LANE
@ NO_OS_SPI_QUAD_LANE
Definition: no_os_spi.h:91
stm32_xspi_init_param::cs_high_time
uint32_t cs_high_time
Definition: stm32_xspi.h:87
timeout
uint32_t timeout
Definition: ad413x.c:49
no_os_alloc.h
stm32_xspi_desc::stm32_xspi_dma_user_cb
void(* stm32_xspi_dma_user_cb)(void *ctx)
Definition: stm32_xspi.h:119
stm32_dma.h
Platform independent function definitions and data types for the DMA API.
no_os_spi_desc::device_id
uint32_t device_id
Definition: no_os_spi.h:196
NO_OS_SPI_CPOL
#define NO_OS_SPI_CPOL
Definition: no_os_spi.h:48
no_os_spi.h
Header file of SPI Interface.
no_os_dma_init_param
Initialization parameter for the DMA controller.
Definition: no_os_dma.h:171
no_os_dma_ch::id
uint32_t id
Definition: no_os_dma.h:109
no_os_irq.h
Header file of IRQ interface.
stm32_xspi_desc::dma_ch
struct no_os_dma_ch * dma_ch
Definition: stm32_xspi.h:115
no_os_spi_msg
Definition: no_os_spi.h:100
no_os_spi_platform_ops
Structure holding SPI function pointers that point to the platform specific function.
Definition: no_os_spi.h:222
stm32_xspi_desc
stm32 platform specific XSPI descriptor.
Definition: stm32_xspi.h:99
no_os_dma_ch::irq_num
uint32_t irq_num
Definition: no_os_dma.h:115
no_os_delay.h
Header file of Delay functions.
DEV_TO_MEM
@ DEV_TO_MEM
Definition: no_os_dma.h:52
stm32_xspi_command::Address
uint32_t Address
Definition: stm32_xspi.h:53
no_os_spi_init_param::mode
enum no_os_spi_mode mode
Definition: no_os_spi.h:148
stm32_xspi_init_param::fifo_threshold
uint32_t fifo_threshold
Definition: stm32_xspi.h:83
stm32_xspi_command::AddressMode
uint32_t AddressMode
Definition: stm32_xspi.h:55
stm32_xspi_command::InstructionMode
uint32_t InstructionMode
Definition: stm32_xspi.h:49
stm32_xspi_command::Instruction
uint32_t Instruction
Definition: stm32_xspi.h:47
no_os_calloc
void * no_os_calloc(size_t nitems, size_t size)
Allocate memory and return a pointer to it, set memory to 0.
Definition: chibios_alloc.c:54
NO_OS_SPI_OCTO_LANE
@ NO_OS_SPI_OCTO_LANE
Definition: no_os_spi.h:93
no_os_spi_init_param::platform_ops
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:154
stm32_xspi_desc::cs_high_time
uint32_t cs_high_time
Definition: stm32_xspi.h:111
stm32_dma_channel::hdma
DMA_HandleTypeDef * hdma
Definition: stm32_dma.h:66
no_os_dma_config_xfer
int no_os_dma_config_xfer(struct no_os_dma_desc *, struct no_os_dma_xfer_desc *, uint32_t, struct no_os_dma_ch *)
Acquire a channel and configure the list of transfers.
Definition: no_os_dma.c:242
no_os_spi_msg::tx_buff
uint8_t * tx_buff
Definition: no_os_spi.h:102
no_os_spi_init_param::device_id
uint32_t device_id
Definition: no_os_spi.h:142
stm32_xspi_desc::dma_ch_xfer
struct no_os_dma_xfer_desc * dma_ch_xfer
Definition: stm32_xspi.h:123
no_os_mdelay
void no_os_mdelay(uint32_t msecs)
Wait until msecs milliseconds passed.
Definition: aducm3029_delay.c:126
stm32_xspi_command::InstructionWidth
uint32_t InstructionWidth
Definition: stm32_xspi.h:51
stm32_xspi_init_param::get_input_clock
uint32_t(* get_input_clock)(void)
Definition: stm32_xspi.h:81
stm32_xspi_init_param::irq_num
uint32_t irq_num
Definition: stm32_xspi.h:92
stm32_xspi_command::AlternateBytes
uint32_t AlternateBytes
Definition: stm32_xspi.h:59
stm32_xspi_desc::hxspi
XSPI_HandleTypeDef hxspi
Definition: stm32_xspi.h:101
no_os_mutex.h
stm32_xspi_init_param::dma_init
struct no_os_dma_init_param * dma_init
Definition: stm32_xspi.h:89
no_os_dma_ch
Describes the state of a DMA channel.
Definition: no_os_dma.h:107
stm32_xspi_command::DataLength
uint32_t DataLength
Definition: stm32_xspi.h:67
no_os_spi_msg::rx_buff
uint8_t * rx_buff
Definition: no_os_spi.h:104
no_os_dma_xfer_desc::dst
uint8_t * dst
Definition: no_os_dma.h:75
stm32_dma_channel
STM32 DMA Channels.
Definition: stm32_dma.h:64
no_os_spi_init_param::lanes
enum no_os_spi_lanes lanes
Definition: no_os_spi.h:152
NO_OS_SPI_SINGLE_LANE
@ NO_OS_SPI_SINGLE_LANE
Definition: no_os_spi.h:87
no_os_dma_desc::platform_ops
struct no_os_dma_platform_ops * platform_ops
Definition: no_os_dma.h:144
stm32_xspi_desc::stm32_xspi_dma_done
bool stm32_xspi_dma_done
Definition: stm32_xspi.h:117
stm32_xspi.h
Header file for the stm32 xspi driver.
no_os_spi_desc
Structure holding SPI descriptor.
Definition: no_os_spi.h:192
stm32_xspi_init_param
Structure holding the initialization parameters for stm32 platform. specific XSPI parameters.
Definition: stm32_xspi.h:77
no_os_dma_xfer_desc
It's used to setup a generic DMA transfer.
Definition: no_os_dma.h:71
no_os_dma_xfer_desc::xfer_complete_ctx
void * xfer_complete_ctx
Definition: no_os_dma.h:89
no_os_dma_xfer_desc::xfer_complete_cb
void(* xfer_complete_cb)(struct no_os_dma_xfer_desc *, struct no_os_dma_xfer_desc *, void *)
Definition: no_os_dma.h:82
no_os_dma_init
int no_os_dma_init(struct no_os_dma_desc **, struct no_os_dma_init_param *)
Initialize the DMA controller.
Definition: no_os_dma.c:90
no_os_dma_xfer_start
int no_os_dma_xfer_start(struct no_os_dma_desc *, struct no_os_dma_ch *)
Acquire a channel and configure the list of transfers.
Definition: no_os_dma.c:356
no_os_spi_msg::bytes_number
uint32_t bytes_number
Definition: no_os_spi.h:106
no_os_spi_desc::extra
void * extra
Definition: no_os_spi.h:212
stm32_xspi_desc::input_clock
uint32_t input_clock
Definition: stm32_xspi.h:105
no_os_dma_platform_ops::dma_config_xfer
int(* dma_config_xfer)(struct no_os_dma_ch *, struct no_os_dma_xfer_desc *)
Definition: no_os_dma.h:250
stm32_xspi_command::AlternateBytesWidth
uint32_t AlternateBytesWidth
Definition: stm32_xspi.h:63
no_os_spi_init_param::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:144
stm32_xspi_command::DataMode
uint32_t DataMode
Definition: stm32_xspi.h:65
stm32_gpio.h
Header file for stm32 gpio specifics.
no_os_dma_xfer_desc::xfer_type
enum no_os_dma_xfer_type xfer_type
Definition: no_os_dma.h:79
no_os_free
void no_os_free(void *ptr)
Deallocate memory previously allocated by a call to no_os_calloc or no_os_malloc.
Definition: chibios_alloc.c:69
stm32_xspi_desc::command
void * command
Definition: stm32_xspi.h:103
no_os_dma_remove
int no_os_dma_remove(struct no_os_dma_desc *)
Remove resources allocated for the DMA controller.
Definition: no_os_dma.c:143
no_os_udelay
void no_os_udelay(uint32_t usecs)
Wait until usecs microseconds passed.
Definition: aducm3029_delay.c:114
NULL
#define NULL
Definition: wrapper.h:64
no_os_dma_xfer_desc::src
uint8_t * src
Definition: no_os_dma.h:73
stm32_xspi_desc::stm32_xspi_dma_user_ctx
void * stm32_xspi_dma_user_ctx
Definition: stm32_xspi.h:121
stm32_xspi_init_param::sample_shifting
bool sample_shifting
Definition: stm32_xspi.h:85
stm32_xspi_desc::dma_desc
struct no_os_dma_desc * dma_desc
Definition: stm32_xspi.h:113
no_os_dma_ch::extra
void * extra
Definition: no_os_dma.h:120
no_os_dma_xfer_abort
int no_os_dma_xfer_abort(struct no_os_dma_desc *, struct no_os_dma_ch *)
Abort the ongoing and any other future transfers scheduled for a channel.
Definition: no_os_dma.c:384
no_os_spi_desc::platform_ops
const struct no_os_spi_platform_ops * platform_ops
Definition: no_os_spi.h:208
stm32_xspi_command::AlternateBytesMode
uint32_t AlternateBytesMode
Definition: stm32_xspi.h:61
MEM_TO_DEV
@ MEM_TO_DEV
Definition: no_os_dma.h:51
no_os_spi_desc::max_speed_hz
uint32_t max_speed_hz
Definition: no_os_spi.h:198
stm32_xspi_command::AddressWidth
uint32_t AddressWidth
Definition: stm32_xspi.h:57
stm32_xspi_desc::sample_shifting
bool sample_shifting
Definition: stm32_xspi.h:109
no_os_dma_desc::channels
struct no_os_dma_ch * channels
Definition: no_os_dma.h:142
stm32_xspi_command
Structure holding the stm32 platform specific XSPI command parameters.
Definition: stm32_xspi.h:45
stm32_xspi_ops
const struct no_os_spi_platform_ops stm32_xspi_ops
stm32 platform specific XSPI platform ops structure
Definition: stm32_xspi.c:714
stm32_xspi_init_param::dma_ch
struct stm32_dma_channel * dma_ch
Definition: stm32_xspi.h:91
no_os_spi_platform_ops::init
int32_t(* init)(struct no_os_spi_desc **, const struct no_os_spi_init_param *)
Definition: no_os_spi.h:224
no_os_spi_init_param::extra
void * extra
Definition: no_os_spi.h:158
stm32_xspi_desc::fifo_threshold
uint32_t fifo_threshold
Definition: stm32_xspi.h:107
stm32_xspi_command::DummyCycles
uint32_t DummyCycles
Definition: stm32_xspi.h:69
stm32_xspi_ops
const struct no_os_spi_platform_ops stm32_xspi_ops
stm32 specific XSPI platform ops structure
Definition: stm32_xspi.c:714
stm32_hal.h
no_os_dma_xfer_desc::length
uint32_t length
Definition: no_os_dma.h:77
stm32_xspi_init_param::cmd
struct stm32_xspi_command * cmd
Definition: stm32_xspi.h:79
errno.h
Error macro definition for ARM Compiler.
NO_OS_DMA_IRQ
@ NO_OS_DMA_IRQ
Definition: no_os_irq.h:92
no_os_dma.h
Platform independent function definitions and data types for the DMA API.
NO_OS_SPI_DUAL_LANE
@ NO_OS_SPI_DUAL_LANE
Definition: no_os_spi.h:89
no_os_spi_init_param
Structure holding the parameters for SPI initialization.
Definition: no_os_spi.h:140
no_os_dma_xfer_desc::periph
enum no_os_irq_peripheral periph
Definition: no_os_dma.h:97
no_os_dma_desc
Describes the state of the DMA controller.
Definition: no_os_dma.h:136