2 * Copyright © 2017 Bdale Garbee <bdale@gag.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; either version 2 of the License, or
7 * (at your option) any later version.
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.
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.
22 #define LED_PORT_ENABLE STM_RCC_AHBENR_IOPBEN
23 #define LED_PORT (&stm_gpiob)
24 #define LED_PIN_GREEN 5
25 #define AO_LED_GREEN (1 << LED_PIN_GREEN)
26 #define AO_LED_PANIC AO_LED_GREEN
27 #define AO_LED_GPS_LOCK AO_LED_GREEN
29 #define LEDS_AVAILABLE (AO_LED_GREEN)
31 #define AO_STACK_SIZE 512
33 #define IS_FLASH_LOADER 0
36 #define AO_HSE 32000000
37 #define AO_RCC_CFGR_PLLMUL STM_RCC_CFGR_PLLMUL_3
42 #define AO_AHB_PRESCALER 1
43 #define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1
46 #define AO_APB_PRESCALER 1
47 #define AO_RCC_CFGR_PPRE_DIV STM_RCC_CFGR_PPRE_DIV_1
49 #define AO_RCC_CFGR2_PLLDIV STM_RCC_CFGR2_PREDIV_1
52 #define AO_USB_DIRECTIO 0
53 #define AO_PA11_PA12_RMP 1
55 #define IS_FLASH_LOADER 0
60 #define AO_ADC_PIN0_PORT (&stm_gpioa)
61 #define AO_ADC_PIN0_PIN 0
62 #define AO_ADC_PIN0_CH 0
64 #define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_IOPAEN))
68 #define AO_DATA_RING 4
71 * Voltage divider on ADC battery sampler
73 #define AO_BATTERY_DIV_PLUS 56 /* 5.6k */
74 #define AO_BATTERY_DIV_MINUS 100 /* 10k */
77 * ADC reference in decivolts
79 #define AO_ADC_REFERENCE_DV 33
85 #define AO_ADC_DUMP(p) \
86 printf("tick: %5u batt: %5d\n", \
93 #define SPI_1_PA5_PA6_PA7 1
94 #define SPI_1_PB3_PB4_PB5 0
95 #define SPI_1_OSPEEDR STM_OSPEEDR_HIGH
101 #define M25_MAX_CHIPS 1
102 #define AO_M25_SPI_CS_PORT (&stm_gpiob)
103 #define AO_M25_SPI_CS_MASK (1 << 0)
104 #define AO_M25_SPI_BUS AO_SPI_1_PA5_PA6_PA7
106 #define HAS_SERIAL_1 1
107 #define SERIAL_1_PB6_PB7 1
108 #define USE_SERIAL_1_STDIN 0
110 #define ao_gps_getchar ao_serial1_getchar
111 #define ao_gps_putchar ao_serial1_putchar
112 #define ao_gps_set_speed ao_serial1_set_speed
113 #define ao_gps_fifo (ao_usart_rx_fifo)
116 #define USE_INTERNAL_FLASH 0
118 #define HAS_TELEMETRY 1
121 #define HAS_RADIO_RECV 0
126 #define FLIGHT_LOG_APPEND 1
127 #define HAS_TRACKER 1
130 #define AO_CONFIG_DEFAULT_APRS_INTERVAL 0
131 #define AO_CONFIG_DEFAULT_RADIO_POWER 0xc0
137 #define AO_SERIAL_SPEED_UBLOX AO_SERIAL_SPEED_9600
144 /* gets pretty close to 434.550 */
146 #define AO_RADIO_CAL_DEFAULT 5695733
148 #define AO_FEC_DEBUG 0
149 #define AO_CC1200_SPI_CS_PORT (&stm_gpioa)
150 #define AO_CC1200_SPI_CS_PIN 5
151 #define AO_CC1200_SPI_BUS AO_SPI_1_PA5_PA6_PA7
152 #define AO_CC1200_SPI stm_spi1
153 #define AO_CC1200_SPI_SPEED AO_SPI_SPEED_6MHz
155 #define AO_CC1200_INT_PORT (&stm_gpioa)
156 #define AO_CC1200_INT_PIN 4
157 #define AO_CC1200_MCU_WAKEUP_PORT (&stm_gpioa)
158 #define AO_CC1200_MCU_WAKEUP_PIN (0)
160 #define AO_CC1200_INT_GPIO 2
161 #define AO_CC1200_INT_GPIO_IOCFG CC1200_IOCFG2
163 #define AO_CC1200_MARC_GPIO 3
164 #define AO_CC1200_MARC_GPIO_IOCFG CC1200_IOCFG3
166 #define HAS_BOOT_RADIO 0
168 #endif /* _AO_PINS_H_ */