Skip to content

Commit

Permalink
Memory to peripheral DMA 16bit Support (#43)
Browse files Browse the repository at this point in the history
* use TransferWidth for GPDMA_TRANSFERTYPE_M2P, so it will support DMA 16 bit
* allow enable/disable memory increase for DMA
  • Loading branch information
rhapsodyv authored Sep 6, 2020
1 parent d8e8ba0 commit 63c9174
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 3 additions & 3 deletions system/CMSIS/driver/lpc17xx_gpdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ Status GPDMA_Setup(GPDMA_Channel_CFG_Type *GPDMAChannelConfig)
= GPDMA_DMACCxControl_TransferSize((uint32_t)GPDMAChannelConfig->TransferSize) \
| GPDMA_DMACCxControl_SBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->DstConn]) \
| GPDMA_DMACCxControl_DBSize((uint32_t)GPDMA_LUTPerBurst[GPDMAChannelConfig->DstConn]) \
| GPDMA_DMACCxControl_SWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \
| GPDMA_DMACCxControl_DWidth((uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \
| GPDMA_DMACCxControl_SI \
| GPDMA_DMACCxControl_SWidth(GPDMAChannelConfig->TransferWidth > 0 ? GPDMAChannelConfig->TransferWidth : (uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \
| GPDMA_DMACCxControl_DWidth(GPDMAChannelConfig->TransferWidth > 0 ? GPDMAChannelConfig->TransferWidth : (uint32_t)GPDMA_LUTPerWid[GPDMAChannelConfig->DstConn]) \
| GPDMAChannelConfig->MemoryIncrease \
| GPDMA_DMACCxControl_I;
break;
// Peripheral to memory
Expand Down
6 changes: 6 additions & 0 deletions system/CMSIS/include/lpc17xx_gpdma.h
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,12 @@ typedef struct {
uint32_t DMALLI; /**< Linker List Item structure data address
if there's no Linker List, set as '0'
*/

uint32_t MemoryIncrease; /** Setup Memory Increase for GPDMA_TRANSFERTYPE_M2P
GPDMA_DMACCxControl_SI < Source increment
GPDMA_DMACCxControl_DI < Destination increment
Or both, or None
*/
} GPDMA_Channel_CFG_Type;

/**
Expand Down

0 comments on commit 63c9174

Please sign in to comment.