Go to the documentation of this file.
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)
129 int hal_spi_txrx(
int spi_num,
void *txbuf,
void *rxbuf,
int cnt);
int hal_spi_enable(int spi_num)
Enables the SPI.
Low-level SPI peripheral driver interface definition.
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.
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.
spi_mode_t
Available SPI modes, defining the configuration of clock polarity and clock phase.
spi_clk_t
Available SPI clock speeds.
void(* hal_spi_txrx_cb)(void *arg, int len)
Prototype for tx/rx callback.
since one spi device can control multiple devices, some configuration can be changed on the fly from ...
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_disable(int spi_num)
Disables the SPI.
spi_mode_t data_mode
Data mode of SPI driver, defined by HAL_SPI_MODEn.
int hal_spi_config(int spi_num, struct hal_spi_settings *psettings)
Configure the spi.
spi_clk_t baudrate
Baudrate in kHz.