Timer 1 support. More...
#include "pic_utils.h"
Go to the source code of this file.
Defines | |
#define | TIMER1_PRESCALER_1_TO_2 0b00010000 |
#define | TIMER1_PRESCALER_1_TO_4 0b00100000 |
#define | TIMER1_PRESCALER_1_TO_8 0b00110000 |
#define | TIMER1_PRESCALER_OFF 0b00000000 |
Functions | |
void | timer_1_callback () |
Timer 1 callback function. | |
void | timer_handle_1_isr () |
handle timer 1 in interrupt service routine | |
void | timer_setup_1 (uns8 prescaler_setting, uns16 timer_start_value) |
Setup timer 1 with starting values. | |
void | timer_start_1 () |
Start timer 1. | |
void | timer_stop_1 () |
Stop timer 1. | |
Variables | |
uns16 | timer_1_start_value |
Definition in file pic_timer1.h.
#define TIMER1_PRESCALER_1_TO_2 0b00010000 |
Definition at line 44 of file pic_timer1.h.
#define TIMER1_PRESCALER_1_TO_4 0b00100000 |
Definition at line 45 of file pic_timer1.h.
#define TIMER1_PRESCALER_1_TO_8 0b00110000 |
Definition at line 46 of file pic_timer1.h.
#define TIMER1_PRESCALER_OFF 0b00000000 |
Definition at line 43 of file pic_timer1.h.
void timer_1_callback | ( | ) |
When a timer 1 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.
Referenced by timer_handle_1_isr().
void timer_handle_1_isr | ( | ) | [inline] |
Call this routine in your interrupt subroutine to automatically service timer 1 interrupts if they have occursed.
Definition at line 94 of file pic_timer1.h.
References timer_1_callback(), timer_1_start_value, and uns16.
void timer_setup_1 | ( | uns8 | prescaler_setting, | |
uns16 | timer_start_value | |||
) |
Turns off timer 1, sets prescaler setting and start value (which will be loaded on each reset).
Definition at line 43 of file pic_timer1.c.
References timer_1_start_value.
void timer_start_1 | ( | ) |
void timer_stop_1 | ( | ) |
Stops timer 1.
Definition at line 63 of file pic_timer1.c.
uns16 timer_1_start_value |
Definition at line 40 of file pic_timer1.c.
Referenced by timer_handle_1_isr(), timer_setup_1(), and timer_start_1().