From cf4af09e9a20e9cdaec4b3896eb6d10c27f89eba Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 26 May 2025 14:58:07 -0400 Subject: No more (static inline) function bodies in headers --- libhw_cr/rp2040_dma.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'libhw_cr/rp2040_dma.c') 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,4 +1,7 @@ /* 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 * SPDX-License-Identifier: AGPL-3.0-or-later @@ -8,6 +11,21 @@ #include "rp2040_dma.h" +/* Borrowed from *********************************************/ + +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; -- cgit v1.2.3-2-g168b