支持4个SPI 其中2个在HCPU(SPI1,SPI2), 2个在LCPU(SPI3,SPI4).
主要功能:
- 提供单收、单发、同时收发3种模式,每种模式均支持轮询、中断、DMA3种方法
可配置项
- master/slave
- 收发共用数据线,或者收发分2根数据线
- 数据宽度 支持8bit/16bit.
- 时钟极性、数据采样沿
- 帧格式 支持Motorola* Serial Peripheral Interface (SPI), Texas Instruments* Synchronous Serial Protocol (SSP) National Semiconductor Microwire
示例1
SPI1 做master, 发送1000字节的数据
static void spi1_send_example(void)
{
uint32_t baundRate = 1200000;
uint8_t * txBuff = 0x2000c000;
uint32_t txBuffLenInBytes = 1000;
uint32_t tx_timeout_tick = 5000;
NVIC_EnableIRQ(SPI1_IRQn);
{
{
}
}
NVIC_DisableIRQ(SPI1_IRQn);
}