GPIO configuration and service functions.
bool clk_phase
Clock phase.
Definition: spi.h:44
uint16_t spi_transceive(uint16_t output)
Sends and receives a word (full duplex)
Definition: spi.c:66
uint8_t word_length
Word length.
Definition: spi.h:46
const struct gpio_pin * clk_pin
The GPIO pin connected to the clock line.
Definition: spi.h:47
void init_spi_module(const struct spi_config *config)
Configures the SPI module.
Definition: spi.c:43
void spi_select(bool select)
Controls the chip select line.
Definition: spi.c:117
const struct gpio_pin * ncs_pin
The GPIO pin connected to the (inverted) chip select line (may be NULL)
Definition: spi.h:50
const struct gpio_pin * mosi_pin
The GPIO pin connected to the MOSI line (may be NULL if not present)
Definition: spi.h:49
const struct gpio_pin * miso_pin
The GPIO pin connected to the MISO line (may be NULL if not present)
Definition: spi.h:48
bool clk_polarity
Clock polarity.
Definition: spi.h:45
Configuration structure for the SPI emulation module.
Definition: spi.h:43
Configuration of a single GPIO pin.
Definition: gpio.h:57