Question
SPI Transmit only
Posted on May 05, 2015 at 13:54
Hey,
I want use the SPI interface of the STM32F407 in transmit only mode. I tried some different solutions but it did not work. Can you tell me please which commands I have to use in the SPI Init? I can not find any options for transmit only in the HAL_Driver for SPI and in the header file for spi. Please help :) Best regards void MX_SPI1_Init(void) { hspi1.Instance = SPI1; hspi1.Init.Mode = SPI_MODE_MASTER; hspi1.Init.Direction = SPI_DIRECTION_1LINE; hspi1.Init.DataSize = SPI_DATASIZE_8BIT; hspi1.Init.CLKPolarity = SPI_POLARITY_LOW; hspi1.Init.CLKPhase = SPI_PHASE_1EDGE; hspi1.Init.NSS = SPI_NSS_SOFT; hspi1.Init.BaudRatePrescaler = SPI_BAUDRATEPRESCALER_16; hspi1.Init.FirstBit = SPI_FIRSTBIT_MSB; hspi1.Init.TIMode = SPI_TIMODE_DISABLED; hspi1.Init.CRCCalculation = SPI_CRCCALCULATION_DISABLED; hspi1.Init.CRCPolynomial = 0x1; HAL_SPI_Init(&hspi1); }