1.8.22.22 1.25.23.22 1.26.20.22 1.27.23.22 1.28.25.22 1.34.23.22 1.35.16.22 1.36.18.22 1.41.21.22 1.42.20.22 TCx_CHy_CaptureBGet Function
C
/* x = TC instance number, y = channel number */ /* 16 bit counter */ uint16_t TCx_CHy_CaptureBGet ( void ) /* 32 bit counter */ uint32_t TCx_CHy_CaptureBGet ( void )
Summary
Returns the Capture-B value.
Description
This function provides the Capture-B value that was stored when the selected event occurred on the input signal. The caller should call the TCx_CHy_CaptureBEventOccured function to identify if the Capture-B value has been updated by the selected signal event.
Precondition
TCx_CHy_TimerInitialize function must have been called first for the given channel to configure channel in capture mode.
Parameters
None
Returns
Most recent Capture-B value. Type of the return value varies with the bit depth of the counter
Example
16 bit counter
uint16_t capture; if (TC0_CH1_CaptureBEventOccured() == true) { capture = TC0_CH1_CaptureBGet(); }
32 bit counter
uint16_t capture; if (TC0_CH1_CaptureBEventOccured() == true) { capture = TC0_CH1_CaptureBGet(); }
Remarks
This function is applicable only for capture mode.