![]() |
API Reference
The NEORV32 RISC-V Processor
|
Two-Wire Device Controller (TWD) HW driver source file. More...
#include <neorv32.h>Functions | |
| int | neorv32_twd_available (void) |
| void | neorv32_twd_setup (int device_addr, int fsel, uint32_t irq_mask) |
| void | neorv32_twd_irq_config (int enable, uint32_t irq_mask) |
| int | neorv32_twd_get_rx_fifo_depth (void) |
| int | neorv32_twd_get_tx_fifo_depth (void) |
| void | neorv32_twd_disable (void) |
| void | neorv32_twd_enable (void) |
| void | neorv32_twd_clear_rx (void) |
| void | neorv32_twd_clear_tx (void) |
| int | neorv32_twd_com_state (void) |
| int | neorv32_twd_com_started (void) |
| int | neorv32_twd_com_ended (void) |
| int | neorv32_twd_rx_available (void) |
| int | neorv32_twd_rx_full (void) |
| int | neorv32_twd_tx_empty (void) |
| int | neorv32_twd_tx_full (void) |
| void | neorv32_twd_put (uint8_t data) |
| uint8_t | neorv32_twd_get (void) |
Two-Wire Device Controller (TWD) HW driver source file.
| int neorv32_twd_available | ( | void | ) |
Check if TWD unit was synthesized.
| void neorv32_twd_clear_rx | ( | void | ) |
Clear TWD RX FIFO.
| void neorv32_twd_clear_tx | ( | void | ) |
Clear TWD TX FIFO.
| int neorv32_twd_com_ended | ( | void | ) |
Check if the TWD communication has ended. This function also clears the "communication ended" flag it it was set.
| int neorv32_twd_com_started | ( | void | ) |
Check if the TWD communication has started. This function also clears the "communication started" flag it it was set.
| int neorv32_twd_com_state | ( | void | ) |
Check if a TWD communication is active.
| void neorv32_twd_disable | ( | void | ) |
Disable TWD controller.
| void neorv32_twd_enable | ( | void | ) |
Enable TWD controller.
| uint8_t neorv32_twd_get | ( | void | ) |
Get data byte from RX FIFO.
| int neorv32_twd_get_rx_fifo_depth | ( | void | ) |
Get TWD RX FIFO depth.
| int neorv32_twd_get_tx_fifo_depth | ( | void | ) |
Get TWD TX FIFO depth.
| void neorv32_twd_irq_config | ( | int | enable, |
| uint32_t | irq_mask ) |
Enable/disable IRQ TWD source(s).
| [in] | enable | Enable IRQ source(s) when non-zero, disable when zero. |
| [in] | irq_mask | Interrupt configuration bit mask (TWD_CTRL_IRQ_* bits). |
| void neorv32_twd_put | ( | uint8_t | data | ) |
Put data byte into TX FIFO.
| [in] | data | Data byte to be stored in TX FIFO. |
| int neorv32_twd_rx_available | ( | void | ) |
Check if RX data available.
| int neorv32_twd_rx_full | ( | void | ) |
Check if RX FIFO is full.
| void neorv32_twd_setup | ( | int | device_addr, |
| int | fsel, | ||
| uint32_t | irq_mask ) |
Enable and configure TWD controller. The TWD control register bits are listed in NEORV32_TWD_CTRL_enum.
| [in] | device_addr | 7-bit device address. |
| [in] | fsel | Bus sample clock / filter select. |
| [in] | irq_mask | Interrupt configuration bit mask (TWD_CTRL_IRQ_* bits). |
| int neorv32_twd_tx_empty | ( | void | ) |
Check if TX FIFO is empty.
| int neorv32_twd_tx_full | ( | void | ) |
Check if TX FIFO is full.