|
|
Component
TimerOut
Flip-flop output 1:1
Component Level: High
Category:
CPU Internal Peripherals-Timer
Typical Usage:
(Examples of a typical usage of the component in user code.
For more information please
see the page Component Code
Typical Usage.)
Required component name is "TO1". There are the following three typical usage modes:
(1) Note: In this case it is recommended to turn off all the methods of the component.
(2)
EVENTS.C
int event_cntr = 0;
void TO1_OnFalling()
{
++event_cntr; /* increment event counter */
}
(3)
EVENTS.C
int rpt_cntr = 255, mode = 0;
void TO1_OnFalling(void)
{
if( --rpt_cntr==0 ) { // If the event was generated 255times
if( ++mode==3 ) mode = 0; // Select next mode of the period
TO1_SetPeriodMode( mode ); // Set new period mode
rpt_cntr = 255; // Set repeat counter
}
}
(4)
MAIN.C
void main(void)
{
/* output signal synchronization */
TO1_Disable(); /* disable the component */
TO1_ClrValue(); /* set output level to LOW */
TO1_Enable(); /* enable the component */
}
|