Maybe you don't. At 5MHz clock frequency, transferring 27 bits takes ~5.4 micro-seconds, or ~1300 CPU cycles @ 240MHz. This may be less than the overhead incurred (context switching,...) for an asynchronous transfer.I need to read [...] in non blocking mode.
What kind of code you suggest to achieve that timings? Something like this?
Code: Select all
portENTER_CRITICAL();
for(int i=0; i < 24 ; i++)
{
gpio_set_level SCK 1
gpio_get_level DO
delay
gpio_set_level SCK 0
delay
}
portEXIT_CRITICAL();