SPI配置
Data size:16bits,即传输16bit Data size:8bits,即传输8bit 当使用DMA来传输时,除了修改Data size,还需修改DMA相关内容 传输16bit:Data width设置为half word 传输8bit: Data width设置为byte 最后调用 函数即可
HAL_StatusTypeDef HAL_SPI_TransmitReceive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pTxData, uint8_t *pRxData, uint16_t Size)
HAL_StatusTypeDef HAL_SPI_Receive_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)
HAL_StatusTypeDef HAL_SPI_Transmit_DMA(SPI_HandleTypeDef *hspi, uint8_t *pData, uint16_t Size)