30#define HAL_SPI_MODE0 (SPI_MODE_0)
32#define HAL_SPI_MODE1 (SPI_MODE_1)
34#define HAL_SPI_MODE2 (SPI_MODE_2)
36#define HAL_SPI_MODE3 (SPI_MODE_3)
void(* hal_spi_txrx_cb)(void *arg, int len)
Prototype for tx/rx callback.
int hal_spi_txrx(int spi_num, void *txbuf, void *rxbuf, int cnt)
Blocking interface to send a buffer and store the received values from the slave.
int hal_spi_config(int spi_num, struct hal_spi_settings *psettings)
Configure the spi.
int hal_spi_set_txrx_cb(int spi_num, hal_spi_txrx_cb txrx_cb, void *arg)
Sets the txrx callback (executed at interrupt context) when the buffer is transferred by the master o...
int hal_spi_enable(int spi_num)
Enables the SPI.
int hal_spi_disable(int spi_num)
Disables the SPI.
int hal_spi_txrx_noblock(int spi_num, void *txbuf, void *rxbuf, int cnt)
Non-blocking interface to send a buffer and store received values.
spi_mode_t
Support SPI modes.
Low-level SPI peripheral driver interface definition.
since one spi device can control multiple devices, some configuration can be changed on the fly from ...
spi_clk_t baudrate
Baudrate in kHz.
spi_mode_t data_mode
Data mode of SPI driver, defined by HAL_SPI_MODEn.