2 * Copyright © 2013 Keith Packard <keithp@keithp.com>
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.
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.
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.
19 #define HAS_BATTERY_REPORT 1
21 #define AO_STACK_SIZE 376
23 #define IS_FLASH_LOADER 0
25 /* Crystal on the board */
26 #define AO_LPC_CLKIN 12000000
28 /* Main clock frequency. 48MHz for USB so we don't use the USB PLL */
29 #define AO_LPC_CLKOUT 48000000
31 /* System clock frequency */
32 #define AO_LPC_SYSCLK 24000000
36 #define HAS_USB_CONNECT 0
37 #define HAS_USB_VBUS 0
38 #define HAS_USB_PULLUP 1
39 #define AO_USB_PULLUP_PORT 0
40 #define AO_USB_PULLUP_PIN 20
42 #define PACKET_HAS_SLAVE 0
44 #define AO_LOG_FORMAT AO_LOG_FORMAT_EASYMINI
49 #define USE_SERIAL_0_STDIN 1
50 #define SERIAL_0_18_19 1
51 #define SERIAL_0_14_15 0
52 #define SERIAL_0_17_18 0
53 #define SERIAL_0_26_27 0
58 #define SPI_SCK0_P0_6 1
60 #define SPI_SCK1_P1_15 1
61 #define SPI_MISO1_P0_22 1
62 #define SPI_MOSI1_P0_21 1
66 #define M25_MAX_CHIPS 1
67 #define AO_M25_SPI_CS_PORT 0
68 #define AO_M25_SPI_CS_MASK (1 << 23)
69 #define AO_M25_SPI_BUS 1
75 #define AO_MS5607_PRIVATE_PINS 0
76 #define AO_MS5607_CS_PORT 0
77 #define AO_MS5607_CS_PIN 7
78 #define AO_MS5607_CS_MASK (1 << AO_MS5607_CS_PIN)
79 #define AO_MS5607_MISO_PORT 0
80 #define AO_MS5607_MISO_PIN 8
81 #define AO_MS5607_MISO_MASK (1 << AO_MS5607_MISO_PIN)
82 #define AO_MS5607_SPI_INDEX 0
89 #define HAS_TELEMETRY 0
92 #define USE_INTERNAL_FLASH 0
94 #define HAS_IGNITE_REPORT 1
96 #define AO_DATA_RING 16
120 #define AO_IGNITER_CLOSED 400
121 #define AO_IGNITER_OPEN 60
123 #define AO_IGNITER_DROGUE_PORT 0
124 #define AO_IGNITER_DROGUE_PIN 2
125 #define AO_IGNITER_SET_DROGUE(v) ao_gpio_set(AO_IGNITER_DROGUE_PORT, AO_IGNITER_DROGUE_PIN, AO_IGNITER_DROGUE, v)
127 #define AO_IGNITER_MAIN_PORT 0
128 #define AO_IGNITER_MAIN_PIN 3
129 #define AO_IGNITER_SET_MAIN(v) ao_gpio_set(AO_IGNITER_MAIN_PORT, AO_IGNITER_MAIN_PIN, AO_IGNITER_MAIN, v)
131 #define AO_SENSE_DROGUE(p) ((p)->adc.sense_a)
132 #define AO_SENSE_MAIN(p) ((p)->adc.sense_m)
134 #define AO_ADC_DUMP(p) \
135 printf("tick: %5u apogee: %5d main: %5d batt: %5d\n", \
136 (p)->tick, (p)->adc.sense_a, (p)->adc.sense_m, (p)->adc.v_batt)
139 * Voltage divider on ADC battery sampler
141 #define AO_BATTERY_DIV_PLUS 100 /* 100k */
142 #define AO_BATTERY_DIV_MINUS 27 /* 27k */
145 * Voltage divider on ADC igniter samplers
147 #define AO_IGNITE_DIV_PLUS 100 /* 100k */
148 #define AO_IGNITE_DIV_MINUS 27 /* 27k */
151 * ADC reference in decivolts
153 #define AO_ADC_REFERENCE_DV 33