altos: Add initial micropeak implementation
[fw/altos] / src / micropeak / ao_pins.h
1 /*
2  * Copyright © 2011 Keith Packard <keithp@keithp.com>
3  *
4  * This program is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License as published by
6  * the Free Software Foundation; version 2 of the License.
7  *
8  * This program is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11  * General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License along
14  * with this program; if not, write to the Free Software Foundation, Inc.,
15  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
16  */
17
18 #ifndef _AO_PINS_H_
19 #define _AO_PINS_H_
20 #include <avr/pgmspace.h>
21
22 #define AO_LED_BLUE             (1<<4)
23 #define AO_LED_SERIAL           4
24 #define AO_LED_PANIC            AO_LED_BLUE
25 #define LEDS_AVAILABLE          (AO_LED_BLUE)
26 #define USE_SERIAL_1_STDIN      0
27 #define HAS_USB                 0
28 #define PACKET_HAS_SLAVE        0
29 #define HAS_SERIAL_1            0
30 #define HAS_TASK                0
31 #define HAS_MS5607              1
32 #define HAS_MS5611              1
33 #define HAS_EEPROM              0
34 #define HAS_BEEP                0
35 #define AVR_CLOCK               8000000UL
36
37 /* SPI */
38 #define SPI_PORT                PORTB
39 #define SPI_PIN                 PINB
40 #define SPI_DIR                 DDRB
41 #define AO_MS5607_CS_PORT       PORTB
42 #define AO_MS5607_CS_PIN        3
43
44 #define AO_MS5607_SPI_INDEX     0
45 #define AO_MS5607_MISO_PORT     PORTB
46 #define AO_MS5607_MISO_PIN      0
47
48 /* I2C */
49 #define I2C_PORT                PORTB
50 #define I2C_PIN                 PINB
51 #define I2C_DIR                 DDRB
52 #define I2C_PIN_SCL             PINB2
53 #define I2C_PIN_SDA             PINB0
54
55 #define AO_CONST_ATTRIB         PROGMEM
56 #define FETCH_ALT(o)            ((alt_t) pgm_read_dword(&altitude_table[o]))
57
58 #define AO_ALT_VALUE(x)         ((x) * 10)
59
60 #endif /* _AO_PINS_H_ */