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... | |
| #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.
| p | Pointer to the memory or hardware register. |
| #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.
| p | Pointer to the memory or hardware register. |
| v | Value which has to be written to the pointer. |
| #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.
| p | Address of the memory mapped hardware register. |
| #define SDL_REG32_WR | ( | p, | |
| v | |||
| ) |
This macro writes a 32-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 32-bit value which has to be written to the register. |
| #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.
| p | Address of the memory mapped hardware register. |
| #define SDL_REG16_WR | ( | p, | |
| v | |||
| ) |
This macro writes a 16-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 16-bit value which has to be written to the register. |
| #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.
| p | Address of the memory mapped hardware register. |
| #define SDL_REG8_WR | ( | p, | |
| v | |||
| ) |
This macro writes a 8-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 8-bit value which has to be written to the register. |
| #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.
| p | Address of the memory mapped hardware register. |
| off | Offset in bytes. |
| #define SDL_REG32_WR_OFF | ( | p, | |
| off, | |||
| v | |||
| ) |
This macro writes a 32-bit value to a hardware register with an offset.
| p | Address of the memory mapped hardware register. |
| off | Offset in bytes. |
| v | Unsigned 32-bit value which has to be written to the register. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be read. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be read. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be read. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be set. |
| v | Value of the field which has to be set. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be set. |
| v | Value of the field which has to be set. |
| #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.
| p | Address of the memory mapped hardware register. |
| fld | Peripheral register bit field name, from which specified bit-field value has to be set. |
| v | Value of the field which has to be set. |
|
inlinestatic |
This function reads a 32-bit value from a hardware register and returns the value.
| p | Address of the memory mapped hardware register. |
|
inlinestatic |
This function writes a 32-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 32-bit value which has to be written to the register. |
|
inlinestatic |
This function reads a 16-bit value from a hardware register and returns the value.
| p | Address of the memory mapped hardware register. |
|
inlinestatic |
This function writes a 16-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 16-bit value which has to be written to the register. |
|
inlinestatic |
This function reads a 8-bit value from a hardware register and returns the value.
| p | Address of the memory mapped hardware register. |
|
inlinestatic |
This function writes a 8-bit value to a hardware register.
| p | Address of the memory mapped hardware register. |
| v | Unsigned 8-bit value which has to be written to the register. |
|
inlinestatic |
This function reads a 32-bit value from a hardware register with an offset and returns the value.
| p | Address of the memory mapped hardware register. |
| off | Offset in bytes. |
|
inlinestatic |
This function writes a 32-bit value to a hardware register with an offset.
| p | Address of the memory mapped hardware register. |
| off | Offset in bytes. |
| v | Unsigned 32-bit value which has to be written to the register. |
|
inlinestatic |
This function reads a 32 bit register, masks specific set of bits and returns the left shifted value.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
|
inlinestatic |
This function reads a 16 bit register, masks specific set of bits and returns the left shifted value.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
|
inlinestatic |
This function reads a 8 bit register, masks specific set of bits and returns the left shifted value.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
|
inlinestatic |
This function reads a 32 bit register, modifies specific set of bits and writes back to the register.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| v | Value to be written to bit-field. |
|
inlinestatic |
This function reads a 16 bit register, modifies specific set of bits and writes back to the register.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| v | Value to be written to bit-field. |
|
inlinestatic |
This function reads a 8 bit register, modifies specific set of bits and writes back to the register.
| p | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| v | Value to be written to bit-field. |