![]() |
![]() |
This file contains the in-line functions required to read/write values from/to the hardware registers. This file also contains field manipulation macros to get and set field values. More...
Macros | |
| #define | HW_GET_FIELD(regVal, REG_FIELD) (((regVal) & (uint32_t) REG_FIELD##_MASK) >> (uint32_t) REG_FIELD##_SHIFT) |
| Macro to extract a field value. This macro extracts the field value from a 32-bit variable (which contains the register value). This macro does not read from actual register address, and only extracts the field from a variable. More... | |
| #define | HW_SET_FIELD(regVal, REG_FIELD, fieldVal) |
| Macro to write a specific field value. This macro first clears the specified field value and then performs "OR" of the field value which is shifted and masked. This will set the field value at its desired position. More... | |
| #define | HW_WR_FIELD32(regAddr, REG_FIELD, fieldVal) |
| This macro calls read-modify-write API for 32 bit register. It also frames the mask and shift from register field macro. More... | |
| #define | HW_WR_FIELD16(regAddr, REG_FIELD, fieldVal) |
| This macro calls read-modify-write API for 16 bit register. It also frames the mask and shift from register field macro. More... | |
| #define | HW_WR_FIELD8(regAddr, REG_FIELD, fieldVal) |
| This macro calls read-modify-write API for 8 bit register. It also frames the mask and shift from register field macro. More... | |
| #define | HW_RD_FIELD32(regAddr, REG_FIELD) |
| This macro calls read field API for 32 bit register. It also frames the mask and shift from register field macro. More... | |
| #define | HW_RD_FIELD16(regAddr, REG_FIELD) |
| This macro calls read field API for 16 bit register. It also frames the mask and shift from register field macro. More... | |
| #define | HW_RD_FIELD8(regAddr, REG_FIELD) |
| This macro calls read field API for 8 bit register. It also frames the mask and shift from register field macro. More... | |
Functions | |
| static uint32_t | HW_RD_REG32 (uint32_t addr) |
| This function reads a 32-bit value from a hardware register and returns the value. More... | |
| static void | HW_WR_REG32 (uint32_t addr, uint32_t value) |
| This function writes a 32-bit value to a hardware register. More... | |
| static uint16_t | HW_RD_REG16 (uint32_t addr) |
| This function reads a 16-bit value from a hardware register and returns the value. More... | |
| static void | HW_WR_REG16 (uint32_t addr, uint16_t value) |
| This function writes a 16-bit value to a hardware register. More... | |
| static uint8_t | HW_RD_REG8 (uint32_t addr) |
| This function reads a 8-bit value from a hardware register and returns the value. More... | |
| static void | HW_WR_REG8 (uint32_t addr, uint8_t value) |
| This function writes a 8-bit value to a hardware register. More... | |
| static void | HW_WR_FIELD32_RAW (uint32_t addr, uint32_t mask, uint32_t shift, uint32_t value) |
| This function reads a 32 bit register, modifies specific set of bits and writes back to the register. More... | |
| static void | HW_WR_FIELD16_RAW (uint32_t addr, uint16_t mask, uint32_t shift, uint16_t value) |
| This function reads a 16 bit register, modifies specific set of bits and writes back to the register. More... | |
| static void | HW_WR_FIELD8_RAW (uint32_t addr, uint8_t mask, uint32_t shift, uint8_t value) |
| This function reads a 8 bit register, modifies specific set of bits and writes back to the register. More... | |
| static uint32_t | HW_RD_FIELD32_RAW (uint32_t addr, uint32_t mask, uint32_t shift) |
| This function reads a 32 bit register, masks specific set of bits and the left shifted value. More... | |
| static uint16_t | HW_RD_FIELD16_RAW (uint32_t addr, uint16_t mask, uint32_t shift) |
| This function reads a 16 bit register, masks specific set of bits and the left shifted value. More... | |
| static uint8_t | HW_RD_FIELD8_RAW (uint32_t addr, uint8_t mask, uint32_t shift) |
| This function reads a 8 bit register, masks specific set of bits and the left shifted value. More... | |
This file contains the in-line functions required to read/write values from/to the hardware registers. This file also contains field manipulation macros to get and set field values.
| #define HW_GET_FIELD | ( | regVal, | |
| REG_FIELD | |||
| ) | (((regVal) & (uint32_t) REG_FIELD##_MASK) >> (uint32_t) REG_FIELD##_SHIFT) |
Macro to extract a field value. This macro extracts the field value from a 32-bit variable (which contains the register value). This macro does not read from actual register address, and only extracts the field from a variable.
| regVal | 32-bit variable containing the register value. |
| REG_FIELD | Peripheral register bit field name, whose value has to be extracted. |
| #define HW_RD_FIELD16 | ( | regAddr, | |
| REG_FIELD | |||
| ) |
This macro calls read field API for 16 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, from which specified bit-field value has to be read. |
| Value | of the bit-field |
| #define HW_RD_FIELD32 | ( | regAddr, | |
| REG_FIELD | |||
| ) |
This macro calls read field API for 32 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, from which specified bit-field value has to be read. |
| Value | of the bit-field |
| #define HW_RD_FIELD8 | ( | regAddr, | |
| REG_FIELD | |||
| ) |
This macro calls read field API for 8 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, from which specified bit-field value has to be read. |
| Value | of the bit-field |
| #define HW_SET_FIELD | ( | regVal, | |
| REG_FIELD, | |||
| fieldVal | |||
| ) |
Macro to write a specific field value. This macro first clears the specified field value and then performs "OR" of the field value which is shifted and masked. This will set the field value at its desired position.
| regVal | 32-bit variable containing the register value. |
| REG_FIELD | Peripheral register bit field name, to which specified value has to be set. |
| fieldVal | Value of the field which has to be set. |
| #define HW_WR_FIELD16 | ( | regAddr, | |
| REG_FIELD, | |||
| fieldVal | |||
| ) |
This macro calls read-modify-write API for 16 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, to which specified value has to be set. |
| fieldVal | Value of the field which has to be set. |
| #define HW_WR_FIELD32 | ( | regAddr, | |
| REG_FIELD, | |||
| fieldVal | |||
| ) |
This macro calls read-modify-write API for 32 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, to which specified value has to be set. |
| fieldVal | Value of the field which has to be set. |
| #define HW_WR_FIELD8 | ( | regAddr, | |
| REG_FIELD, | |||
| fieldVal | |||
| ) |
This macro calls read-modify-write API for 8 bit register. It also frames the mask and shift from register field macro.
| regAddr | Register Address. |
| REG_FIELD | Peripheral register bit field name, to which specified value has to be set. |
| fieldVal | Value of the field which has to be set. |
|
inlinestatic |
This function reads a 16 bit register, masks specific set of bits and the left shifted value.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| Bit-field | value (absolute value - shifted to LSB position) |
|
inlinestatic |
This function reads a 32 bit register, masks specific set of bits and the left shifted value.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| Bit-field | value (absolute value - shifted to LSB position) |
|
inlinestatic |
This function reads a 8 bit register, masks specific set of bits and the left shifted value.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| Bit-field | value (absolute value - shifted to LSB position) |
|
inlinestatic |
This function reads a 16-bit value from a hardware register and returns the value.
| addr | Address of the memory mapped hardware register. |
| Unsigned | 16-bit value read from a register. |
|
inlinestatic |
This function reads a 32-bit value from a hardware register and returns the value.
| addr | Address of the memory mapped hardware register. |
| Unsigned | 32-bit value read from a register. |
|
inlinestatic |
This function reads a 8-bit value from a hardware register and returns the value.
| addr | Address of the memory mapped hardware register. |
| Unsigned | 8-bit value read from a register. |
|
inlinestatic |
This function reads a 16 bit register, modifies specific set of bits and writes back to the register.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| value | Value to be written to bit-field. |
|
inlinestatic |
This function reads a 32 bit register, modifies specific set of bits and writes back to the register.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| value | 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.
| addr | Address of the memory mapped hardware register. |
| mask | Mask for the bit field. |
| shift | Bit field shift from LSB. |
| value | Value to be written to bit-field. |
|
inlinestatic |
This function writes a 16-bit value to a hardware register.
| addr | Address of the memory mapped hardware register. |
| value | unsigned 16-bit value which has to be written to the register. |
|
inlinestatic |
This function writes a 32-bit value to a hardware register.
| addr | Address of the memory mapped hardware register. |
| value | unsigned 32-bit value which has to be written to the register. |
|
inlinestatic |
This function writes a 8-bit value to a hardware register.
| addr | Address of the memory mapped hardware register. |
| value | unsigned 8-bit value which has to be written to the register. |