NEORV32 Software Framework Documentation
The NEORV32 RISC-V Processor
|
Addition to neorv32_spi.h, which provides an IRQ driven data flow. More...
Go to the source code of this file.
Data Structures | |
struct | t_neorv32_spi |
Macros | |
#define | min(a, b) |
Typedefs | |
typedef struct t_neorv32_spi | t_neorv32_spi |
Functions | |
void | neorv32_spi_init (t_neorv32_spi *self) |
void | neorv32_spi_isr (t_neorv32_spi *self) |
int | neorv32_spi_rw (t_neorv32_spi *self, uint8_t csn, void *spi, uint32_t len) |
int | neorv32_spi_rw_busy (t_neorv32_spi *self) |
Addition to neorv32_spi.h, which provides an IRQ driven data flow.
#define min | ( | a, | |
b ) |
void neorv32_spi_init | ( | t_neorv32_spi * | self | ) |
Initializes SPI flow control handle. The data structure elements are listed in t_neorv32_spi.
[in,out] | *self | SPI driver common data handle. See t_neorv32_spi. |
void neorv32_spi_isr | ( | t_neorv32_spi * | self | ) |
SPI interrupt service routine. The data structure elements are listed in t_neorv32_spi.
[in,out] | *self | SPI driver common data handle. See t_neorv32_spi. |
int neorv32_spi_rw | ( | t_neorv32_spi * | self, |
uint8_t | csn, | ||
void * | spi, | ||
uint32_t | len ) |
Starts ISR driven read/write SPI transfer.
[in,out] | *self | SPI driver common data handle. See t_neorv32_spi. |
[in] | csn | Used chip select index for transfer. |
[in,out] | *spi | write/read data buffer for SPI. Before transmission contents the write data and after the read data. |
[in] | len | number of bytes to transfer. |
0 | new transfer started. |
1 | transfer active, refused request. |
2 | unsupported data size, only 1/2/4 allowed. |
int neorv32_spi_rw_busy | ( | t_neorv32_spi * | self | ) |
Check if transfer is active. see neorv32_spi_rw
[in,out] | *self | SPI driver common data handle. See t_neorv32_spi. |
0 | idle. |
1 | busy. |