1 #ifndef RUUVI_INTERFACE_SPI_H
2 #define RUUVI_INTERFACE_SPI_H
26 # define RUUVI_NRF5_SDK15_SPI_ENABLED RUUVI_NRF5_SDK15_ENABLED
112 const size_t tx_len, uint8_t *
const p_rx,
const size_t rx_len);
uint32_t rd_status_t
bitfield for representing errors
Header to enable and disable module compilation.
Ruuvi error codes and error check function.
uint16_t ri_gpio_id_t
port<<8 + pin
rd_status_t ri_spi_uninit()
Uninitialize SPI driver.
@ RI_SPI_MODE_1
CPOL = 0, CPHA = 1.
@ RI_SPI_MODE_0
CPOL = 0, CPHA = 0.
@ RI_SPI_MODE_3
CPOL = 1, CPHA = 1.
@ RI_SPI_MODE_2
CPOL = 1, CPHA = 0.
@ RI_SPI_FREQUENCY_4M
4 Mbps
@ RI_SPI_FREQUENCY_2M
2 Mbps
@ RI_SPI_FREQUENCY_1M
1 Mbps
@ RI_SPI_FREQUENCY_8M
8 Mbps
rd_status_t ri_spi_xfer_blocking(const uint8_t *const p_tx, const size_t tx_len, uint8_t *const p_rx, const size_t rx_len)
SPI transfer function.
bool ri_spi_is_init()
check if SPI interface is already initialized.
rd_status_t ri_spi_init(const ri_spi_init_config_t *const config)
Initialize SPI driver with given settings.
ri_gpio_id_t * ss_pins
array of SPI pins, can be freed after function exits
ri_gpio_id_t sclk
pin number of SCLK
size_t ss_pins_number
sizeof ss_pins
ri_gpio_id_t miso
pin number of MISO
ri_spi_mode_t mode
Mode of SPI Bus, see ri_spi_mode_t.
ri_spi_frequency_t frequency
Frequency of SPI Bus, see ri_spi_frequency_t.
ri_gpio_id_t mosi
pin number of MOSI