I have here an STM32F303K8T6 and would like to use the SPI to read out a sensor, but without setting the NSS manually by reseting and setting a GPIO pin. I have heard, that the NSS Hardware does not support the automatically reseting and setting for the Master, but only for the slaves?
Does the function HAL_SPI_TransmitReceive(...); automatically set the NSS pin in software? But if so, how do I configure my NSS pin to achieve this.
What I have done so far is the following:
HAL_GPIO_WritePin(GPIOA,GPIO_PIN_15,GPIO_PIN_RESET); HAL_SPI_TransmitReceive(hspi,tx_data,rx_data,2,100); HAL_GPIO_WritePin(GPIOA,GPIO_PIN_15,GPIO_PIN_SET);
Where GPIO_PIN_15 is my NSS pin.m But I would like to transfer data automatically by using the DMA, but then also the NSS should be reset and set automatically, such that I don't receive always an interrupt between a transfer, because the overhead is killing me.