|
AM263x MCU+ SDK
10.01.00
|
|
Go to the documentation of this file.
49 #define SDL_FMK(PER_REG_FIELD, val) \
50 (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
53 #define SDL_FEXT(reg, PER_REG_FIELD) \
54 (((reg) & SDL_##PER_REG_FIELD##_MASK) >> SDL_##PER_REG_FIELD##_SHIFT)
57 #define SDL_FINS(reg, PER_REG_FIELD, val) \
58 ((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
59 | (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))
65 #define SDL_FMKT(PER_REG_FIELD, TOKEN) \
66 (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
69 #define SDL_FINST(reg, PER_REG_FIELD, TOKEN) \
70 ((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
71 | (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))
78 #define SDL_FMKR(msb, lsb, val) \
79 (((val) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U))) << (lsb))
82 #define SDL_FEXTR(reg, msb, lsb) \
83 (((reg) >> (lsb)) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)))
86 #define SDL_FINSR(reg, msb, lsb, val) \
87 ((reg) = ((reg) & (~(((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)) << (lsb)))) \
88 | SDL_FMKR((msb), (lsb), (val)))
99 #define SDL_REG_RD(p) (*(p))
108 #define SDL_REG_WR(p, v) (*(p) = (v))
118 #define SDL_REG32_RD(p) (SDL_REG32_RD_RAW((volatile uint32_t *) (p)))
127 #define SDL_REG32_WR(p, v) (SDL_REG32_WR_RAW( \
128 (volatile uint32_t *) (p), (uint32_t) (v)))
138 #define SDL_REG16_RD(p) (SDL_REG16_RD_RAW((volatile uint16_t *) (p)))
147 #define SDL_REG16_WR(p, v) (SDL_REG16_WR_RAW( \
148 (volatile uint16_t *) (p), (uint16_t) (v)))
158 #define SDL_REG8_RD(p) (SDL_REG8_RD_RAW((volatile uint8_t *) (p)))
167 #define SDL_REG8_WR(p, v) (SDL_REG8_WR_RAW( \
168 (volatile uint8_t *) (p), (uint8_t) (v)))
179 #define SDL_REG32_RD_OFF(p, off) (SDL_REG32_RD_OFF_RAW( \
180 (volatile uint32_t *) (p), \
192 #define SDL_REG32_WR_OFF(p, off, v) (SDL_REG32_WR_OFF_RAW( \
193 (volatile uint32_t *) (p), \
207 #define SDL_REG32_FEXT(p, fld) (SDL_REG32_FEXT_RAW( \
208 ((volatile uint32_t *) (p)), \
209 ((uint32_t) SDL_##fld##_MASK), \
210 ((uint32_t) SDL_##fld##_SHIFT)))
222 #define SDL_REG16_FEXT(p, fld) (SDL_REG16_FEXT_RAW( \
223 ((volatile uint16_t *) (p)), \
224 ((uint16_t) SDL_##fld##_MASK), \
225 ((uint32_t) SDL_##fld##_SHIFT)))
237 #define SDL_REG8_FEXT(p, fld) (SDL_REG8_FEXT_RAW( \
238 ((volatile uint8_t *) (p)), \
239 ((uint8_t) SDL_##fld##_MASK), \
240 ((uint32_t) SDL_##fld##_SHIFT)))
251 #define SDL_REG32_FINS(p, fld, v) (SDL_REG32_FINS_RAW( \
252 ((volatile uint32_t *) (p)), \
253 ((uint32_t) SDL_##fld##_MASK), \
254 ((uint32_t) SDL_##fld##_SHIFT), \
266 #define SDL_REG16_FINS(p, fld, v) (SDL_REG16_FINS_RAW( \
267 ((volatile uint16_t *) (p)), \
268 ((uint16_t) SDL_##fld##_MASK), \
269 ((uint32_t) SDL_##fld##_SHIFT), \
281 #define SDL_REG8_FINS(p, fld, v) (SDL_REG8_FINS_RAW( \
282 ((volatile uint8_t *) (p)), \
283 ((uint8_t) SDL_##fld##_MASK), \
284 ((uint32_t) SDL_##fld##_SHIFT), \
312 static inline void SDL_REG32_WR_RAW(
volatile uint32_t *
const p, uint32_t v);
340 static inline void SDL_REG16_WR_RAW(
volatile uint16_t *
const p, uint16_t v);
355 static inline uint8_t
SDL_REG8_RD_RAW(
volatile const uint8_t *
const p);
368 static inline void SDL_REG8_WR_RAW(
volatile uint8_t *
const p, uint8_t v);
387 uintptr_t pOff = ((uintptr_t) p) + off;
388 return (*(
volatile const uint32_t *)(pOff));
407 uintptr_t pOff = ((uintptr_t) p) + off;
408 (*(
volatile uint32_t *)(pOff)) = (v);
430 regVal = (regVal & mask) >> shift;
452 regVal = (regVal & mask) >> shift;
474 regVal = (regVal & mask) >> shift;
497 regVal = (regVal & ~(mask));
498 regVal |= (v << shift) & mask;
522 regVal = (regVal & ~(mask));
523 regVal |= (v << shift) & mask;
547 regVal = (regVal & ~(mask));
548 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:356
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:403
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:541
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:385
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:328
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:516
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:447
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:341
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:369
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:300
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:491
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:469
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:313
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:425