AM263x MCU+ SDK  08.05.00
sdlr.h File Reference

Introduction

This file contains the macro definations for Register layer.

============================================================================

Go to the source code of this file.

Macros

#define SDL_FMK(PER_REG_FIELD, val)    (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
 
#define SDL_FEXT(reg, PER_REG_FIELD)    (((reg) & SDL_##PER_REG_FIELD##_MASK) >> SDL_##PER_REG_FIELD##_SHIFT)
 
#define SDL_FINS(reg, PER_REG_FIELD, val)
 
#define SDL_FMKT(PER_REG_FIELD, TOKEN)    (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)
 
#define SDL_FINST(reg, PER_REG_FIELD, TOKEN)
 
#define kw_val   (1u) \
 
#define SDL_FMKR(msb, lsb, val)    (((val) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U))) << (lsb))
 
#define SDL_FEXTR(reg, msb, lsb)    (((reg) >> (lsb)) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)))
 
#define SDL_FINSR(reg, msb, lsb, val)
 
#define SDL_REG_RD(p)   (*(p))
 This macro reads a pointer from a provided address and returns the value. The access type is implicit based on the pointer declaration. More...
 
#define SDL_REG_WR(p, v)   (*(p) = (v))
 This macro writes a value to the pointer. The access type is implicit based on the pointer declaration. More...
 
#define SDL_REG32_RD(p)   (SDL_REG32_RD_RAW((volatile uint32_t *) (p)))
 This macro reads a 32-bit value from a hardware register and returns the value. More...
 
#define SDL_REG32_WR(p, v)
 This macro writes a 32-bit value to a hardware register. More...
 
#define SDL_REG16_RD(p)   (SDL_REG16_RD_RAW((volatile uint16_t *) (p)))
 This macro reads a 16-bit value from a hardware register and returns the value. More...
 
#define SDL_REG16_WR(p, v)
 This macro writes a 16-bit value to a hardware register. More...
 
#define SDL_REG8_RD(p)   (SDL_REG8_RD_RAW((volatile uint8_t *) (p)))
 This macro reads a 8-bit value from a hardware register and returns the value. More...
 
#define SDL_REG8_WR(p, v)
 This macro writes a 8-bit value to a hardware register. More...
 
#define SDL_REG32_RD_OFF(p, off)
 This macro reads a 32-bit value from a hardware register with an offset and returns the value. More...
 
#define SDL_REG32_WR_OFF(p, off, v)
 This macro writes a 32-bit value to a hardware register with an offset. More...
 
#define SDL_REG32_FEXT(p, fld)
 This macro calls read field API for 32 bit register. It also frames the mask and shift from register field macro. More...
 
#define SDL_REG16_FEXT(p, fld)
 This macro calls read field API for 16 bit register. It also frames the mask and shift from register field macro. More...
 
#define SDL_REG8_FEXT(p, fld)
 This macro calls read field API for 8 bit register. It also frames the mask and shift from register field macro. More...
 
#define SDL_REG32_FINS(p, fld, v)
 This macro calls read-modify-write API for 32 bit register. It also frames the mask and shift from register field macro. More...
 
#define SDL_REG16_FINS(p, fld, v)
 This macro calls read-modify-write API for 16 bit register. It also frames the mask and shift from register field macro. More...
 
#define SDL_REG8_FINS(p, fld, v)
 This macro calls read-modify-write API for 8 bit register. It also frames the mask and shift from register field macro. More...
 

Functions

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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Macro Definition Documentation

◆ SDL_FMK

#define SDL_FMK (   PER_REG_FIELD,
  val 
)     (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)

◆ SDL_FEXT

#define SDL_FEXT (   reg,
  PER_REG_FIELD 
)     (((reg) & SDL_##PER_REG_FIELD##_MASK) >> SDL_##PER_REG_FIELD##_SHIFT)

◆ SDL_FINS

#define SDL_FINS (   reg,
  PER_REG_FIELD,
  val 
)
Value:
((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
| (((val) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))

◆ SDL_FMKT

#define SDL_FMKT (   PER_REG_FIELD,
  TOKEN 
)     (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK)

◆ SDL_FINST

#define SDL_FINST (   reg,
  PER_REG_FIELD,
  TOKEN 
)
Value:
((reg) = ((reg) & ~SDL_##PER_REG_FIELD##_MASK) \
| (((SDL_##PER_REG_FIELD##_##TOKEN) << SDL_##PER_REG_FIELD##_SHIFT) & SDL_##PER_REG_FIELD##_MASK))

◆ kw_val

#define kw_val   (1u) \

◆ SDL_FMKR

#define SDL_FMKR (   msb,
  lsb,
  val 
)     (((val) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U))) << (lsb))

◆ SDL_FEXTR

#define SDL_FEXTR (   reg,
  msb,
  lsb 
)     (((reg) >> (lsb)) & ((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)))

◆ SDL_FINSR

#define SDL_FINSR (   reg,
  msb,
  lsb,
  val 
)
Value:
((reg) = ((reg) & (~(((((uint32_t)1U) << ((msb) - (lsb) + ((uint32_t)1U))) - ((uint32_t)1U)) << (lsb)))) \
| SDL_FMKR((msb), (lsb), (val)))

◆ SDL_REG_RD

#define SDL_REG_RD (   p)    (*(p))

This macro reads a pointer from a provided address and returns the value. The access type is implicit based on the pointer declaration.

Parameters
pPointer to the memory or hardware register.
Returns
Value read from the pointer.

◆ SDL_REG_WR

#define SDL_REG_WR (   p,
 
)    (*(p) = (v))

This macro writes a value to the pointer. The access type is implicit based on the pointer declaration.

Parameters
pPointer to the memory or hardware register.
vValue which has to be written to the pointer.

◆ SDL_REG32_RD

#define SDL_REG32_RD (   p)    (SDL_REG32_RD_RAW((volatile uint32_t *) (p)))

This macro reads a 32-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 32-bit value read from a register.

◆ SDL_REG32_WR

#define SDL_REG32_WR (   p,
 
)
Value:
(volatile uint32_t *) (p), (uint32_t) (v)))

This macro writes a 32-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 32-bit value which has to be written to the register.

◆ SDL_REG16_RD

#define SDL_REG16_RD (   p)    (SDL_REG16_RD_RAW((volatile uint16_t *) (p)))

This macro reads a 16-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 16-bit value read from a register.

◆ SDL_REG16_WR

#define SDL_REG16_WR (   p,
 
)
Value:
(volatile uint16_t *) (p), (uint16_t) (v)))

This macro writes a 16-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 16-bit value which has to be written to the register.

◆ SDL_REG8_RD

#define SDL_REG8_RD (   p)    (SDL_REG8_RD_RAW((volatile uint8_t *) (p)))

This macro reads a 8-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 8-bit value read from a register.

◆ SDL_REG8_WR

#define SDL_REG8_WR (   p,
 
)
Value:
(volatile uint8_t *) (p), (uint8_t) (v)))

This macro writes a 8-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 8-bit value which has to be written to the register.

◆ SDL_REG32_RD_OFF

#define SDL_REG32_RD_OFF (   p,
  off 
)
Value:
(volatile uint32_t *) (p), \
(uint32_t) (off)))

This macro reads a 32-bit value from a hardware register with an offset and returns the value.

Parameters
pAddress of the memory mapped hardware register.
offOffset in bytes.
Returns
Unsigned 32-bit value read from a register.

◆ SDL_REG32_WR_OFF

#define SDL_REG32_WR_OFF (   p,
  off,
 
)
Value:
(volatile uint32_t *) (p), \
(uint32_t) (off), \
(uint32_t) (v)))

This macro writes a 32-bit value to a hardware register with an offset.

Parameters
pAddress of the memory mapped hardware register.
offOffset in bytes.
vUnsigned 32-bit value which has to be written to the register.

◆ SDL_REG32_FEXT

#define SDL_REG32_FEXT (   p,
  fld 
)
Value:
((volatile uint32_t *) (p)), \
((uint32_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT)))

This macro calls read field API for 32 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be read.
Returns
Value of the bit-field (absolute value - shifted to LSB position)

◆ SDL_REG16_FEXT

#define SDL_REG16_FEXT (   p,
  fld 
)
Value:
((volatile uint16_t *) (p)), \
((uint16_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT)))

This macro calls read field API for 16 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be read.
Returns
Value of the bit-field (absolute value - shifted to LSB position)

◆ SDL_REG8_FEXT

#define SDL_REG8_FEXT (   p,
  fld 
)
Value:
((volatile uint8_t *) (p)), \
((uint8_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT)))

This macro calls read field API for 8 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be read.
Returns
Value of the bit-field (absolute value - shifted to LSB position)

◆ SDL_REG32_FINS

#define SDL_REG32_FINS (   p,
  fld,
 
)
Value:
((volatile uint32_t *) (p)), \
((uint32_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT), \
((uint32_t) v)))

This macro calls read-modify-write API for 32 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be set.
vValue of the field which has to be set.

◆ SDL_REG16_FINS

#define SDL_REG16_FINS (   p,
  fld,
 
)
Value:
((volatile uint16_t *) (p)), \
((uint16_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT), \
((uint16_t) v)))

This macro calls read-modify-write API for 16 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be set.
vValue of the field which has to be set.

◆ SDL_REG8_FINS

#define SDL_REG8_FINS (   p,
  fld,
 
)
Value:
((volatile uint8_t *) (p)), \
((uint8_t) SDL_##fld##_MASK), \
((uint32_t) SDL_##fld##_SHIFT), \
((uint8_t) v)))

This macro calls read-modify-write API for 8 bit register. It also frames the mask and shift from register field macro.

Parameters
pAddress of the memory mapped hardware register.
fldPeripheral register bit field name, from which specified bit-field value has to be set.
vValue of the field which has to be set.

Function Documentation

◆ SDL_REG32_RD_RAW()

static uint32_t SDL_REG32_RD_RAW ( volatile const uint32_t *const  p)
inlinestatic

This function reads a 32-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 32-bit value read from a register.

◆ SDL_REG32_WR_RAW()

static void SDL_REG32_WR_RAW ( volatile uint32_t *const  p,
uint32_t  v 
)
inlinestatic

This function writes a 32-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 32-bit value which has to be written to the register.

◆ SDL_REG16_RD_RAW()

static uint16_t SDL_REG16_RD_RAW ( volatile const uint16_t *const  p)
inlinestatic

This function reads a 16-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 16-bit value read from a register.

◆ SDL_REG16_WR_RAW()

static void SDL_REG16_WR_RAW ( volatile uint16_t *const  p,
uint16_t  v 
)
inlinestatic

This function writes a 16-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 16-bit value which has to be written to the register.

◆ SDL_REG8_RD_RAW()

static uint8_t SDL_REG8_RD_RAW ( volatile const uint8_t *const  p)
inlinestatic

This function reads a 8-bit value from a hardware register and returns the value.

Parameters
pAddress of the memory mapped hardware register.
Returns
Unsigned 8-bit value read from a register.

◆ SDL_REG8_WR_RAW()

static void SDL_REG8_WR_RAW ( volatile uint8_t *const  p,
uint8_t  v 
)
inlinestatic

This function writes a 8-bit value to a hardware register.

Parameters
pAddress of the memory mapped hardware register.
vUnsigned 8-bit value which has to be written to the register.

◆ SDL_REG32_RD_OFF_RAW()

static uint32_t SDL_REG32_RD_OFF_RAW ( volatile const uint32_t *  p,
uint32_t  off 
)
inlinestatic

This function reads a 32-bit value from a hardware register with an offset and returns the value.

Parameters
pAddress of the memory mapped hardware register.
offOffset in bytes.
Returns
Unsigned 32-bit value read from a register.

◆ SDL_REG32_WR_OFF_RAW()

static void SDL_REG32_WR_OFF_RAW ( volatile uint32_t *const  p,
uint32_t  off,
uint32_t  v 
)
inlinestatic

This function writes a 32-bit value to a hardware register with an offset.

Parameters
pAddress of the memory mapped hardware register.
offOffset in bytes.
vUnsigned 32-bit value which has to be written to the register.

◆ SDL_REG32_FEXT_RAW()

static uint32_t SDL_REG32_FEXT_RAW ( volatile const uint32_t *const  p,
uint32_t  mask,
uint32_t  shift 
)
inlinestatic

This function reads a 32 bit register, masks specific set of bits and returns the left shifted value.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
Returns
Bit-field value (absolute value - shifted to LSB position)

◆ SDL_REG16_FEXT_RAW()

static uint16_t SDL_REG16_FEXT_RAW ( volatile const uint16_t *const  p,
uint16_t  mask,
uint32_t  shift 
)
inlinestatic

This function reads a 16 bit register, masks specific set of bits and returns the left shifted value.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
Returns
Bit-field value (absolute value - shifted to LSB position)

◆ SDL_REG8_FEXT_RAW()

static uint8_t SDL_REG8_FEXT_RAW ( volatile const uint8_t *const  p,
uint8_t  mask,
uint32_t  shift 
)
inlinestatic

This function reads a 8 bit register, masks specific set of bits and returns the left shifted value.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
Returns
Bit-field value (absolute value - shifted to LSB position)

◆ SDL_REG32_FINS_RAW()

static void SDL_REG32_FINS_RAW ( volatile uint32_t *const  p,
uint32_t  mask,
uint32_t  shift,
uint32_t  v 
)
inlinestatic

This function reads a 32 bit register, modifies specific set of bits and writes back to the register.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
vValue to be written to bit-field.

◆ SDL_REG16_FINS_RAW()

static void SDL_REG16_FINS_RAW ( volatile uint16_t *const  p,
uint16_t  mask,
uint32_t  shift,
uint16_t  v 
)
inlinestatic

This function reads a 16 bit register, modifies specific set of bits and writes back to the register.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
vValue to be written to bit-field.

◆ SDL_REG8_FINS_RAW()

static void SDL_REG8_FINS_RAW ( volatile uint8_t *const  p,
uint8_t  mask,
uint32_t  shift,
uint8_t  v 
)
inlinestatic

This function reads a 8 bit register, modifies specific set of bits and writes back to the register.

Parameters
pAddress of the memory mapped hardware register.
maskMask for the bit field.
shiftBit field shift from LSB.
vValue to be written to bit-field.
SDL_FMKR
#define SDL_FMKR(msb, lsb, val)
Definition: sdlr.h:78
SDL_REG32_WR_OFF_RAW
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
SDL_REG8_FINS_RAW
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
SDL_REG32_RD_OFF_RAW
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
SDL_REG16_FINS_RAW
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
SDL_REG16_FEXT_RAW
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
SDL_REG16_WR_RAW
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
SDL_REG8_WR_RAW
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
SDL_REG32_FINS_RAW
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
SDL_REG8_FEXT_RAW
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
SDL_REG32_WR_RAW
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
SDL_REG32_FEXT_RAW
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