hw_deviceio_t * hw_spi_init_device(const char *device, uint32_t baud_rate, const hw_spi_config_t *config)
Initialize an SPI interface from a platform-specific device path.
bool cs_active_low
True when chip-select is active low.
CPOL = 1, CPHA = 0 (clock idles high; sample on falling edge)
struct hw_deviceio_t hw_deviceio_t
Opaque device I/O handle.
uint8_t hw_spi_count(void)
Get the total number of available SPI adapters.
struct hw_gpio_t hw_gpio_t
GPIO logical pin structure.
GPIO (General Purpose Input/Output) interface.
CPOL = 0, CPHA = 0 (clock idles low; sample on rising edge)
uint8_t bits_per_word
SPI frame size in bits.
hw_deviceio_t * hw_spi_init_default(uint32_t baud_rate, const hw_spi_config_t *config)
Initialize an SPI interface using the platform default adapter and pins.
SPI initialization configuration.
Abstract device I/O interface.
hw_spi_mode_t mode
SPI mode selection.
CPOL = 0, CPHA = 1 (clock idles low; sample on falling edge)
CPOL = 1, CPHA = 1 (clock idles high; sample on rising edge)
hw_spi_mode_t
SPI mode selection.
hw_deviceio_t * hw_spi_init(uint8_t index, hw_gpio_t *sck_pin, hw_gpio_t *tx_pin, hw_gpio_t *rx_pin, hw_gpio_t *cs_pin, uint32_t baud_rate, const hw_spi_config_t *config)
Initialize an SPI interface with a specific adapter and pins.