Skip to content

Commit

Permalink
feat(Other): Add DMA channel number conversion for Zephyr (#1307)
Browse files Browse the repository at this point in the history
Signed-off-by: Tahsin Mutlugun <Tahsin.Mutlugun@analog.com>
  • Loading branch information
ttmut authored Dec 19, 2024
1 parent b1e26c4 commit 32d53f8
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Libraries/zephyr/MAX/Include/wrap_max32_dma.h
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,16 @@ static inline int Wrap_MXC_DMA_AcquireChannel(mxc_dma_regs_t *dma)
#endif
}

static inline int Wrap_MXC_DMA_GetChannelIndex(mxc_dma_regs_t *dma, uint8_t ch)
{
#if defined(CONFIG_SOC_MAX32657)
(void)dma;
return ch;
#else
return (ch + MXC_DMA_GET_IDX(dma) * (MXC_DMA_CHANNELS / MXC_DMA_INSTANCES));
#endif
}

static inline void Wrap_MXC_DMA_Handler(mxc_dma_regs_t *dma)
{
#if defined(CONFIG_SOC_MAX32657) || defined(CONFIG_SOC_MAX32665) || defined(CONFIG_SOC_MAX32666)
Expand Down

0 comments on commit 32d53f8

Please sign in to comment.