From a76d55a555bf9731a1f30da47cb84e1bfca64af0 Mon Sep 17 00:00:00 2001 From: ccli8 Date: Wed, 8 Mar 2017 15:57:03 +0800 Subject: [PATCH] [M487] Add dma_modbase() to get PDMA base address --- targets/TARGET_NUVOTON/TARGET_M480/dma.h | 1 + targets/TARGET_NUVOTON/TARGET_M480/dma_api.c | 5 +++++ 2 files changed, 6 insertions(+) diff --git a/targets/TARGET_NUVOTON/TARGET_M480/dma.h b/targets/TARGET_NUVOTON/TARGET_M480/dma.h index 1faf3c0581..465003246b 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/dma.h +++ b/targets/TARGET_NUVOTON/TARGET_M480/dma.h @@ -32,6 +32,7 @@ extern "C" { #define DMA_EVENT_MASK DMA_EVENT_ALL void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t event); +PDMA_T *dma_modbase(void); #ifdef __cplusplus } diff --git a/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c b/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c index f21368848a..4147d473cb 100644 --- a/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c +++ b/targets/TARGET_NUVOTON/TARGET_M480/dma_api.c @@ -111,6 +111,11 @@ void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t even NVIC_EnableIRQ(dma_modinit.irq_n); } +PDMA_T *dma_modbase(void) +{ + return (PDMA_T *) NU_MODBASE(dma_modinit.modname); +} + static void pdma_vec(void) { uint32_t intsts = PDMA_GET_INT_STATUS();