![]() |
API Reference
The NEORV32 RISC-V Processor
|
Two-Wire Interface Controller (TWI) HW driver source file. More...
#include <neorv32.h>Functions | |
| int | neorv32_twi_available (void) |
| void | neorv32_twi_setup (int prsc, int cdiv) |
| uint32_t | neorv32_twi_get_fifo_depth (void) |
| uint32_t | neorv32_twi_get_clock (void) |
| int | neorv32_twi_sense_scl (void) |
| int | neorv32_twi_sense_sda (void) |
| int | neorv32_twi_claimed (void) |
| int | neorv32_twi_check_nack (void) |
| void | neorv32_twi_irq_clr (void) |
| int | neorv32_twi_busy (void) |
| int | neorv32_twi_rx_avail (void) |
| int | neorv32_twi_tx_full (void) |
| uint8_t | neorv32_twi_rx_get (void) |
| void | neorv32_twi_start (void) |
| void | neorv32_twi_stop (void) |
| void | neorv32_twi_tx (uint8_t data) |
| void | neorv32_twi_rx_ack (void) |
| void | neorv32_twi_rx_nack (void) |
Two-Wire Interface Controller (TWI) HW driver source file.
| int neorv32_twi_available | ( | void | ) |
Check if TWI unit was synthesized.
| int neorv32_twi_busy | ( | void | ) |
Check if TWI controller is busy (TWI bus engine busy or TX FIFO not empty).
| int neorv32_twi_check_nack | ( | void | ) |
Check if a TX transfer returned a NACK and clear NACK flag.
| int neorv32_twi_claimed | ( | void | ) |
Check if bus is (still) claimed by TWI controller.
| uint32_t neorv32_twi_get_clock | ( | void | ) |
Get programmed TWI bus clock speed.
| uint32_t neorv32_twi_get_fifo_depth | ( | void | ) |
Get TWI FIFO depth.
| void neorv32_twi_irq_clr | ( | void | ) |
Clear/acknowledge interrupt request.
| void neorv32_twi_rx_ack | ( | void | ) |
Issue RX data transmission with ACK (read from bus).
| int neorv32_twi_rx_avail | ( | void | ) |
Check if RX data is available.
| uint8_t neorv32_twi_rx_get | ( | void | ) |
Get RX data. Check with neorv32_twi_rx_avail before.
| void neorv32_twi_rx_nack | ( | void | ) |
Issue RX data transmission with NACK (read from bus).
| int neorv32_twi_sense_scl | ( | void | ) |
Get current state of SCL bus line.
| int neorv32_twi_sense_sda | ( | void | ) |
Get current state of SDA bus line.
| void neorv32_twi_setup | ( | int | prsc, |
| int | cdiv ) |
Enable and configure TWI controller. The TWI control register bits are listed in NEORV32_TWI_CTRL_enum.
| [in] | prsc | Clock prescaler select (0..7). See NEORV32_CLOCK_PRSC_enum. |
| [in] | cdiv | Clock divider (0..15). |
| void neorv32_twi_start | ( | void | ) |
Issue START (or REPEATED-START) condition.
| void neorv32_twi_stop | ( | void | ) |
Issue STOP condition.
| void neorv32_twi_tx | ( | uint8_t | data | ) |
Issue TX data transmission (send data to bus).
| [in] | data | Data byte to be send. |
| int neorv32_twi_tx_full | ( | void | ) |
Check if TX FIFO is full.