MNRS-BM-BSP/include/ehrenberg/devices/gen/SimpleDmaModule.h

120 lines
4.1 KiB
C
Raw Normal View History

/*
* Copyright (c) 2023 - 2024 MINRES Technologies GmbH
*
* SPDX-License-Identifier: Apache-2.0
*
* Generated at 2024-04-22 11:11:53 UTC
* by peakrdl_mnrs version 1.2.2
*/
#ifndef _BSP_SIMPLEDMAMODULE_H
#define _BSP_SIMPLEDMAMODULE_H
#include <stdint.h>
typedef struct __attribute((__packed__)) {
volatile uint32_t CONTROL;
volatile uint32_t STATUS;
volatile uint32_t EVENT_SEL;
volatile uint32_t IE;
volatile uint32_t IP;
volatile uint32_t TRANSFER;
volatile uint32_t SRC_START_ADDR;
volatile uint32_t SRC_STRIDE;
volatile uint32_t DST_START_ADDR;
volatile uint32_t DST_STRIDE;
}simpledmamodule_t;
static inline uint32_t get_simpledmamodule_enable_transfer(volatile simpledmamodule_t *reg){
return (reg->CONTROL >> 0) & 0x1;
}
static inline void set_simpledmamodule_enable_transfer(volatile simpledmamodule_t *reg, uint8_t value){
reg->CONTROL = (reg->CONTROL & ~(0x1U << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_busy(volatile simpledmamodule_t *reg){
return (reg->STATUS >> 0) & 0x1;
}
static inline uint32_t get_simpledmamodule_event_sel(volatile simpledmamodule_t *reg){
return (reg->EVENT_SEL >> 0) & 0x3;
}
static inline void set_simpledmamodule_event_sel(volatile simpledmamodule_t *reg, uint8_t value){
reg->EVENT_SEL = (reg->EVENT_SEL & ~(0x3U << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_en_seg_transfer_done(volatile simpledmamodule_t *reg){
return (reg->IE >> 0) & 0x1;
}
static inline void set_simpledmamodule_en_seg_transfer_done(volatile simpledmamodule_t *reg, uint8_t value){
reg->IE = (reg->IE & ~(0x1U << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_en_transfer_done(volatile simpledmamodule_t *reg){
return (reg->IE >> 1) & 0x1;
}
static inline void set_simpledmamodule_en_transfer_done(volatile simpledmamodule_t *reg, uint8_t value){
reg->IE = (reg->IE & ~(0x1U << 1)) | (value << 1);
}
static inline uint32_t get_simpledmamodule_seg_transfer_done(volatile simpledmamodule_t *reg){
return (reg->IP >> 0) & 0x1;
}
static inline uint32_t get_simpledmamodule_transfer_done(volatile simpledmamodule_t *reg){
return (reg->IP >> 1) & 0x1;
}
static inline uint32_t get_simpledmamodule_length(volatile simpledmamodule_t *reg){
return (reg->TRANSFER >> 0) & 0x3ff;
}
static inline void set_simpledmamodule_length(volatile simpledmamodule_t *reg, uint16_t value){
reg->TRANSFER = (reg->TRANSFER & ~(0x3ffU << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_count(volatile simpledmamodule_t *reg){
return (reg->TRANSFER >> 12) & 0xfffff;
}
static inline void set_simpledmamodule_count(volatile simpledmamodule_t *reg, uint32_t value){
reg->TRANSFER = (reg->TRANSFER & ~(0xfffffU << 12)) | (value << 12);
}
static inline uint32_t get_simpledmamodule_src_start_addr(volatile simpledmamodule_t *reg){
return (reg->SRC_START_ADDR >> 0) & 0xffffffff;
}
static inline void set_simpledmamodule_src_start_addr(volatile simpledmamodule_t *reg, uint32_t value){
reg->SRC_START_ADDR = (reg->SRC_START_ADDR & ~(0xffffffffU << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_src_stride(volatile simpledmamodule_t *reg){
return (reg->SRC_STRIDE >> 0) & 0xffffffff;
}
static inline void set_simpledmamodule_src_stride(volatile simpledmamodule_t *reg, uint32_t value){
reg->SRC_STRIDE = (reg->SRC_STRIDE & ~(0xffffffffU << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_dst_start_addr(volatile simpledmamodule_t *reg){
return (reg->DST_START_ADDR >> 0) & 0xffffffff;
}
static inline void set_simpledmamodule_dst_start_addr(volatile simpledmamodule_t *reg, uint32_t value){
reg->DST_START_ADDR = (reg->DST_START_ADDR & ~(0xffffffffU << 0)) | (value << 0);
}
static inline uint32_t get_simpledmamodule_dst_stride(volatile simpledmamodule_t *reg){
return (reg->DST_STRIDE >> 0) & 0xffffffff;
}
static inline void set_simpledmamodule_dst_stride(volatile simpledmamodule_t *reg, uint32_t value){
reg->DST_STRIDE = (reg->DST_STRIDE & ~(0xffffffffU << 0)) | (value << 0);
}
#endif /* _BSP_SIMPLEDMAMODULE_H */