|
static void | AuxAdiDdiSafeWrite (uint32_t nAddr, uint32_t nData, uint32_t nSize) |
| Safely write to AUX ADI/DDI interfaces using a semaphore. More...
|
|
static uint32_t | AuxAdiDdiSafeRead (uint32_t nAddr, uint32_t nSize) |
| Safely read from AUX ADI/DDI interfaces using a semaphore. More...
|
|
static uint32_t | DDI32RegRead (uint32_t ui32Base, uint32_t ui32Reg) |
| Read the value in a 32 bit register. More...
|
|
static void | DDI32BitsSet (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val) |
| Set specific bits in a DDI slave register. More...
|
|
static void | DDI32BitsClear (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val) |
| Clear specific bits in a 32 bit DDI register. More...
|
|
static void | DDI8SetValBit (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Byte, uint16_t ui16Mask, uint16_t ui16Val) |
| Set a value on any 8 bits inside a 32 bit register in the DDI slave. More...
|
|
static void | DDI16SetValBit (uint32_t ui32Base, uint32_t ui32Reg, bool bWriteHigh, uint32_t ui32Mask, uint32_t ui32Val) |
| Set a value on any 16 bits inside a 32 bit register aligned on a half-word boundary in the DDI slave. More...
|
|
void | DDI32RegWrite (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val) |
| Write a 32 bit value to a register in the DDI slave. More...
|
|
void | DDI16BitWrite (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32WrData) |
| Write a single bit using a 16-bit maskable write. More...
|
|
void | DDI16BitfieldWrite (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Shift, uint16_t ui32Data) |
| Write a bit field via the DDI using 16-bit maskable write. More...
|
|
uint16_t | DDI16BitRead (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask) |
| Read a bit via the DDI using 16-bit read. More...
|
|
uint16_t | DDI16BitfieldRead (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Mask, uint32_t ui32Shift) |
| Read a bit field via the DDI using 16-bit read. More...
|
|
static void AuxAdiDdiSafeWrite |
( |
uint32_t |
nAddr, |
|
|
uint32_t |
nData, |
|
|
uint32_t |
nSize |
|
) |
| |
|
inlinestatic |
Safely write to AUX ADI/DDI interfaces using a semaphore.
- Note
- Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.
- Parameters
-
nAddr | is the register address. |
nData | is the data to write to the register. |
nSize | is the register access size in bytes. |
- Returns
- None
Referenced by ADI16BitsClear(), ADI16BitsSet(), ADI16RegWrite(), ADI16SetValBit(), ADI32BitsClear(), ADI32BitsSet(), ADI32RegWrite(), ADI4SetValBit(), ADI8BitsClear(), ADI8BitsSet(), ADI8RegWrite(), ADI8SetValBit(), DDI16BitfieldWrite(), DDI16BitWrite(), DDI16SetValBit(), DDI32BitsClear(), DDI32BitsSet(), DDI32RegWrite(), and DDI8SetValBit().
144 case 1: HWREGB(nAddr) = (uint8_t)nData;
break;
145 case 2: HWREGH(nAddr) = (uint16_t)nData;
break;
146 case 4:
default: HWREG(nAddr) = nData;
break;
uint32_t CPUcpsid(void)
Disable all external interrupts.
Definition: cpu.c:68
uint32_t CPUcpsie(void)
Enable all external interrupts.
Definition: cpu.c:206
static void DDI16SetValBit |
( |
uint32_t |
ui32Base, |
|
|
uint32_t |
ui32Reg, |
|
|
bool |
bWriteHigh, |
|
|
uint32_t |
ui32Mask, |
|
|
uint32_t |
ui32Val |
|
) |
| |
|
inlinestatic |
Set a value on any 16 bits inside a 32 bit register aligned on a half-word boundary in the DDI slave.
This function allows 16 bit masked access to the DDI slave registers.
Use this function to write any value in the range 0-15 bits aligned on a half-word boundary. For example, for writing the value 0b101 to bits 1-3 set ui32Val = 0x000A
and ui32Mask = 0x000E
. Bits 0 and 5-15 will not be affected by the operation, as long as the corresponding bits are not set in the ui32Mask
.
- Note
- Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.
- Parameters
-
ui32Base | is the base address of the DDI port. |
ui32Reg | is register to access. |
bWriteHigh | defines which part of the register to write in. |
ui32Mask | is the mask defining which of the 16 bit that should be overwritten. The mask must be defined in the lower half of the 32 bits. |
ui32Val | is the value to write. The value must be defined in the lower half of the 32 bits. |
- Returns
- None
393 uint32_t ui32RegOffset;
396 ASSERT(DDIBaseValid(ui32Base));
398 ASSERT(!(ui32Val & 0xFFFF0000));
399 ASSERT(!(ui32Mask & 0xFFFF0000));
403 ui32RegOffset = DDI_O_MASK16B + (ui32Reg << 1) + (bWriteHigh ? 4 : 0);
#define ASSERT(expr)
Definition: debug.h:73
#define DDI_SLAVE_REGS
Definition: ddi.h:97
static void AuxAdiDdiSafeWrite(uint32_t nAddr, uint32_t nData, uint32_t nSize)
Safely write to AUX ADI/DDI interfaces using a semaphore.
Definition: ddi.h:137
static void DDI8SetValBit |
( |
uint32_t |
ui32Base, |
|
|
uint32_t |
ui32Reg, |
|
|
uint32_t |
ui32Byte, |
|
|
uint16_t |
ui16Mask, |
|
|
uint16_t |
ui16Val |
|
) |
| |
|
inlinestatic |
Set a value on any 8 bits inside a 32 bit register in the DDI slave.
This function allows byte (8 bit access) to the DDI slave registers.
Use this function to write any value in the range 0-7 bits aligned on a byte boundary. For example, for writing the value 0b101 to bits 1-3 set ui16Val = 0x0A
and ui16Mask = 0x0E
. Bits 0 and 5-7 will not be affected by the operation, as long as the corresponding bits are not set in the ui16Mask
.
- Note
- Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.
- Parameters
-
ui32Base | is the base address of the DDI port. |
ui32Reg | is the Least Significant Register in the DDI slave that will be affected by the write operation. |
ui32Byte | is the byte number to access within the 32 bit register. |
ui16Mask | is the mask defining which of the 8 bits that should be overwritten. The mask must be defined in the lower half of the 16 bits. |
ui16Val | is the value to write. The value must be defined in the lower half of the 16 bits. |
- Returns
- None
346 uint32_t ui32RegOffset;
349 ASSERT(DDIBaseValid(ui32Base));
351 ASSERT(!(ui16Val & 0xFF00));
352 ASSERT(!(ui16Mask & 0xFF00));
356 ui32RegOffset = DDI_O_MASK8B + (ui32Reg << 1) + (ui32Byte << 1);
#define ASSERT(expr)
Definition: debug.h:73
#define DDI_SLAVE_REGS
Definition: ddi.h:97
static void AuxAdiDdiSafeWrite(uint32_t nAddr, uint32_t nData, uint32_t nSize)
Safely write to AUX ADI/DDI interfaces using a semaphore.
Definition: ddi.h:137