blob: 6d6e7ac0b7e1b33b3cd0a17b97c34991debd7c90 [file] [log] [blame]
Brian Silvermanf92396c2013-09-12 20:13:13 -07001#ifndef GYRO_BOARD_USB_DIGITAL_H_
2#define GYRO_BOARD_USB_DIGITAL_H_
3
4#define readGPIO(gpio, chan) ((((gpio)->FIOPIN) >> (chan)) & 1)
5
6// These are the actual pin numbers for all of the digital I(/0) pins on the
7// board.
8//
9// GPIO1 P0.4
10// GPIO2 P0.5
11// GPIO3 P0.6
12// GPIO4 P0.7
13// GPIO5 P0.8
14// GPIO6 P0.9
15// GPIO7 P2.0
16// GPIO8 P2.1
17// GPIO9 P2.2
18// GPIO10 P2.3
19// GPIO11 P2.4
20// GPIO12 P2.5
21//
22// DIP0 P1.29
23// DIP1 P2.13
24// DIP2 P0.11
25// DIP3 P0.10
26//
27// ENC0A 1.20
28// ENC0B 1.23
29// ENC1A 2.11
30// ENC1B 2.12
31// ENC2A 0.21
32// ENC2B 0.22
33// ENC3A 0.19
34// ENC3B 0.20
35
36void digital_init(void);
37
38int digital(int channel);
39
40int dip_switch(int channel);
41
42// Boolean set by digital_init() which says whether or not this is the 3rd
43// robot.
44extern int is_bot3;
45
46#endif // GYRO_BOARD_USB_DIGITAL_H_