I am using the freertos SPI API from ASF. In the freertos spi_write/spi_read packets, the API uses the DMA and also gives the ability to pass a semaphore to be notified on transfer completion.
So, if using several tasks and each task can communicate via the same SPI but on different CS, I need to modify the freertos spi_read/spi_write functions so it will first acquire the semaphores, then change the CS with “spi_set_peripheral_chip_select_value”, and then configuring the PDC… right?
This is because it is not one atom operation, and I don’t want that one task will change the CS and before it will transmit, it will switch to another task that will, again chge to a different CS, then it will switch back to the first task that will start transmitting, but now to the wrong CS…
Is this correct?