Skip to content

Commit 61f3784

Browse files
ccli8adbridge
authored andcommitted
Add dma_modbase() to get PDMA base address
1 parent a19fa06 commit 61f3784

File tree

4 files changed

+12
-0
lines changed

4 files changed

+12
-0
lines changed

targets/TARGET_NUVOTON/TARGET_M451/dma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ extern "C" {
3232
#define DMA_EVENT_MASK DMA_EVENT_ALL
3333

3434
void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t event);
35+
PDMA_T *dma_modbase(void);
3536

3637
#ifdef __cplusplus
3738
}

targets/TARGET_NUVOTON/TARGET_M451/dma_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t even
111111
NVIC_EnableIRQ(dma_modinit.irq_n);
112112
}
113113

114+
PDMA_T *dma_modbase(void)
115+
{
116+
return (PDMA_T *) NU_MODBASE(dma_modinit.modname);
117+
}
118+
114119
static void pdma_vec(void)
115120
{
116121
uint32_t intsts = PDMA_GET_INT_STATUS();

targets/TARGET_NUVOTON/TARGET_NUC472/dma.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@ extern "C" {
3232
#define DMA_EVENT_MASK DMA_EVENT_ALL
3333

3434
void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t event);
35+
PDMA_T *dma_modbase(void);
3536

3637
#ifdef __cplusplus
3738
}

targets/TARGET_NUVOTON/TARGET_NUC472/dma_api.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,11 @@ void dma_set_handler(int channelid, uint32_t handler, uint32_t id, uint32_t even
111111
NVIC_EnableIRQ(dma_modinit.irq_n);
112112
}
113113

114+
PDMA_T *dma_modbase(void)
115+
{
116+
return (PDMA_T *) NU_MODBASE(dma_modinit.modname);
117+
}
118+
114119
static void pdma_vec(void)
115120
{
116121
uint32_t intsts = PDMA_GET_INT_STATUS();

0 commit comments

Comments
 (0)