first pass at creating firmware for lpc on QuantiMotor v1
[fw/altos] / src / quantimotor-v1 / ao_pins.h
1 /*
2  * Copyright © 2022 Bdale Garbee <bdale@gag.com
3  * GPLv3
4  */
5
6 #ifndef _AO_PINS_H_
7 #define _AO_PINS_H_
8
9 #define AO_STACK_SIZE   320
10
11 #define IS_FLASH_LOADER 0
12
13 /* Crystal on the board */
14 #define AO_LPC_CLKIN    12000000
15
16 /* Main clock frequency. 48MHz for USB so we don't use the USB PLL */
17 #define AO_LPC_CLKOUT   48000000
18
19 /* System clock frequency */
20 #define AO_LPC_SYSCLK   24000000
21
22 #define HAS_EEPROM              0
23 #define USE_INTERNAL_FLASH      0
24 #define USE_STORAGE_CONFIG      0
25 #define USE_EEPROM_CONFIG       0
26
27 #define HAS_USB                 1
28 #define HAS_USB_CONNECT         0
29 #define HAS_USB_VBUS            0
30 #define HAS_USB_PULLUP          1
31 #define AO_USB_PULLUP_PORT      0
32 #define AO_USB_PULLUP_PIN       20
33
34 #define HAS_BEEP                0
35 #define HAS_RADIO               0
36 #define HAS_TELEMETRY           0
37 #define HAS_RSSI                0
38
39 #define HAS_SPI_0               0
40 #define SPI_SCK0_P0_6           0
41
42 #define PACKET_HAS_SLAVE        0
43 #define PACKET_HAS_MASTER       0
44
45 #define LOW_LEVEL_DEBUG         0
46
47 #define HAS_GPS                 0
48 #define HAS_FLIGHT              0
49 #define HAS_LOG                 0
50
51 #define AO_DATA_RING            16
52
53 /*
54  * ADC
55  */
56
57 #define HAS_ADC                 1
58
59 #define AO_NUM_ADC              7
60
61 #define AO_ADC_0                1
62 #define AO_ADC_1                1
63 #define AO_ADC_2                1
64 #define AO_ADC_3                1
65 #define AO_ADC_4                0
66 #define AO_ADC_5                1
67 #define AO_ADC_6                1
68 #define AO_ADC_7                1
69
70 struct ao_adc {
71         int16_t         v_batt;
72         int16_t         v_pyro;
73         int16_t         sense_1;
74         int16_t         adc3;
75         int16_t         adc5;
76         int16_t         adc6;
77         int16_t         adc7;
78 };
79
80 #endif /* _AO_PINS_H_ */