SIM_INTERFACE(i8051_timer) { void (*change_mode)(conf_object_t *NOTNULL obj, uint8 mode); void (*switch_timer)(conf_object_t *obj, uint8 caller, bool onoff); }; #define I8051_TIMER_INTERFACE "i8051_timer"
The change_mode function is used to change the working mode (e.g. 16bit timer, 8 bit timer or event counting etc.) of the timer.
The switch_timer function is used to enable or disable the timer. Timers can be switched on or off by either software or hardware. The parameter caller is either 0 or 1, indicating the control is from software or hardware. Only when the timer is switched on or off by hardware, the third parameter onoff is used, which indicates whether the timer is to be enabled or disabled.