Subversion Repositories group.electronics

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
126 pfowler 1
#ifndef avrutil_h
2
#define avrutil_h
123 pfowler 3
 
4
#define sbi(sfr, bit)   ((sfr) |= _BV(bit))
5
#define cbi(sfr, bit)   ((sfr) &= ~(_BV(bit)))
6
#define xbi(sfr, bit)   ((sfr) ^= _BV(bit))
7
#define rbi(sfr, bit)   (((sfr) >> (bit)) & 0x01)
8
 
126 pfowler 9
#define HIGH 1
10
#define LOW 0
11
#define OUTPUT 1
12
#define INPUT 0
13
#define ON 1
14
#define OFF 0
15
 
16
volatile uint32_t systime;
17
 
123 pfowler 18
inline uint8_t map_8(uint8_t x, uint8_t in_min, uint8_t in_max, uint8_t out_min, uint8_t out_max);
19
void analogInit(void);
20
uint8_t analogRead(uint8_t channel);
21
typedef void (*tick_ptr)();
22
void sysclockInit(void);
23
inline void delay_ms(uint16_t count);
24
void pulsePin(uint8_t port, uint8_t pin, uint16_t count);
25
 
126 pfowler 26
void swap_u8(uint8_t* a, uint8_t* b);
27
void swap_u16(uint16_t* a, uint16_t* b);
28
 
29
void statusLed(uint8_t state);
30
 
123 pfowler 31
#endif