void dma_disable_tc_interrupt(enum dma_channel channel) { stm32_dma_chan_t *chan = dma_get_channel(channel); id[channel] = TASK_ID_INVALID; chan->ccr &= ~STM32_DMA_CCR_TCIE; task_disable_irq(dma_get_irq(channel)); }
void dma_disable_tc_interrupt(enum dma_channel stream) { stm32_dma_stream_t *dma_stream = dma_get_channel(stream); dma_stream->scr &= ~STM32_DMA_CCR_TCIE; task_disable_irq(dma_get_irq(stream)); dma_irq[stream].cb = NULL; dma_irq[stream].cb_data = NULL; }
void dma_enable_tc_interrupt(enum dma_channel channel) { stm32_dma_chan_t *chan = dma_get_channel(channel); /* Store task ID so the ISR knows which task to wake */ id[channel] = task_get_current(); chan->ccr |= STM32_DMA_CCR_TCIE; task_enable_irq(dma_get_irq(channel)); }
void dma_enable_tc_interrupt_callback(enum dma_channel stream, void (*callback)(void *), void *callback_data) { stm32_dma_stream_t *dma_stream = dma_get_channel(stream); dma_irq[stream].cb = callback; dma_irq[stream].cb_data = callback_data; dma_stream->scr |= STM32_DMA_CCR_TCIE; task_enable_irq(dma_get_irq(stream)); }