Serial data interface controller (SDI) HW driver source file.
More...
Serial data interface controller (SDI) HW driver source file.
- Note
- These functions should only be used if the SDI unit was synthesized (IO_SDI_EN = true).
- See also
- https://stnolting.github.io/neorv32/sw/files.html
◆ neorv32_sdi_available()
int neorv32_sdi_available |
( |
void | | ) |
|
Check if SDI unit was synthesized.
- Returns
- 0 if SDI was not synthesized, 1 if SPI is available.
◆ neorv32_sdi_check_cs()
int neorv32_sdi_check_cs |
( |
void | | ) |
|
Get status of chip-select line.
- Returns
- 1 if chip-select line is enabled/active (driven low), 0 otherwise.
◆ neorv32_sdi_disable()
void neorv32_sdi_disable |
( |
void | | ) |
|
◆ neorv32_sdi_enable()
void neorv32_sdi_enable |
( |
void | | ) |
|
◆ neorv32_sdi_get()
int neorv32_sdi_get |
( |
uint8_t * | data | ) |
|
Get data from SDI input FIFO.
- Parameters
-
[in,out] | Pointer | fro data byte read from RX FIFO. |
- Returns
- -1 if RX FIFO is empty, 0 if success.
◆ neorv32_sdi_get_fifo_depth()
int neorv32_sdi_get_fifo_depth |
( |
void | | ) |
|
Get SDI FIFO depth.
- Returns
- FIFO depth (number of entries), 1 if no FIFO implemented
◆ neorv32_sdi_put()
int neorv32_sdi_put |
( |
uint8_t | data | ) |
|
Push data to SDI output FIFO.
- Parameters
-
[in] | data | Byte to push into TX FIFO. |
- Returns
- -1 if TX FIFO is full, 0 if success.
◆ neorv32_sdi_setup()
void neorv32_sdi_setup |
( |
uint32_t | irq_mask | ) |
|
Reset, enable and configure SDI controller. The SDI control register bits are listed in NEORV32_SDI_CTRL_enum.
- Parameters
-
[in] | irq_mask | Interrupt configuration mask (CTRL's irq_* bits). |