altos/test: Adjust CRC error rate after FEC fix
[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; either version 2 of the License, or
7  * (at your option) any later version.
8  *
9  * This program is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
12  * General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License along
15  * with this program; if not, write to the Free Software Foundation, Inc.,
16  * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA.
17  */
18
19 #ifndef _AO_PINS_H_
20 #define _AO_PINS_H_
21 #include <avr/pgmspace.h>
22
23 #define AO_LED_ORANGE           (1<<4)
24 #define AO_LED_SERIAL           4
25 #define AO_LED_PANIC            AO_LED_ORANGE
26 #define AO_LED_REPORT           AO_LED_ORANGE
27 #define LEDS_AVAILABLE          (AO_LED_ORANGE)
28 #define USE_SERIAL_1_STDIN      0
29 #define HAS_USB                 0
30 #define PACKET_HAS_SLAVE        0
31 #define HAS_SERIAL_1            0
32 #define HAS_TASK                0
33 #define HAS_MS5607              1
34 #define HAS_MS5611              0
35 #define HAS_SENSOR_ERRORS       0
36 #define HAS_EEPROM              0
37 #define HAS_BEEP                0
38 #define AVR_CLOCK               250000UL
39
40 /* SPI */
41 #define SPI_PORT                PORTB
42 #define SPI_PIN                 PINB
43 #define SPI_DIR                 DDRB
44 #define AO_MS5607_CS_PORT       PORTB
45 #define AO_MS5607_CS_PIN        3
46
47 /* MS5607 */
48 #define AO_MS5607_SPI_INDEX     0
49 #define AO_MS5607_MISO_PORT     PORTB
50 #define AO_MS5607_MISO_PIN      0
51 #define AO_MS5607_BARO_OVERSAMPLE       4096
52 #define AO_MS5607_TEMP_OVERSAMPLE       1024
53
54 /* I2C */
55 #define I2C_PORT                PORTB
56 #define I2C_PIN                 PINB
57 #define I2C_DIR                 DDRB
58 #define I2C_PIN_SCL             PINB2
59 #define I2C_PIN_SDA             PINB0
60
61 #define AO_CONST_ATTRIB         PROGMEM
62 typedef int32_t alt_t;
63 #define FETCH_ALT(o)            ((alt_t) pgm_read_dword(&altitude_table[o]))
64
65 #define AO_ALT_VALUE(x)         ((x) * (alt_t) 10)
66
67 #endif /* _AO_PINS_H_ */