diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-26 14:58:07 -0400 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-05-26 17:10:36 -0400 |
commit | cf4af09e9a20e9cdaec4b3896eb6d10c27f89eba (patch) | |
tree | 016f876531f7dfc822be17f686074f0c859fd508 /libhw_cr/rp2040_dma.c | |
parent | 42fb27570262b52e2ca889030c621b5f4af76fe1 (diff) |
No more (static inline) function bodies in headers
Diffstat (limited to 'libhw_cr/rp2040_dma.c')
-rw-r--r-- | libhw_cr/rp2040_dma.c | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/libhw_cr/rp2040_dma.c b/libhw_cr/rp2040_dma.c index e117c19..8901f06 100644 --- a/libhw_cr/rp2040_dma.c +++ b/libhw_cr/rp2040_dma.c @@ -1,5 +1,8 @@ /* libhw_cr/rp2040_dma.c - Utilities for sharing the DMA IRQs * + * Copyright (c) 2020 Raspberry Pi (Trading) Ltd. + * SPDX-License-Identifier: BSD-3-Clause + * * Copyright (C) 2025 Luke T. Shumaker <lukeshu@lukeshu.com> * SPDX-License-Identifier: AGPL-3.0-or-later */ @@ -8,6 +11,21 @@ #include "rp2040_dma.h" +/* Borrowed from <hardware/dma.h> *********************************************/ + +dma_channel_hw_t *dma_channel_hw_addr(uint channel) { + assert(channel < NUM_DMA_CHANNELS); + return &dma_hw->ch[channel]; +} + +enum dma_channel_transfer_size { + DMA_SIZE_8 = 0, ///< Byte transfer (8 bits) + DMA_SIZE_16 = 1, ///< Half word transfer (16 bits) + DMA_SIZE_32 = 2 ///< Word transfer (32 bits) +}; + +/* Our own code ***************************************************************/ + struct dmairq_handler_entry { dmairq_handler_t fn; void *arg; |