2013-03-31 21:13:51 -06:00
|
|
|
#ifndef AVR_H
|
|
|
|
#define AVR_H
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
#include <avr/io.h>
|
|
|
|
#include <avr/interrupt.h>
|
|
|
|
|
2013-04-01 21:17:18 -06:00
|
|
|
#define bit(pin, bit, on) pin = (on ? (pin | bit) : (pin & ~bit))
|
|
|
|
|
2014-01-12 11:05:18 -07:00
|
|
|
#define sin(on) bit(PORTA, _BV(SIN), on)
|
|
|
|
#define sclk(on) bit(PORTA, _BV(SCLK), on)
|
|
|
|
#define sltch(on) bit(PORTA, _BV(SLTCH), on)
|
2013-03-31 21:13:51 -06:00
|
|
|
|
2014-01-12 11:05:18 -07:00
|
|
|
#define nesclk(on) bit(PORTA, _BV(NESCLK), on)
|
|
|
|
#define nesltch(on) bit(PORTA, _BV(NESLTCH), on)
|
2013-05-04 19:46:18 -06:00
|
|
|
#define nesout() ((PINA & _BV(NESOUT)) << NESOUT)
|
2013-03-31 21:13:51 -06:00
|
|
|
|
|
|
|
void init(void);
|
|
|
|
|
2013-07-28 21:42:25 -06:00
|
|
|
#endif
|