Serial Peripheral Interface (SPI) driver.
This module provides functions to configure and control SPI input/output and interrupt behavior.
Usage & Initialization.
This is an example show how to instantiate SPI Driver with spi_instance_t.
#define SPI (spi_hwreg_t*)SYSTEM_SPI_0_IO_CTRL
.hwreg = SPI,
.clkDivider = 15,
.ssSetup = 5,
.ssHold = 2,
.ssDisable = 7
},
@ FULL_DUPLEX_SINGLE_LINE
Full-duplex mode using single data lin.
@ LOW
Clock is low when id.
@ DATA_SAMPLED_RISE_EDGE
Data sampled on rising clock ed.
void spi_applyConfig(spi_instance_t *inst)
Applies the current configuration settings stored in the spi_instance_t structure to the SPI hardware...
SPI driver API definitions.
SPI instance. Holds the software registers and hardware pointer.
enum cfg_cpol cpol
Stored Clock Polarity.
- See also
- Example SPI Flash Demo - Learn how to use the driver for interacting with Flash devices