CC26xx Driver Library
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules Pages
[auxtdc] AUX Time to Digital Converter

Functions

__STATIC_INLINE uint32_t AUXTDCStatusGet (uint32_t ui32Base)
 Get the status of the AUX TDC internal state machine. More...
 
void AUXTDCConfigSet (uint32_t ui32Base, uint32_t ui32StartCondition, uint32_t ui32StopCondition)
 Configure the operation of the AUX TDC. More...
 
__STATIC_INLINE bool AUXTDCIdle (uint32_t ui32Base)
 Check if the AUX TDC is in idle mode. More...
 
__STATIC_INLINE void AUXTDCEnable (uint32_t ui32Base, uint32_t ui32RunMode)
 Enable the AUX TDC for a measurement. More...
 
__STATIC_INLINE void AUXTDCIdleForce (uint32_t ui32Base)
 Force the AUX TDC back to Idle mode. More...
 
uint32_t AUXTDCMeasurementDone (uint32_t ui32Base)
 Check if the AUX TDC is done measuring. More...
 
__STATIC_INLINE uint32_t AUXTDCMeasurementGet (uint32_t ui32Base)
 Get the value of the latest measurement. More...
 
__STATIC_INLINE void AUXTDCLimitSet (uint32_t ui32Base, uint32_t ui32Limit)
 Set the saturation limit of the measurement. More...
 
__STATIC_INLINE uint32_t AUXTDCLimitGet (uint32_t ui32Base)
 Get the saturation limit of the measurement. More...
 
__STATIC_INLINE bool AUXTDCCounterEnable (uint32_t ui32Base)
 Enables the counter if possible. More...
 
__STATIC_INLINE bool AUXTDCCounterDisable (uint32_t ui32Base)
 Disables the counter if possible. More...
 
__STATIC_INLINE bool AUXTDCCounterSet (uint32_t ui32Base, uint32_t ui32Events)
 Set the reset number of counter compare/stop event to ignore before taking a measurement. More...
 
__STATIC_INLINE uint32_t AUXTDCCounterGet (uint32_t ui32Base)
 Get the current number of counter compare/stop event to ignore before taking a measurement. More...
 

Detailed Description

Function Documentation

void AUXTDCConfigSet ( uint32_t  ui32Base,
uint32_t  ui32StartCondition,
uint32_t  ui32StopCondition 
)

Configure the operation of the AUX TDC.

Use this function to configure the start and stop event for the AUX TDC.

The ui32StartCondition must be a bitwise OR of the start event and the polarity of the start event. The start events are:

The polarity of the start event is either rising AUXTDC_STARTPOL_RIS or falling AUXTDC_STARTPOL_FALL.

The ui32StopCondition must be a bitwise OR of the stop event and the polarity of the stop event. The stop events are:

The polarity of the stop event is either rising AUXTDC_STOPPOL_RIS or falling AUXTDC_STOPPOL_FALL.

Note
The AUX TDC should only be configured when the AUX TDC is in the Idle state. To ensure that software does not lock up, it is recommended to ensure that the AUX TDC is actually in idle when calling AUXTDCConfigSet(). This can be tested using AUXTDCIdle().
Parameters
ui32Baseis base address of the AUX TDC.
ui32StartConditionis AUX TDC a bitwise OR of a start event and polarity.
ui32StopConditionis AUX TDC a bitwise OR of a stop event and polarity.
Returns
None
See also
AUXTDCConfigSet(), AUXTDCIdle()

Definition at line 60 of file aux_tdc.c.

__STATIC_INLINE bool AUXTDCCounterDisable ( uint32_t  ui32Base)

Disables the counter if possible.

This function can be used to disable the AUX TDC stop/compare event counter.

Parameters
ui32Baseis base address of the AUX TDC.
Returns
Returns true if the counter was succesfully disabled. If the AUX TDC is not in Idle mode, the counter can not be disabled, and the return value will be false.
See also
AUXTDCCounterEnable() for more information on how to use the counter.

Definition at line 666 of file aux_tdc.h.

__STATIC_INLINE bool AUXTDCCounterEnable ( uint32_t  ui32Base)

Enables the counter if possible.

This function can be used to ensable the AUX TDC stop/compare event counter. The counter can be used to measure multiple periods of a clock signal. For each stop/compare event the counter will be decremented by one and the measurement will continue running until the value of the counter reaches 0. The current value of the counter can be read using AUXTDCCounterGet(). The reset value of the counter can be set using AUXTDCCounterSet().

Parameters
ui32Baseis base address of the AUX TDC.
Returns
Returns true if the counter was succesfully enabled. If the AUX TDC is not in Idle mode, the counter can not be enabled, and the return value will be false.
See also
AUXTDCCounterGet(), AUXTDCCounterSet()

Definition at line 622 of file aux_tdc.h.

__STATIC_INLINE uint32_t AUXTDCCounterGet ( uint32_t  ui32Base)

Get the current number of counter compare/stop event to ignore before taking a measurement.

This function returns the current value of compare/stop events before a measurement is registered. This value is decremented by one for each registered compare/stop event and will always be less than or equal the reset value of the counter set using AUXTDCCounterSet().

Parameters
ui32Baseis base address of the AUX TDC.
Returns
Returns the current value of compare/stop events ignored before a measurement is performed.
See also
AUXTDCCounterEnable().

Definition at line 762 of file aux_tdc.h.

__STATIC_INLINE bool AUXTDCCounterSet ( uint32_t  ui32Base,
uint32_t  ui32Events 
)

Set the reset number of counter compare/stop event to ignore before taking a measurement.

This function loads the reset value of the counter with the specified number of events to ignore. A reset in this context means the counter has been disabled and then enabled.

Parameters
ui32Baseis base address of the AUX TDC.
ui32Eventsis the number of compare/stop events to load into the counter.
Returns
Returns true if the counter was succesfully updated. If the AUX TDC is not in Idle mode, the counter can not be updated, and the return value will be false.
See also
AUXTDCCounterEnable()

Definition at line 715 of file aux_tdc.h.

__STATIC_INLINE void AUXTDCEnable ( uint32_t  ui32Base,
uint32_t  ui32RunMode 
)

Enable the AUX TDC for a measurement.

This function is used for arming the AUX TDC to begin a measurement as soon as the start condition is met. There are two run modes: AUX_TDC_RUNSYNC will wait for a falling event of the start pulse before starting measurement on next rising edge of start. This guarantees an edge triggered start and is recommended for frequency measurements. If the first falling edge is close to the start command it may be missed, but the TDC shall catch later falling edges and in any case guarantee a measurement start synchronous to the rising edge of the start event. The AUX_TDC_RUN is asynchronous start and asynchronous stop mode. Using this a TDC measurement may start immediately if start is high and hence it may not give precise edge to edge measurements. This mode is only recommended when start pulse is guaranteed to arrive at least 7 clock periods after command.

Note
The AUX TDC should be configured and in Idle mode before calling this function.
Parameters
ui32Baseis the base address of the AUX TDC.
ui32RunModeis the run mode for the AUX TDC.
Returns
None

Definition at line 424 of file aux_tdc.h.

__STATIC_INLINE bool AUXTDCIdle ( uint32_t  ui32Base)

Check if the AUX TDC is in idle mode.

This function can be used to check whether the AUX TDC internal state machine is in idle mode. This is required before setting the polarity of the start and stop event.

Parameters
ui32Baseis the base address of the AUX TDC.
Returns
Returns true if state machine is in idle and returns false if the state machine is in any other state.

Definition at line 380 of file aux_tdc.h.

__STATIC_INLINE void AUXTDCIdleForce ( uint32_t  ui32Base)

Force the AUX TDC back to Idle mode.

This function will force the AUX TDC in Idle mode. The internal state machine will not go directly to Idle mode, so it is left to the programmer to ensure that the state machine is in Idle mode before doing any new configuration. This can be checked using AUXTDCIdle().

Parameters
ui32Baseis the base address of the AUX TDC.
Returns
None
See also
AUXTDCIdle()

Definition at line 456 of file aux_tdc.h.

__STATIC_INLINE uint32_t AUXTDCLimitGet ( uint32_t  ui32Base)

Get the saturation limit of the measurement.

This function is used to retrieve the current saturation for the accumulator register.

Parameters
ui32Baseis base address of the AUX TDC.
Returns
Returns the saturation limit.
See also
AUXTDCLimitSet()

Definition at line 587 of file aux_tdc.h.

__STATIC_INLINE void AUXTDCLimitSet ( uint32_t  ui32Base,
uint32_t  ui32Limit 
)

Set the saturation limit of the measurement.

This function is used to set a saturation limit for the event accumulation register. The saturation limit is defined as a bit width of the accumulation register and therefore increases in power of 2.

Parameters
ui32Baseis base address of the AUX TDC.
ui32Limitis the saturation limit.
Returns
None
See also
AUXTDCLimitGet()

Definition at line 545 of file aux_tdc.h.

uint32_t AUXTDCMeasurementDone ( uint32_t  ui32Base)

Check if the AUX TDC is done measuring.

This function can be used to check whether the AUX TDC has finished a measurement. The AUX TDC may have completed a measurement for two reasons. Either it finish succesfully AUX_TDC_DONE or it failed due to a timeout AUX_TDC_TIMEOUT. If the AUX TDC is still measuring it this function will return AUX_TDC_BUSY.

Parameters
ui32Baseis the base address of the AUX TDC.
Returns
Returns the current status of a measurement:

Definition at line 94 of file aux_tdc.c.

__STATIC_INLINE uint32_t AUXTDCMeasurementGet ( uint32_t  ui32Base)

Get the value of the latest measurement.

This function is used for retrieving the value of the lastest measurement performed by the AUX TDC.

Parameters
ui32Baseis the base address of the AUX TDC.
Returns
Returns the result of the latest measurement.

Definition at line 502 of file aux_tdc.h.

__STATIC_INLINE uint32_t AUXTDCStatusGet ( uint32_t  ui32Base)

Get the status of the AUX TDC internal state machine.

This function will return the current state of the AUX TDC internal state machine.

Parameters
ui32Baseis base address of the AUX TDC
Returns
Returns the current state of the state machine. Possible states for the state machine are:

Definition at line 264 of file aux_tdc.h.

Macro Definition Documentation

#define AUX_TDC_ABORT   0x00000003

Definition at line 104 of file aux_tdc.h.

#define AUX_TDC_BUSY   0x00000001

Definition at line 93 of file aux_tdc.h.

Referenced by AUXTDCMeasurementDone().

#define AUX_TDC_DONE   0x00000004

Definition at line 95 of file aux_tdc.h.

Referenced by AUXTDCMeasurementDone().

#define AUX_TDC_RUN   0x00000002

Definition at line 103 of file aux_tdc.h.

Referenced by AUXTDCEnable().

#define AUX_TDC_RUNSYNC   0x00000001

Definition at line 102 of file aux_tdc.h.

Referenced by AUXTDCEnable().

#define AUX_TDC_TIMEOUT   0x00000002

Definition at line 94 of file aux_tdc.h.

Referenced by AUXTDCMeasurementDone().

#define AUXTDC_CLRCNT   AUX_TDC_STAT_STATE_CLR_CNT

Definition at line 114 of file aux_tdc.h.

#define AUXTDC_FORCE_STOP   AUX_TDC_STAT_STATE_FORCE_STOP

Definition at line 121 of file aux_tdc.h.

#define AUXTDC_GETRESULTS   AUX_TDC_STAT_STATE_GET_RESULT

Definition at line 117 of file aux_tdc.h.

#define AUXTDC_IDLE   AUX_TDC_STAT_STATE_IDLE

Definition at line 113 of file aux_tdc.h.

#define AUXTDC_NUM_SAT_VALS   16

Definition at line 211 of file aux_tdc.h.

Referenced by AUXTDCLimitSet().

#define AUXTDC_POR   AUX_TDC_STAT_STATE_POR

Definition at line 118 of file aux_tdc.h.

#define AUXTDC_SAT_1024   0x00000001

Definition at line 196 of file aux_tdc.h.

#define AUXTDC_SAT_1048576   0x0000000B

Definition at line 206 of file aux_tdc.h.

#define AUXTDC_SAT_131072   0x00000008

Definition at line 203 of file aux_tdc.h.

#define AUXTDC_SAT_16384   0x00000005

Definition at line 200 of file aux_tdc.h.

#define AUXTDC_SAT_2048   0x00000002

Definition at line 197 of file aux_tdc.h.

#define AUXTDC_SAT_2097152   0x0000000C

Definition at line 207 of file aux_tdc.h.

#define AUXTDC_SAT_262144   0x00000009

Definition at line 204 of file aux_tdc.h.

#define AUXTDC_SAT_32768   0x00000006

Definition at line 201 of file aux_tdc.h.

#define AUXTDC_SAT_4096   0x00000003

Definition at line 198 of file aux_tdc.h.

#define AUXTDC_SAT_4194304   0x0000000D

Definition at line 208 of file aux_tdc.h.

#define AUXTDC_SAT_512   0x00000000

Definition at line 195 of file aux_tdc.h.

#define AUXTDC_SAT_524288   0x0000000A

Definition at line 205 of file aux_tdc.h.

#define AUXTDC_SAT_65536   0x00000007

Definition at line 202 of file aux_tdc.h.

#define AUXTDC_SAT_8192   0x00000004

Definition at line 199 of file aux_tdc.h.

#define AUXTDC_SAT_8388608   0x0000000E

Definition at line 209 of file aux_tdc.h.

#define AUXTDC_SAT_WRAP_AROUND   0x0000000F

Definition at line 210 of file aux_tdc.h.

#define AUXTDC_START_ACLK   0x0000001D

Definition at line 186 of file aux_tdc.h.

#define AUXTDC_START_ADC_DONE   0x00000007

Definition at line 169 of file aux_tdc.h.

#define AUXTDC_START_AIO0   0x0000000D

Definition at line 170 of file aux_tdc.h.

#define AUXTDC_START_AIO1   0x0000000E

Definition at line 171 of file aux_tdc.h.

#define AUXTDC_START_AIO10   0x00000017

Definition at line 180 of file aux_tdc.h.

#define AUXTDC_START_AIO11   0x00000018

Definition at line 181 of file aux_tdc.h.

#define AUXTDC_START_AIO12   0x00000019

Definition at line 182 of file aux_tdc.h.

#define AUXTDC_START_AIO13   0x0000001A

Definition at line 183 of file aux_tdc.h.

#define AUXTDC_START_AIO14   0x0000001B

Definition at line 184 of file aux_tdc.h.

#define AUXTDC_START_AIO15   0x0000001C

Definition at line 185 of file aux_tdc.h.

#define AUXTDC_START_AIO2   0x0000000F

Definition at line 172 of file aux_tdc.h.

#define AUXTDC_START_AIO3   0x00000010

Definition at line 173 of file aux_tdc.h.

#define AUXTDC_START_AIO4   0x00000011

Definition at line 174 of file aux_tdc.h.

#define AUXTDC_START_AIO5   0x00000012

Definition at line 175 of file aux_tdc.h.

#define AUXTDC_START_AIO6   0x00000013

Definition at line 176 of file aux_tdc.h.

#define AUXTDC_START_AIO7   0x00000014

Definition at line 177 of file aux_tdc.h.

#define AUXTDC_START_AIO8   0x00000015

Definition at line 178 of file aux_tdc.h.

#define AUXTDC_START_AIO9   0x00000016

Definition at line 179 of file aux_tdc.h.

#define AUXTDC_START_AON_WUC   0x00000000

Definition at line 163 of file aux_tdc.h.

#define AUXTDC_START_CMP_A   0x00000001

Definition at line 164 of file aux_tdc.h.

#define AUXTDC_START_CMP_B   0x00000002

Definition at line 165 of file aux_tdc.h.

#define AUXTDC_START_CS_RESET   0x00000003

Definition at line 166 of file aux_tdc.h.

#define AUXTDC_START_FALL   AUX_TDC_STAT_STATE_START_FALL

Definition at line 120 of file aux_tdc.h.

#define AUXTDC_START_MCU_EVT   0x0000001E

Definition at line 187 of file aux_tdc.h.

#define AUXTDC_START_PRESCALER   0x0000001F

Definition at line 188 of file aux_tdc.h.

#define AUXTDC_START_TIMER0   0x00000004

Definition at line 167 of file aux_tdc.h.

#define AUXTDC_START_TIMER1   0x00000005

Definition at line 168 of file aux_tdc.h.

#define AUXTDC_STARTPOL_FALL   0x00002000

Definition at line 161 of file aux_tdc.h.

#define AUXTDC_STARTPOL_RIS   0x00000000

Definition at line 159 of file aux_tdc.h.

#define AUXTDC_STOP_ACLK   0x00001D00

Definition at line 155 of file aux_tdc.h.

#define AUXTDC_STOP_ADC_DONE   0x00000700

Definition at line 138 of file aux_tdc.h.

#define AUXTDC_STOP_AIO0   0x00000D00

Definition at line 139 of file aux_tdc.h.

#define AUXTDC_STOP_AIO1   0x00000E00

Definition at line 140 of file aux_tdc.h.

#define AUXTDC_STOP_AIO10   0x00001700

Definition at line 149 of file aux_tdc.h.

#define AUXTDC_STOP_AIO11   0x00001800

Definition at line 150 of file aux_tdc.h.

#define AUXTDC_STOP_AIO12   0x00001900

Definition at line 151 of file aux_tdc.h.

#define AUXTDC_STOP_AIO13   0x00001A00

Definition at line 152 of file aux_tdc.h.

#define AUXTDC_STOP_AIO14   0x00001B00

Definition at line 153 of file aux_tdc.h.

#define AUXTDC_STOP_AIO15   0x00001C00

Definition at line 154 of file aux_tdc.h.

#define AUXTDC_STOP_AIO2   0x00000F00

Definition at line 141 of file aux_tdc.h.

#define AUXTDC_STOP_AIO3   0x00001000

Definition at line 142 of file aux_tdc.h.

#define AUXTDC_STOP_AIO4   0x00001100

Definition at line 143 of file aux_tdc.h.

#define AUXTDC_STOP_AIO5   0x00001200

Definition at line 144 of file aux_tdc.h.

#define AUXTDC_STOP_AIO6   0x00001300

Definition at line 145 of file aux_tdc.h.

#define AUXTDC_STOP_AIO7   0x00001400

Definition at line 146 of file aux_tdc.h.

#define AUXTDC_STOP_AIO8   0x00001500

Definition at line 147 of file aux_tdc.h.

#define AUXTDC_STOP_AIO9   0x00001600

Definition at line 148 of file aux_tdc.h.

#define AUXTDC_STOP_AON_WUC   0x00000000

Definition at line 132 of file aux_tdc.h.

#define AUXTDC_STOP_CMP_A   0x00000100

Definition at line 133 of file aux_tdc.h.

#define AUXTDC_STOP_CMP_B   0x00000200

Definition at line 134 of file aux_tdc.h.

#define AUXTDC_STOP_CS_RESET   0x00000300

Definition at line 135 of file aux_tdc.h.

#define AUXTDC_STOP_MCU_EVT   0x00001E00

Definition at line 156 of file aux_tdc.h.

#define AUXTDC_STOP_PRESCALER   0x00001F00

Definition at line 157 of file aux_tdc.h.

#define AUXTDC_STOP_TIMER0   0x00000400

Definition at line 136 of file aux_tdc.h.

#define AUXTDC_STOP_TIMER1   0x00000500

Definition at line 137 of file aux_tdc.h.

#define AUXTDC_STOPPOL_FALL   0x00002000

Definition at line 130 of file aux_tdc.h.

#define AUXTDC_STOPPOL_RIS   0x00000000

Definition at line 128 of file aux_tdc.h.

#define AUXTDC_WAIT_CLRCNT_DONE   AUX_TDC_STAT_STATE_WAIT_CLR_CNT_DONE

Definition at line 119 of file aux_tdc.h.

#define AUXTDC_WAIT_START   AUX_TDC_STAT_STATE_WAIT_START

Definition at line 111 of file aux_tdc.h.

#define AUXTDC_WAIT_START_CNTEN   AUX_TDC_STAT_STATE_WAIT_START_STOP_CNT_EN

Definition at line 112 of file aux_tdc.h.

#define AUXTDC_WAIT_STOP   AUX_TDC_STAT_STATE_WAIT_STOP

Definition at line 115 of file aux_tdc.h.

#define AUXTDC_WAIT_STOP_CNTDOWN   AUX_TDC_STAT_STATE_WAIT_STOP_CNTDWN

Definition at line 116 of file aux_tdc.h.