1.25.23.21 TCx_CHy_CaptureAGet Function

C

/* x = TC instance number, y= channel number */

/* 16 bit counter */
uint16_t TCx_CHy_CaptureAGet ( void )

/* 32 bit counter */
uint32_t TCx_CHy_CaptureAGet ( void )

Summary

Returns the Capture-A value.

Description

This function provides the Capture-A value that was stored when the selected event occurred on the input signal. The caller should call the TCx_CHy_CaptureAEventOccured function to identify if the Capture-A 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-A value. Type of return value varies with the bit width of the counter.

Example

16 bit counter

uint16_t capture;

if (TC0_CH1_CaptureAEventOccured() == true)
{
    capture = TC0_CH1_CaptureAGet();
}

32 bit counter

uint32_t capture;

if (TC0_CH1_CaptureAEventOccured() == true)
{
    capture = TC0_CH1_CaptureAGet();
}

Remarks

This function is applicable only for capture mode.