1.28.25.14 TCx_CHy_CompareStatusGet Function

C

/* x = TC instance number, y= channel number */
TCx_COMPARE_STATUS TCx_CHy_CompareStatusGet ( void )

Summary

Identifies status of the compare events

Description

This function returns the status of the events that occur in compare mode.

Precondition

TCx_CHy_CompareInitialize() function must have been called first for the given channel to configure channel in capture mode.

Parameters

None

Returns

Status of the capture events as TCx_COMPARE_STATUS type

Example

if ((TC0_CH1_CompareStatusGet() & TC_COMPARE_C) == true)
{
    TC0_CH1_CompareASet(0x1000U);
    TC0_CH1_CompareBSet(0x500U);
}

Remarks

This function is applicable only for compare mode. Event status bits are cleared after reading the status register.