-
Notifications
You must be signed in to change notification settings - Fork 3
/
main.h
45 lines (39 loc) · 950 Bytes
/
main.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/**
* wiegand-avr fimrware for ATTINY44/84
*
* main.h - main header file
*
* (c) 2017 Sam Thompson <[email protected]>
* The MIT License
*/
#ifndef _MAIN_H
#define _MAIN_H
#include <util/parity.h>
/**
* Wiegand I/O
*/
#define WGD_DIR_REG DDRA
#define WGD_OUT_REG PORTA
#define WGD_IN_REG PINA
#define WGD_D0 PA0
#define WGD_D1 PA1
#define WGD_PCINT_D0 PCINT0
#define WGD_PCINT_D1 PCINT1
/**
* IRQ settings
*/
#define IRQ_DIR_REG DDRB
#define IRQ_OUT_REG PORTB
#define IRQ_SIGNAL PB2
/**
* USI I/O
*/
#define USI_DIR_REG DDRA
#define USI_OUT_REG PORTA
#define USI_IN_REG PINA
#define USI_CLOCK_PIN PA4
#define USI_DATAIN_PIN PA6
#define USI_DATAOUT_PIN PA5
/** Just like _BV() but for 64-bit integers */
#define _BV_ULL(b) (1ULL<<(b))
#endif