#ifndef __ATtiny28_h
#define __ATtiny28_h

// Interrupt vectors

#define RESET_vect 0x0000
#define INT0_vect 0x0002
#define INT1_vect 0x0004
#define LOW-LEVEL_I/O_PINS_vect 0x0006
#define TIMER0_OVF_vect 0x0008
#define ANA_COMP_vect 0x000a

// I/O addresses


sfrb SREG = 0x5f;

sfrb PORTA = 0x3b;
#define PORTA0 0
#define PORTA1 1
#define PORTA2 2
#define PORTA3 3

sfrb PACR = 0x3a;
#define DDA0 0
#define DDA1 1
#define PA2HC 2
#define DDA3 3

sfrb PINA = 0x39;
#define PINA0 0
#define PINA1 1
#define PINA3 3

sfrb PINB = 0x36;
#define PINB0 0
#define PINB1 1
#define PINB2 2
#define PINB3 3
#define PINB4 4
#define PINB5 5
#define PINB6 6
#define PINB7 7

sfrb PORTD = 0x32;
#define PORTD0 0
#define PORTD1 1
#define PORTD2 2
#define PORTD3 3
#define PORTD4 4
#define PORTD5 5
#define PORTD6 6
#define PORTD7 7

sfrb DDRD = 0x31;
#define DDD0 0
#define DDD1 1
#define DDD2 2
#define DDD3 3
#define DDD4 4
#define DDD5 5
#define DDD6 6
#define DDD7 7

sfrb PIND = 0x30;
#define PIND0 0
#define PIND1 1
#define PIND2 2
#define PIND3 3
#define PIND4 4
#define PIND5 5
#define PIND6 6
#define PIND7 7

sfrb ACSR = 0x28;
#define ACIS0 0
#define ACIS1 1
#define ACIE 3
#define ACI 4
#define ACO 5
#define ACD 7

sfrb MCUCS = 0x27;
#define PORF 0
#define EXTRF 1
#define WDRF 3
#define SM 4
#define SE 5
#define PLUPB 7

sfrb ICR = 0x26;
#define ISC00 0
#define ISC01 1
#define ICS10 2
#define ICS11 3
#define TOIE0 4
#define LLIE 5
#define INT0 6
#define INT1 7

sfrb IFR = 0x25;
#define TOV0 4
#define INTF0 6
#define INTF1 7

sfrb TCCR0 = 0x24;
#define CS00 0
#define CS01 1
#define CS02 2
#define OOM00 3
#define OOM01 4
#define FOV0 7

sfrb TCNT0 = 0x23;
#define TCNT00 0
#define TCNT01 1
#define TCNT02 2
#define TCNT03 3
#define TCNT04 4
#define TCNT05 5
#define TCNT06 6
#define TCNT07 7

sfrb MODCR = 0x22;
#define MCONF0 0
#define MCONF1 1
#define MCONF2 2
#define ONTIM0 3
#define ONTIM1 4
#define ONTIM2 5
#define OTIM3 6
#define ONTIM4 7

sfrb WDTCR = 0x21;
#define WDP0 0
#define WDP1 1
#define WDP2 2
#define WDE 3
#define WDTOE 4
#define CAL0 0
#define CAL1 1
#define CAL2 2
#define CAL3 3
#define CAL4 4
#define CAL5 5
#define CAL6 6
#define CAL7 7

#endif