pic_timer.h File Reference

Pic timer routines. More...

#include "pic_utils.h"

Include dependency graph for pic_timer.h:

This graph shows which files directly or indirectly include this file:

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.


Detailed Description

It's the way cool interrupt driven timer library

Ian Harris 2007 imharris [at] gmail.com

Released under the "do whatever you like with this but if you use it send me an email" license. Oh, and if it breaks, you get to keep both pieces.

Definition in file pic_timer.h.


Define Documentation

#define TIMER_16BIT_MODE   0

Timer mode for devices where this is applicable (16bit timer)

Definition at line 19 of file pic_timer.h.

#define TIMER_8BIT_MODE   1

Timer mode for devices where this is applicable (8bit timer)

Definition at line 21 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_128   0x06

Definition at line 30 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_16   0x03

Definition at line 27 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_2   0x00

Definition at line 24 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_256   0x07

Definition at line 31 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_32   0x04

Definition at line 28 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_4   0x01

Definition at line 25 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_64   0x05

Definition at line 29 of file pic_timer.h.

#define TIMER_PRESCALER_1_TO_8   0x02

Definition at line 26 of file pic_timer.h.

#define TIMER_PRESCALER_OFF   0xff

Definition at line 23 of file pic_timer.h.


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.

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.


Generated on Fri May 16 12:19:25 2008 for Pic Pack by  doxygen 1.5.5