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... | |
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.
ui32Base | is base address of the AUX TDC. |
ui32StartCondition | is AUX TDC a bitwise OR of a start event and polarity. |
ui32StopCondition | is AUX TDC a bitwise OR of a stop event and polarity. |
__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.
ui32Base | is base address of the AUX TDC. |
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
.__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().
ui32Base | is base address of the AUX TDC. |
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
.__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().
ui32Base | is base address of the AUX TDC. |
__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.
ui32Base | is base address of the AUX TDC. |
ui32Events | is the number of compare/stop events to load into the counter. |
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
.__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.
ui32Base | is the base address of the AUX TDC. |
ui32RunMode | is the run mode for the AUX TDC.
|
__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.
ui32Base | is the base address of the AUX TDC. |
true
if state machine is in idle and returns false
if the state machine is in any other state. __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().
ui32Base | is the base address of the AUX TDC. |
__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.
ui32Base | is base address of the AUX TDC. |
__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.
ui32Base | is base address of the AUX TDC. |
ui32Limit | is the saturation limit. |
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.
ui32Base | is the base address of the AUX TDC. |
__STATIC_INLINE uint32_t AUXTDCMeasurementGet | ( | uint32_t | ui32Base | ) |
__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.
ui32Base | is base address of the AUX TDC |
#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_NUM_SAT_VALS 16 |
Definition at line 211 of file aux_tdc.h.
Referenced by AUXTDCLimitSet().
#define AUXTDC_WAIT_CLRCNT_DONE AUX_TDC_STAT_STATE_WAIT_CLR_CNT_DONE |
#define AUXTDC_WAIT_START_CNTEN AUX_TDC_STAT_STATE_WAIT_START_STOP_CNT_EN |