1.26.20.20 TCx_CHy_CompareFrequencyGet Function

C

/* x = TC instance number, y= channel number */
uint32_t TCx_CHy_CompareFrequencyGet ( void )

Summary

Provides the given timer's counter-increment frequency in compare mode.

Description

This function provides the frequency at which the given counter increments in compare mode. It can be used to convert differences between counter values to real time or real-time intervals to timer period values.

Precondition

TCx_CHy_CompareInitialize function must have been called first for the given channel.

Parameters

None

Returns

The frequency (in Hz) at which the timer's counter increments.

Example

uint32_t frequency;
TC0_CH1_CompareInitialize();
frequency = TC0_CH1_CompareFrequencyGet();

Remarks

None