May 2020
Intermediate to advanced
496 pages
13h 54m
English
Here's an implementation of a driver with identical functionality to the one in the A buffer-based driver section. The difference is the DMA version of the driver doesn't interrupt the application every time a byte is received. The only interrupt generated is when the entire transfer is complete. To realize this driver, we only need to add the following ISR:
void DMA1_Stream5_IRQHandler(void){ portBASE_TYPE xHigherPriorityTaskWoken = pdFALSE; SEGGER_SYSVIEW_RecordEnterISR(); if(rxInProgress && (DMA1->HISR & DMA_HISR_TCIF5)) { rxInProgress = false; DMA1->HIFCR |= DMA_HIFCR_CTCIF5; xSemaphoreGiveFromISR(rxDone, &xHigherPriorityTaskWoken); } SEGGER_SYSVIEW_RecordExitISR(); portYIELD_FROM_ISR(xHigherPriorityTaskWoken); ...Read now
Unlock full access