Access to timer 0. More...
#include "pic_utils.h"
Go to the source code of this file.
Defines | |
#define | TIMER_16BIT_MODE 0 |
#define | TIMER_8BIT_MODE 1 |
#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 |
Functions | |
void | timer_0_callback () |
Timer 0 callback function. | |
void | timer_setup_0 (bit mode_16_bit, uns8 prescaler_setting, uns16 timer_start_value) |
Setup timer zero with starting values. | |
void | timer_start_0 () |
Start timer 0. | |
void | timer_stop_0 () |
Stop timer 0. |
Definition in file pic_timer.h.
#define TIMER_16BIT_MODE 0 |
Timer mode for devices where this is applicable (16bit timer)
Definition at line 45 of file pic_timer.h.
#define TIMER_8BIT_MODE 1 |
Timer mode for devices where this is applicable (8bit timer)
Definition at line 47 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_128 0x06 |
Definition at line 57 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_16 0x03 |
Definition at line 54 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_2 0x00 |
Definition at line 51 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_256 0x07 |
Definition at line 58 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_32 0x04 |
Definition at line 55 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_4 0x01 |
Definition at line 52 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_64 0x05 |
Definition at line 56 of file pic_timer.h.
#define TIMER_PRESCALER_1_TO_8 0x02 |
Definition at line 53 of file pic_timer.h.
#define TIMER_PRESCALER_OFF 0xff |
Definition at line 50 of file pic_timer.h.
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.
Definition at line 43 of file pic_tick.c.
References handle_tick_inline().
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.
void timer_start_0 | ( | ) |
Kicks off timer 0. In pic18 devices this will turn the timer on, on pic16 devices this will turn on timer0 interrupts.
void timer_stop_0 | ( | ) |
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.