1.8.22.21 1.25.23.21 1.26.20.21 1.27.23.21 1.28.25.21 1.34.23.21 1.35.16.21 1.36.18.21 1.41.21.21 1.42.20.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.