2 * Copyright © 2018 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 AO_STACK_SIZE 512
24 #define AO_HSE 32000000
25 #define AO_RCC_CFGR_PLLMUL STM_RCC_CFGR_PLLMUL_3
26 #define AO_RCC_CFGR2_PLLDIV STM_RCC_CFGR2_PREDIV_2
31 #define AO_AHB_PRESCALER 1
32 #define AO_RCC_CFGR_HPRE_DIV STM_RCC_CFGR_HPRE_DIV_1
35 #define AO_APB_PRESCALER 1
36 #define AO_RCC_CFGR_PPRE_DIV STM_RCC_CFGR_PPRE_DIV_1
39 #define AO_USB_DIRECTIO 0
40 #define AO_PA11_PA12_RMP 0
42 #define IS_FLASH_LOADER 0
43 #define HAS_TASK_QUEUE 1
48 #define HAS_SERIAL_1 0
49 #define USE_SERIAL_1_STDIN 0
50 #define SERIAL_1_PB6_PB7 0
51 #define SERIAL_1_PA9_PA10 0
53 #define HAS_SERIAL_2 0
54 #define USE_SERIAL_2_STDIN 0
55 #define DELAY_SERIAL_2_STDIN 0
56 #define USE_SERIAL_2_FLOW 0
57 #define USE_SERIAL_2_SW_FLOW 0
58 #define SERIAL_2_PA2_PA3 0
59 #define SERIAL_2_PD5_PD6 0
60 #define SERIAL_2_PORT_RTS (&stm_gpioa)
61 #define SERIAL_2_PIN_RTS 0
62 #define SERIAL_2_PORT_CTS (&stm_gpioa)
63 #define SERIAL_2_PIN_CTS 0
65 #define AO_CONFIG_MAX_SIZE 1024
68 #define USE_INTERNAL_FLASH 0
69 #define USE_EEPROM_CONFIG 0
70 #define USE_STORAGE_CONFIG 0
72 #define HAS_BATTERY_REPORT 1
74 #define HAS_TELEMETRY 0
80 #define SPI_1_PA5_PA6_PA7 1 /* sensors */
81 #define SPI_1_PB3_PB4_PB5 0
82 #define SPI_1_PE13_PE14_PE15 0
83 #define SPI_1_OSPEEDR STM_OSPEEDR_HIGH
86 #define SPI_2_PB13_PB14_PB15 1
87 #define SPI_2_PD1_PD3_PD4 0
88 #define SPI_2_OSPEEDR STM_OSPEEDR_HIGH
91 #define I2C_1_PB8_PB9 0
94 #define I2C_2_PB10_PB11 0
96 #define PACKET_HAS_SLAVE 0
97 #define PACKET_HAS_MASTER 0
99 #define LOW_LEVEL_DEBUG 0
101 #define LED_PORT_0_ENABLE STM_RCC_AHBENR_IOPCEN
102 #define LED_PORT_0 (&stm_gpioc)
103 #define LED_PORT_0_SHIFT 13
104 #define LED_PIN_GREEN (0 + LED_PORT_0_SHIFT)
105 #define AO_LED_GREEN (1 << LED_PIN_GREEN)
106 #define LED_PORT_0_MASK (AO_LED_GREEN)
108 #define LEDS_AVAILABLE (AO_LED_GREEN)
113 #define HAS_ADC_TEMP 0
119 #define AO_DATA_RING 32
120 #define AO_ADC_NUM_SENSE 2
126 #define AO_ADC_DUMP(p) \
127 printf("tick: %5u batt %5d\n", \
131 #define AO_ADC_V_BATT 0
132 #define AO_ADC_V_BATT_PORT (&stm_gpiob)
133 #define AO_ADC_V_BATT_PIN 0
135 #define AO_ADC_RCC_AHBENR ((1 << STM_RCC_AHBENR_IOPAEN))
137 #define AO_NUM_ADC_PIN 1
139 #define AO_ADC_PIN0_PORT AO_ADC_V_BATT_PORT
140 #define AO_ADC_PIN0_PIN AO_ADC_V_BATT_PIN
141 #define AO_ADC_PIN0_CH AO_ADC_V_BATT_PIN
143 #define AO_NUM_ADC (AO_NUM_ADC_PIN)
145 #define AO_ADC_SQ1 AO_ADC_V_BATT
148 * Voltage divider on ADC battery sampler
150 #define AO_BATTERY_DIV_PLUS 100 /* 100k */
151 #define AO_BATTERY_DIV_MINUS 27 /* 27k */
154 * ADC reference in decivolts
156 #define AO_ADC_REFERENCE_DV 33
160 #define AO_CONFIG_DEFAULT_FLIGHT_LOG_MAX (1024 * 1024)
161 #define LOG_ERASE_MARK 0x55
162 #define LOG_MAX_ERASE 128
163 #define AO_LOG_FORMAT AO_LOG_FORMAT_EASYMOTOR_1
165 #define BEEPER_TIMER 2
166 #define BEEPER_CHANNEL 3
167 #define BEEPER_PORT (&stm_gpioa)
174 #define M25_MAX_CHIPS 1
175 #define AO_M25_SPI_CS_PORT (&stm_gpioa)
176 #define AO_M25_SPI_CS_PIN 0
177 #define AO_M25_SPI_CS_MASK (1 << AO_M25_SPI_CS_PIN)
178 #define AO_M25_SPI_BUS AO_SPI_1_PA5_PA6_PA7
182 #define HAS_ADXL375 1
183 #define AO_ADXL375_SPI_INDEX (AO_SPI_1_PA5_PA6_PA7 | AO_SPI_MODE_3)
184 #define AO_ADXL375_CS_PORT (&stm_gpiob)
185 #define AO_ADXL375_CS_PIN 10
186 #define AO_ADXL375_SPI_SPEED AO_SPI_SPEED_4MHz
188 #define AO_ADXL375_INT1_PORT (&stm_gpiob)
189 #define AO_ADXL375_INT1_PIN 2
191 #define AO_ADXL375_INT2_PORT (&stm_gpiob)
192 #define AO_ADXL375_INT2_PIN 1
194 #define AO_ADXL375_AXIS x
195 #define AO_ADXL375_INVERT 1
203 #define HAS_MONITOR 0
204 #define LEGACY_MONITOR 0
205 #define HAS_MONITOR_PUT 0
206 #define AO_MONITOR_LED 0
209 #endif /* _AO_PINS_H_ */