|
AM62x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
48 #define SDL_FMK(PER_REG_FIELD, val) \
49 (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
52 #define SDL_FEXT(reg, PER_REG_FIELD) \
53 (((reg) & SDL_##PER_REG_FIELD##_MASK) >> SDL_##PER_REG_FIELD##_SHIFT)
56 #define SDL_FINS(reg, PER_REG_FIELD, val) \
57 ((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
58 | (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))
64 #define SDL_FMKT(PER_REG_FIELD, TOKEN) \
65 (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
68 #define SDL_FINST(reg, PER_REG_FIELD, TOKEN) \
69 ((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
70 | (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))
77 #define SDL_FMKR(msb, lsb, val) \
78 (((val) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U))) << (lsb))
81 #define SDL_FEXTR(reg, msb, lsb) \
82 (((reg) >> (lsb)) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)))
85 #define SDL_FINSR(reg, msb, lsb, val) \
86 ((reg) = ((reg) & (~(((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)) << (lsb)))) \
87 | SDL_FMKR((msb), (lsb), (val)))
98 #define SDL_REG_RD(p) (*(p))
107 #define SDL_REG_WR(p, v) (*(p) = (v))
117 #define SDL_REG32_RD(p) (SDL_REG32_RD_RAW((volatile uint32_t *) (p)))
126 #define SDL_REG32_WR(p, v) (SDL_REG32_WR_RAW( \
127 (volatile uint32_t *) (p), (uint32_t) (v)))
137 #define SDL_REG16_RD(p) (SDL_REG16_RD_RAW((volatile uint16_t *) (p)))
146 #define SDL_REG16_WR(p, v) (SDL_REG16_WR_RAW( \
147 (volatile uint16_t *) (p), (uint16_t) (v)))
157 #define SDL_REG8_RD(p) (SDL_REG8_RD_RAW((volatile uint8_t *) (p)))
166 #define SDL_REG8_WR(p, v) (SDL_REG8_WR_RAW( \
167 (volatile uint8_t *) (p), (uint8_t) (v)))
178 #define SDL_REG32_RD_OFF(p, off) (SDL_REG32_RD_OFF_RAW( \
179 (volatile uint32_t *) (p), \
191 #define SDL_REG32_WR_OFF(p, off, v) (SDL_REG32_WR_OFF_RAW( \
192 (volatile uint32_t *) (p), \
206 #define SDL_REG32_FEXT(p, fld) (SDL_REG32_FEXT_RAW( \
207 ((volatile uint32_t *) (p)), \
208 ((uint32_t) SDL_##fld##_MASK), \
209 ((uint32_t) SDL_##fld##_SHIFT)))
221 #define SDL_REG16_FEXT(p, fld) (SDL_REG16_FEXT_RAW( \
222 ((volatile uint16_t *) (p)), \
223 ((uint16_t) SDL_##fld##_MASK), \
224 ((uint32_t) SDL_##fld##_SHIFT)))
236 #define SDL_REG8_FEXT(p, fld) (SDL_REG8_FEXT_RAW( \
237 ((volatile uint8_t *) (p)), \
238 ((uint8_t) SDL_##fld##_MASK), \
239 ((uint32_t) SDL_##fld##_SHIFT)))
250 #define SDL_REG32_FINS(p, fld, v) (SDL_REG32_FINS_RAW( \
251 ((volatile uint32_t *) (p)), \
252 ((uint32_t) SDL_##fld##_MASK), \
253 ((uint32_t) SDL_##fld##_SHIFT), \
265 #define SDL_REG16_FINS(p, fld, v) (SDL_REG16_FINS_RAW( \
266 ((volatile uint16_t *) (p)), \
267 ((uint16_t) SDL_##fld##_MASK), \
268 ((uint32_t) SDL_##fld##_SHIFT), \
280 #define SDL_REG8_FINS(p, fld, v) (SDL_REG8_FINS_RAW( \
281 ((volatile uint8_t *) (p)), \
282 ((uint8_t) SDL_##fld##_MASK), \
283 ((uint32_t) SDL_##fld##_SHIFT), \
311 static inline void SDL_REG32_WR_RAW(
volatile uint32_t *
const p, uint32_t v);
339 static inline void SDL_REG16_WR_RAW(
volatile uint16_t *
const p, uint16_t v);
354 static inline uint8_t
SDL_REG8_RD_RAW(
volatile const uint8_t *
const p);
367 static inline void SDL_REG8_WR_RAW(
volatile uint8_t *
const p, uint8_t v);
386 uintptr_t pOff = ((uintptr_t) p) + off;
387 return (*(
volatile const uint32_t *)(pOff));
406 uintptr_t pOff = ((uintptr_t) p) + off;
407 (*(
volatile uint32_t *)(pOff)) = (v);
429 regVal = (regVal & mask) >> shift;
451 regVal = (regVal & mask) >> shift;
473 regVal = (regVal & mask) >> shift;
496 regVal = (regVal & ~(mask));
497 regVal |= (v << shift) & mask;
521 regVal = (regVal & ~(mask));
522 regVal |= (v << shift) & mask;
546 regVal = (regVal & ~(mask));
547 regVal |= (v << shift) & mask;
static uint8_t SDL_REG8_RD_RAW(volatile const uint8_t *const p)
This function reads a 8-bit value from a hardware register and returns the value.
Definition: sdlr.h:355
static void SDL_REG32_WR_OFF_RAW(volatile uint32_t *const p, uint32_t off, uint32_t v)
This function writes a 32-bit value to a hardware register with an offset.
Definition: sdlr.h:402
static void SDL_REG8_FINS_RAW(volatile uint8_t *const p, uint8_t mask, uint32_t shift, uint8_t v)
This function reads a 8 bit register, modifies specific set of bits and writes back to the register.
Definition: sdlr.h:540
static uint32_t SDL_REG32_RD_OFF_RAW(volatile const uint32_t *p, uint32_t off)
This function reads a 32-bit value from a hardware register with an offset and returns the value.
Definition: sdlr.h:384
static uint16_t SDL_REG16_RD_RAW(volatile const uint16_t *const p)
This function reads a 16-bit value from a hardware register and returns the value.
Definition: sdlr.h:327
static void SDL_REG16_FINS_RAW(volatile uint16_t *const p, uint16_t mask, uint32_t shift, uint16_t v)
This function reads a 16 bit register, modifies specific set of bits and writes back to the register.
Definition: sdlr.h:515
static uint16_t SDL_REG16_FEXT_RAW(volatile const uint16_t *const p, uint16_t mask, uint32_t shift)
This function reads a 16 bit register, masks specific set of bits and returns the left shifted value.
Definition: sdlr.h:446
static void SDL_REG16_WR_RAW(volatile uint16_t *const p, uint16_t v)
This function writes a 16-bit value to a hardware register.
Definition: sdlr.h:340
static void SDL_REG8_WR_RAW(volatile uint8_t *const p, uint8_t v)
This function writes a 8-bit value to a hardware register.
Definition: sdlr.h:368
static uint32_t SDL_REG32_RD_RAW(volatile const uint32_t *const p)
This function reads a 32-bit value from a hardware register and returns the value.
Definition: sdlr.h:299
static void SDL_REG32_FINS_RAW(volatile uint32_t *const p, uint32_t mask, uint32_t shift, uint32_t v)
This function reads a 32 bit register, modifies specific set of bits and writes back to the register.
Definition: sdlr.h:490
static uint8_t SDL_REG8_FEXT_RAW(volatile const uint8_t *const p, uint8_t mask, uint32_t shift)
This function reads a 8 bit register, masks specific set of bits and returns the left shifted value.
Definition: sdlr.h:468
static void SDL_REG32_WR_RAW(volatile uint32_t *const p, uint32_t v)
This function writes a 32-bit value to a hardware register.
Definition: sdlr.h:312
static uint32_t SDL_REG32_FEXT_RAW(volatile const uint32_t *const p, uint32_t mask, uint32_t shift)
This function reads a 32 bit register, masks specific set of bits and returns the left shifted value.
Definition: sdlr.h:424