2015-07-03 03:48 AM
I have a number of devices connected, some sample the data on the rising clock edge, others on the falling edge. Inside the handler structure I want to alternate between these two operation modes.
A method that works is calling the following before each transmit:hspi3.Init.CLKPhase = SPI_PHASE_1EDGE;
HAL_SPI_Init(&hspi3);
or
hspi3.Init.CLKPhase = SPI_PHASE_2EDGE;
HAL_SPI_Init(&hspi3);
This works, but its ugly. Any ''neater'' ideas? Thanks!