Subversion Repositories group.electronics

Rev

Blame | Last modification | View Log | RSS feed

#ifndef petelib_h
#define petelib_h

#define F_CPU   16000000

#define sbi(sfr, bit)   ((sfr) |= _BV(bit))
#define cbi(sfr, bit)   ((sfr) &= ~(_BV(bit)))
#define xbi(sfr, bit)   ((sfr) ^= _BV(bit))
#define rbi(sfr, bit)   (((sfr) >> (bit)) & 0x01)

inline uint8_t map_8(uint8_t x, uint8_t in_min, uint8_t in_max, uint8_t out_min, uint8_t out_max);

void analogInit(void);
uint8_t analogRead(uint8_t channel);

#endif