4 #include <twr_common.h>
116 bool twr_spi_transfer(
const void *source,
void *destination,
size_t length);
twr_spi_speed_t
SPI communication speed.
bool twr_spi_is_ready(void)
Check if is ready for transfer.
bool twr_spi_async_transfer(const void *source, void *destination, size_t length, void(*event_handler)(twr_spi_event_t event, void *event_param), void(*event_param))
Execute async SPI transfer.
twr_spi_speed_t twr_spi_get_speed(void)
Get SPI communication speed.
twr_spi_mode_t
SPI mode of operation.
void twr_spi_set_manual_cs_control(bool manual_cs_control)
Enable manual control of CS pin.
bool twr_spi_transfer(const void *source, void *destination, size_t length)
Execute SPI transfer.
void twr_spi_set_speed(twr_spi_speed_t speed)
Set SPI communication speed.
void twr_spi_set_mode(twr_spi_mode_t mode)
Set SPI mode of operation.
twr_spi_mode_t twr_spi_get_mode(void)
Get SPI mode of operation.
void twr_spi_init(twr_spi_speed_t speed, twr_spi_mode_t mode)
Initialize SPI channel.
void twr_spi_set_timing(uint16_t cs_delay, uint16_t delay, uint16_t cs_quit)
Set SPI timing.
twr_spi_event_t
SPI event.
@ TWR_SPI_SPEED_16_MHZ
SPI communication speed is 16 MHz.
@ TWR_SPI_SPEED_125_KHZ
SPI communication speed is 125 kHz.
@ TWR_SPI_SPEED_8_MHZ
SPI communication speed is 8 MHz.
@ TWR_SPI_SPEED_250_KHZ
SPI communication speed is 250 kHz.
@ TWR_SPI_SPEED_500_KHZ
SPI communication speed is 500 kHz.
@ TWR_SPI_SPEED_4_MHZ
SPI communication speed is 4 MHz.
@ TWR_SPI_SPEED_2_MHZ
SPI communication speed is 2 MHz.
@ TWR_SPI_SPEED_1_MHZ
SPI communication speed is 1 MHz.
@ TWR_SPI_MODE_2
SPI mode of operation is 2 (CPOL = 1, CPHA = 0)
@ TWR_SPI_MODE_1
SPI mode of operation is 1 (CPOL = 0, CPHA = 1)
@ TWR_SPI_MODE_0
SPI mode of operation is 0 (CPOL = 0, CPHA = 0)
@ TWR_SPI_MODE_3
SPI mode of operation is 3 (CPOL = 1, CPHA = 1)
@ TWR_SPI_EVENT_DONE
SPI event is completed.