当 CPOL = 0 时,空闲时 SCK 时钟为低电平;当 CPOL = 1 时,空闲时 SCK 时钟为高电平;可以看出本例程所示时序图空闲时 SCK 为低电平,故 CPOL = 0
当 CPHA = 0 时,在 SCK 的奇数边沿采样;当 CPHA = 1 时,在 SCK 的偶数边沿采样;可以看出本例程所示时序图在偶数边沿采样,故 CPHA = 1
//SPI发送/接收 HAL_SPI_TransmitReceive(*hspi, *pTxData, *pRxData, Size, Timeout); //SPI接收 HAL_SPI_Receive(*hspi, *pData, Size, Timeout); //SPI发送 HAL_SPI_Transmit(*hspi, *pData, Size, Timeout);