diff options
Diffstat (limited to 'libhw_cr/rp2040_dma.h')
-rw-r--r-- | libhw_cr/rp2040_dma.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/libhw_cr/rp2040_dma.h b/libhw_cr/rp2040_dma.h index e295adf..c7f5a8f 100644 --- a/libhw_cr/rp2040_dma.h +++ b/libhw_cr/rp2040_dma.h @@ -11,6 +11,7 @@ #define _LIBHW_CR_RP2040_DMA_H_ #include <assert.h> +#include <stddef.h> /* for offsetof() */ #include <stdint.h> /* for uint32_t */ #include <hardware/regs/dreq.h> /* for DREQ_* for use with DMA_CTRL_TREQ_SEL() */ @@ -105,6 +106,8 @@ struct dma_alias3_short3 { READ_ADDR ; }; struct dma_alias2_short3: &dma_channel_hw_addr(CH)->al2_write_addr_trig, \ struct dma_alias3_short3: &dma_channel_hw_addr(CH)->al3_read_addr_trig)) +#define DMA_IS_TRIGGER(TYP, FIELD) (offsetof(TYP, FIELD) == 0xC) + #define DMA_CHAN_WR_TRANS_COUNT(TYP) \ (sizeof(TYP)/4) |