Paparazzi UAS  v4.2.2_stable-4-gcc32f65
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
lisa_m_2.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_LISA_M_2_0_H
2 #define CONFIG_LISA_M_2_0_H
3 
4 #define BOARD_LISA_M
5 
6 #define AHB_CLK 72000000
7 
8 /*
9  * Onboard LEDs
10  */
11 
12 /* red, on PA8 */
13 #ifndef USE_LED_1
14 #define USE_LED_1 1
15 #endif
16 #define LED_1_GPIO GPIOA
17 #define LED_1_GPIO_CLK RCC_APB2Periph_GPIOA
18 #define LED_1_GPIO_PIN GPIO_Pin_8
19 #define LED_1_AFIO_REMAP ((void)0)
20 
21 /* green, shared with JTAG_TRST */
22 #ifndef USE_LED_2
23 #define USE_LED_2 1
24 #endif
25 #define LED_2_GPIO GPIOB
26 #define LED_2_GPIO_CLK RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO
27 #define LED_2_GPIO_PIN GPIO_Pin_4
28 #define LED_2_AFIO_REMAP GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE)
29 
30 /* green, shared with ADC12 (ADC_6 on connector ANALOG2) */
31 #ifndef USE_LED_3
32 #define USE_LED_3 1
33 #endif
34 #define LED_3_GPIO GPIOC
35 #define LED_3_GPIO_CLK RCC_APB2Periph_GPIOC
36 #define LED_3_GPIO_PIN GPIO_Pin_2
37 #define LED_3_AFIO_REMAP ((void)0)
38 
39 /* red, shared with ADC15 (ADC_4 on connector ANALOG2) */
40 #ifndef USE_LED_4
41 #define USE_LED_4 1
42 #endif
43 #define LED_4_GPIO GPIOC
44 #define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
45 #define LED_4_GPIO_PIN GPIO_Pin_5
46 #define LED_4_AFIO_REMAP ((void)0)
47 
48 /* green, on PC15 */
49 #ifndef USE_LED_5
50 #define USE_LED_5 1
51 #endif
52 #define LED_5_GPIO GPIOC
53 #define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
54 #define LED_5_GPIO_PIN GPIO_Pin_15
55 #define LED_5_AFIO_REMAP ((void)0)
56 
57 /*
58  * LEDs not populated by default
59  */
60 /* PC3, ADC13 on ADC_1 */
61 #define LED_6_GPIO GPIOC
62 #define LED_6_GPIO_CLK RCC_APB2Periph_GPIOC
63 #define LED_6_GPIO_PIN GPIO_Pin_3
64 #define LED_6_AFIO_REMAP ((void)0)
65 
66 /* PC0, ADC10 on ADC_2 */
67 #define LED_7_GPIO GPIOC
68 #define LED_7_GPIO_CLK RCC_APB2Periph_GPIOC
69 #define LED_7_GPIO_PIN GPIO_Pin_0
70 #define LED_7_AFIO_REMAP ((void)0)
71 
72 /* PC1, ADC11 on ADC_3 */
73 #define LED_8_GPIO GPIOC
74 #define LED_8_GPIO_CLK RCC_APB2Periph_GPIOC
75 #define LED_8_GPIO_PIN GPIO_Pin_1
76 #define LED_8_AFIO_REMAP ((void)0)
77 
78 
79 /*
80  * not actual LEDS, used as GPIOs
81  */
82 
83 /* PC12, on GPIO connector*/
84 #define LED_12_GPIO GPIOC
85 #define LED_12_GPIO_CLK RCC_APB2Periph_GPIOC
86 #define LED_12_GPIO_PIN GPIO_Pin_12
87 #define LED_12_AFIO_REMAP ((void)0)
88 
89 
90 /* configuration for aspirin - and more generaly IMUs */
91 #define IMU_ACC_DRDY_RCC_GPIO RCC_APB2Periph_GPIOB
92 #define IMU_ACC_DRDY_GPIO GPIOB
93 #define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOB
94 
95 
96 
97 #define DefaultVoltageOfAdc(adc) (0.0045*adc)
98 
99 /* Onboard ADCs */
100 /*
101  ADC1 PC3/ADC13
102  ADC2 PC0/ADC10
103  ADC3 PC1/ADC11
104  ADC4 PC5/ADC15
105  ADC6 PC2/ADC12
106  BATT PC4/ADC14
107 */
108 #define BOARD_ADC_CHANNEL_1 ADC_Channel_13
109 #define BOARD_ADC_CHANNEL_2 ADC_Channel_10
110 #define BOARD_ADC_CHANNEL_3 ADC_Channel_11
111 // we can only use ADC1,2,3; the last channel is for bat monitoring
112 #define BOARD_ADC_CHANNEL_4 ADC_Channel_14
113 
114 /* provide defines that can be used to access the ADC_x in the code or airframe file
115  * these directly map to the index number of the 4 adc channels defined above
116  * 4th (index 3) is used for bat monitoring by default
117  */
118 #define ADC_1 0
119 #define ADC_2 1
120 #define ADC_3 2
121 
122 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
123 #ifndef ADC_CHANNEL_VSUPPLY
124 #define ADC_CHANNEL_VSUPPLY 3
125 #endif
126 
127 /* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */
128 // FIXME, this is not very nice, is also stm lib specific
129 #ifdef USE_AD1
130 #define ADC1_GPIO_INIT(gpio) { \
131  (gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \
132  (gpio).GPIO_Mode = GPIO_Mode_AIN; \
133  GPIO_Init(GPIOC, (&gpio)); \
134  }
135 #endif // USE_AD1
136 
137 
138 
139 #define BOARD_HAS_BARO 1
140 
141 #define USE_OPENCM3 1
142 
143 // not needed with USE_OPENCM3:
144 //#define HSE_TYPE_EXT_CLK
145 //#define STM32_RCC_MODE RCC_HSE_ON
146 //#define STM32_PLL_MULT RCC_PLLMul_6
147 
148 #define PWM_5AND6_TIMER TIM5
149 #define PWM_5AND6_RCC RCC_APB1Periph_TIM5
150 #define PWM5_OC 1
151 #define PWM6_OC 2
152 #define PWM_5AND6_GPIO GPIOA
153 #define PWM5_Pin GPIO_Pin_0
154 #define PWM6_Pin GPIO_Pin_1
155 
156 #endif /* CONFIG_LISA_M_2_0_H */