CC26xx Driver Library |

- Main Page
- Related Pages
- CC26xx APIs
- Register Descriptions
- Online Resources

All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
Functions
[ddi] Digital to Digital Interface

## Functions
__STATIC_INLINE void | AuxAdiDdiSafeWrite (uint32_t nAddr, uint32_t nData, uint32_t nSize)
__STATIC_INLINE uint32_t | AuxAdiDdiSafeRead (uint32_t nAddr, uint32_t nSize)
__STATIC_INLINE uint32_t | DDIStatusGet (uint32_t ui32Base)
| Get the status of the DDI. More...
__STATIC_INLINE void | DDIConfigSet (uint32_t ui32Base, uint32_t ui32Config, bool bProtect)
| Configure the DDI Slave. More...
__STATIC_INLINE void | DDISync (uint32_t ui32Base)
| Synchronize a DDI slave. More...
__STATIC_INLINE void | DDIProtect (uint32_t ui32Base)
| Protect a DDI slave by locking the register access. More...
__STATIC_INLINE void | DDI32RegWrite (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
| Write a 32 bit value to a register in the DDI slave. More...
__STATIC_INLINE uint32_t | DDI32RegRead (uint32_t ui32Base, uint32_t ui32Reg)
| Read the value in a 32 bit register. More...
__STATIC_INLINE void | DDI32BitsSet (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
| Set specific bits in a DDI slave register. More...
__STATIC_INLINE void | DDI32BitsClear (uint32_t ui32Base, uint32_t ui32Reg, uint32_t ui32Val)
| Clear specific bits in a 32 bit DDI register. More...
__STATIC_INLINE 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_INLINE 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 | 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 bitfield via the DDI using 16-bit READ. More...

## Detailed Description

## Function Documentation

__STATIC_INLINE uint32_t AuxAdiDdiSafeRead | ( | uint32_t | nAddr,
|  | uint32_t | nSize
| ) |  |

Definition at line 187 of file ddi.h.

Referenced by ADI16RegRead(), ADI32RegRead(), ADI8RegRead(), ADIProtect(), DDI16BitfieldRead(), DDI16BitRead(), DDI32RegRead(), DDIProtect(), and DDIStatusGet().

__STATIC_INLINE void AuxAdiDdiSafeWrite | ( | uint32_t | nAddr,
|  | uint32_t | nData,
|  | uint32_t | nSize
| ) |  |

Definition at line 152 of file ddi.h.

Referenced by ADI16BitsClear(), ADI16BitsSet(), ADI16RegWrite(), ADI16SetValBit(), ADI32BitsClear(), ADI32BitsSet(), ADI32RegWrite(), ADI4SetValBit(), ADI8BitsClear(), ADI8BitsSet(), ADI8RegWrite(), ADI8SetValBit(), ADIConfigSet(), ADIProtect(), ADISync(), DDI16BitfieldWrite(), DDI16BitWrite(), DDI16SetValBit(), DDI32BitsClear(), DDI32BitsSet(), DDI32RegWrite(), DDI8SetValBit(), DDIConfigSet(), DDIProtect(), and DDISync().

uint16_t DDI16BitfieldRead | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Mask,
|  | uint32_t | ui32Shift
| ) |  |

Read a bitfield via the DDI using 16-bit READ.

Requires that bit fields not space the low/high word boundary. Return data aligned to bit 0.

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.
  ui32Mask | is the mask defining which of the 16 bits that should be overwritten. The mask must be defined in the lower half of the 32 bits.
  ui32Shift | defines the required shift of the data to align with bit 0.

Returns
  None

Read a bitfield via the DDI using 16-bit READ.

Definition at line 198 of file ddi.c.

Referenced by OSCClockSourceGet(), and OSCHfSourceReady().

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.

Requires that bitfields not space the low/high word boundary.

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.
  ui32Mask | is the mask defining which of the 16 bits that should be overwritten. The mask must be defined in the lower half of the 32 bits.
  ui32Shift |
  ui32Data |

Returns
  None

Write a bit field via the DDI using 16-bit maskable write.

Definition at line 108 of file ddi.c.

Referenced by OSCClockSourceSet().

uint16_t DDI16BitRead | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Mask
| ) |  |

Read a bit via the DDI using 16-bit READ.

Return a zero if bit selected by mask is '0'. Else returns the mask.

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 module.
  ui32Reg | is the register to read.
  ui32Mask | defines the bit which should be read.

Returns
  None

Definition at line 152 of file ddi.c.

void DDI16BitWrite | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Mask,
|  | uint32_t | ui32WrData
| ) |  |

Write a single bit using a 16-bit maskable write.

A '1' is written to the bit if `ui32WrData` is non-zero, else a '0' is written.

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.
  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.
  ui32WrData | is the value to write. The value must be defined in the lower half of the 32 bits.

Returns
  None

Definition at line 64 of file ddi.c.

Referenced by OSCXHfPowerModeSet().

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

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

Definition at line 631 of file ddi.h.

__STATIC_INLINE void DDI32BitsClear | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Val
| ) |  |

Clear specific bits in a 32 bit DDI register.

This function will clear bits in a register in the analog domain.

Note
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.
  ui32Reg | is the base registers to clear the bits in.
  ui32Val | is the 32 bit one-hot encoded value specifying which bits to clear in the register.

Returns
  None

Definition at line 527 of file ddi.h.

__STATIC_INLINE void DDI32BitsSet | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Val
| ) |  |

Set specific bits in a DDI slave register.

This function will set bits in a register in the analog domain.

Note
  This operation is write only for the specified register. This function is used to set bits in specific register in the DDI slave. Only bits in the selected register are affected by the operation.
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.
  ui32Reg | is the base register to assert the bits in.
  ui32Val | is the 32 bit one-hot encoded value specifying which bits to set in the register.

Returns
  None

Definition at line 487 of file ddi.h.

__STATIC_INLINE uint32_t DDI32RegRead | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg
| ) |  |

Read the value in a 32 bit register.

This function will read a register in the analog domain and return the value as an `uint32_t`.

Note
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.
  ui32Reg | is the 32 bit register to read.

Returns
  Returns the 32 bit value of the analog register.

Definition at line 450 of file ddi.h.

__STATIC_INLINE void DDI32RegWrite | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Reg,
|  | uint32_t | ui32Val
| ) |  |

Write a 32 bit value to a register in the DDI slave.

This function will write a value to a register in the analog domain.

Note
  This operation is write only for the specified register. No conservation of the previous value of the register will be kept (i.e. this is NOT read-modify-write on the register).
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.
  ui32Reg | is the register to write.
  ui32Val | is the 32 bit value to write to the register.

Returns
  None

Definition at line 418 of file ddi.h.

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

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

Definition at line 578 of file ddi.h.

__STATIC_INLINE void DDIConfigSet | ( | uint32_t | ui32Base,
|  | uint32_t | ui32Config,
|  | bool | bProtect
| ) |  |

Configure the DDI Slave.

Use this function to configure the interface between the DDI master and the DDI slave. The configuration values for the DDI slave are used to set the speed of the DDI interface and define if the master should wait for acknowledge from the slave.

The speed is set using:

- DDI_SPEED_2
- DDI_SPEED_4
- DDI_SPEED_8
- DDI_SPEED_16

The acknowledge is set using:

- DDI_NO_WAIT
- DDI_WAIT_FOR_ACK

The configuration value must be a bitwised OR'ed combination of these two features.

If the `bProtect` parameter is set the configuration register in the ADI slave is locked for write.

Note
  Once the lock bit has been set, it is no longer possible to write the configuration register.
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.
  ui32Config | is the configuration of the DDI slave. Must be an OR'ed combination of 'speed' and 'acknowledge config'.
  bProtect | decides if the register access should be protected.

Returns
  None

Definition at line 299 of file ddi.h.

__STATIC_INLINE void DDIProtect | ( | uint32_t | ui32Base | ) |

Protect a DDI slave by locking the register access.

This function will lock the register interface to the DDI.

Note
  Once locked it is no longer possible to change the configuration register in the DDI slave.
  This function uses read-modify-write to guarantee the integrity of the configuration. This might take exceedingly long time, so if the configuration is known it is advised to use the DDIConfigSet() for protecting the DDI slave configuration.
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.

Returns
  None

Definition at line 379 of file ddi.h.

__STATIC_INLINE uint32_t DDIStatusGet | ( | uint32_t | ui32Base | ) |

Get the status of the DDI.

This function will get the value of the status register. Value that can be passed to this function are DDI.

Note
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.

Returns
  Returns the current value of the status register.

Definition at line 247 of file ddi.h.

__STATIC_INLINE void DDISync | ( | uint32_t | ui32Base | ) |

Synchronize a DDI slave.

This function will perform a sync on the DDI slave by issuing a NOP DDI/DDI command to the master with REQ=0. In other words, the master performs a dummy write request to ensure the master and slave are synchronized.

Note
  It is recommended to sync with all the DDI slaves before a power down of a DDI master.
  Both the AUX module and the clock for the AUX SMPH module must be enabled before calling this function.

Parameters

  ui32Base | is DDI base address.

Returns
  None

Definition at line 343 of file ddi.h.

## Macro Definition Documentation

#define DDI_ACK 0x00000001

Definition at line 117 of file ddi.h.

#define DDI_CONFIG_MASK 0x00000007

Definition at line 109 of file ddi.h.

#define DDI_NO_WAIT 0x00000000

Definition at line 103 of file ddi.h.

Referenced by DDIConfigSet().

#define DDI_PROTECT 0x00000080

Definition at line 116 of file ddi.h.

Referenced by DDIConfigSet(), and DDIProtect().

#define DDI_SLAVE_REGS 64

Definition at line 96 of file ddi.h.

Referenced by DDI16SetValBit(), DDI32BitsClear(), DDI32BitsSet(), DDI32RegRead(), DDI32RegWrite(), and DDI8SetValBit().

#define DDI_SPEED_16 0x00000003

Definition at line 108 of file ddi.h.

Referenced by DDIConfigSet().

#define DDI_SPEED_2 0x00000000

Definition at line 105 of file ddi.h.

Referenced by DDIConfigSet().

#define DDI_SPEED_4 0x00000001

Definition at line 106 of file ddi.h.

Referenced by DDIConfigSet().

#define DDI_SPEED_8 0x00000002

Definition at line 107 of file ddi.h.

Referenced by DDIConfigSet().

#define DDI_SYNC 0x00000000

Definition at line 118 of file ddi.h.

Referenced by DDISync().

#define DDI_WAIT_FOR_ACK 0x00000004

Definition at line 104 of file ddi.h.

Referenced by DDIConfigSet().