pic_timer.h File Reference
Access to timer 0.
More...
Go to the source code of this file.
Detailed Description
Define Documentation
#define TIMER_16BIT_MODE 0 |
Timer mode for devices where this is applicable (16bit timer)
#define TIMER_8BIT_MODE 1 |
Timer mode for devices where this is applicable (8bit timer)
#define TIMER_PRESCALER_1_TO_128 0x06 |
#define TIMER_PRESCALER_1_TO_16 0x03 |
#define TIMER_PRESCALER_1_TO_2 0x00 |
#define TIMER_PRESCALER_1_TO_256 0x07 |
#define TIMER_PRESCALER_1_TO_32 0x04 |
#define TIMER_PRESCALER_1_TO_4 0x01 |
#define TIMER_PRESCALER_1_TO_64 0x05 |
#define TIMER_PRESCALER_1_TO_8 0x02 |
#define TIMER_PRESCALER_OFF 0xff |
Function Documentation
void timer_0_callback |
( |
|
) |
|
When a timer 0 interrupt occurs, after handling the interupt and timing issues, this callback function is executed. You will need to define this subroutine in your code, otherwise linking will fail.
void timer_setup_0 |
( |
bit |
mode_16_bit, |
|
|
uns8 |
prescaler_setting, |
|
|
uns16 |
timer_start_value | |
|
) |
| | |
Turns off timer zero, congures 16/8bit mode (only for 18f devices), prescaler setting and start value (which will be loaded on each reset.
Kicks off timer 0. In pic18 devices this will turn the timer on, on pic16 devices this will turn on timer0 interrupts.
Stops timer 0. In pic18 devices, this will switch the timer off. On pic16 devices this will merely turn off the interrupt and the timer will continue running.