NEORV32 Software Framework Documentation
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, int irq_rx_avail, int irq_rx_full, int irq_tx_empty) |
int | neorv32_twd_get_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_sense_scl (void) |
int | neorv32_twd_sense_sda (void) |
int | neorv32_twd_busy (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.
int neorv32_twd_busy | ( | void | ) |
Check if there is a TWD bus operation in progress.
void neorv32_twd_clear_rx | ( | void | ) |
Clear TWD RX FIFO.
void neorv32_twd_clear_tx | ( | void | ) |
Clear TWD TX FIFO.
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_fifo_depth | ( | void | ) |
Get TWD FIFO depth.
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.
int neorv32_twd_sense_scl | ( | void | ) |
Get current state of SCL bus line.
int neorv32_twd_sense_sda | ( | void | ) |
Get current state of SDA bus line.
void neorv32_twd_setup | ( | int | device_addr, |
int | fsel, | ||
int | irq_rx_avail, | ||
int | irq_rx_full, | ||
int | irq_tx_empty ) |
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_rx_avail | IRQ if RX FIFO data available. |
[in] | irq_rx_full | IRQ if RX FIFO full. |
[in] | irq_tx_empty | IRQ if TX FIFO empty. |
int neorv32_twd_tx_empty | ( | void | ) |
Check if TX FIFO is empty.
int neorv32_twd_tx_full | ( | void | ) |
Check if TX FIFO is full.