From e9af9d951a0341ea68ce88d7b5ee3b42b68494b6 Mon Sep 17 00:00:00 2001 From: Marti Bolivar Date: Mon, 3 Jan 2011 15:19:19 -0500 Subject: Documentation improvements, DMA IRQ table volatile bugfix. --- libmaple/dma.c | 2 +- libmaple/dma.h | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) (limited to 'libmaple') diff --git a/libmaple/dma.c b/libmaple/dma.c index 70507b9..1de9b60 100644 --- a/libmaple/dma.c +++ b/libmaple/dma.c @@ -47,7 +47,7 @@ typedef struct DMAChannel { uint32 irq_line; } DMAChannel; -static DMAChannel dma_channels[] = { +volatile static DMAChannel dma_channels[] = { { .handler = NULL, .irq_line = NVIC_DMA_CH1 }, { .handler = NULL, .irq_line = NVIC_DMA_CH2 }, { .handler = NULL, .irq_line = NVIC_DMA_CH3 }, diff --git a/libmaple/dma.h b/libmaple/dma.h index aabbfb8..3417f02 100644 --- a/libmaple/dma.h +++ b/libmaple/dma.h @@ -67,6 +67,7 @@ typedef enum dma_mode_flags { DMA_TRNS_CMPLT = 1 << 1 /**< Interrupt on transfer completion */ } dma_mode_flags; +/** Source and destination transfer sizes. */ typedef enum dma_transfer_size { DMA_SIZE_8BITS = 0, DMA_SIZE_16BITS = 1, @@ -102,7 +103,16 @@ void dma_init(uint8 channel, volatile void *paddr, * @see dma_init() */ void dma_start(uint8 channel, volatile void *buffer, uint16 count); +/** + * Attach an interrupt handler for the given DMA channel. + * @param channel DMA channel (1..7) + * @param handler Interrupt handler to attach + * @see voidFuncPtr */ void dma_attach_interrupt(uint8 channel, voidFuncPtr handler); + +/** + * Detach any handler associated with the given DMA channel. + * @param channel Channel whose interrupt handler to detach. */ void dma_detach_interrupt(uint8 channel); #ifdef __cplusplus -- cgit v1.2.3