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_1.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_LISA_M_1_0_H
2 #define CONFIG_LISA_M_1_0_H
3 
4 #define BOARD_LISA_M
5 
6 #define AHB_CLK 72000000
7 
8 /* Onboard LEDs */
9 /* red */
10 #ifndef USE_LED_1
11 #define USE_LED_1 1
12 #endif
13 #define LED_1_GPIO GPIOB
14 #define LED_1_GPIO_CLK RCC_APB2Periph_GPIOB | RCC_APB2Periph_AFIO
15 #define LED_1_GPIO_PIN GPIO_Pin_4
16 #define LED_1_AFIO_REMAP GPIO_PinRemapConfig(GPIO_Remap_SWJ_NoJTRST, ENABLE)
17 
18 /* blue */
19 #ifndef USE_LED_2
20 #define USE_LED_2 1
21 #endif
22 #define LED_2_GPIO GPIOC
23 #define LED_2_GPIO_CLK RCC_APB2Periph_GPIOC
24 #define LED_2_GPIO_PIN GPIO_Pin_5
25 #define LED_2_AFIO_REMAP ((void)0)
26 
27 /* blue */
28 #ifndef USE_LED_3
29 #define USE_LED_3 1
30 #endif
31 #define LED_3_GPIO GPIOC
32 #define LED_3_GPIO_CLK RCC_APB2Periph_GPIOC
33 #define LED_3_GPIO_PIN GPIO_Pin_2
34 #define LED_3_AFIO_REMAP ((void)0)
35 
36 // GPIO pins
37 #ifndef USE_LED_4
38 #define USE_LED_4 1
39 #endif
40 #define LED_4_GPIO GPIOC
41 #define LED_4_GPIO_CLK RCC_APB2Periph_GPIOC
42 #define LED_4_GPIO_PIN GPIO_Pin_12
43 #define LED_4_AFIO_REMAP ((void)0)
44 
45 #ifndef USE_LED_5
46 #define USE_LED_5 1
47 #endif
48 #define LED_5_GPIO GPIOC
49 #define LED_5_GPIO_CLK RCC_APB2Periph_GPIOC
50 #define LED_5_GPIO_PIN GPIO_Pin_10
51 #define LED_5_AFIO_REMAP ((void)0)
52 
53 
54 /* configuration for aspirin - and more generaly IMUs */
55 #define IMU_ACC_DRDY_RCC_GPIO RCC_APB2Periph_GPIOB
56 #define IMU_ACC_DRDY_GPIO GPIOB
57 #define IMU_ACC_DRDY_GPIO_PORTSOURCE GPIO_PortSourceGPIOB
58 
59 
60 
61 #define DefaultVoltageOfAdc(adc) (0.00485*adc)
62 
63 /* Onboard ADCs */
64 /*
65  ADC_1 PC3/ADC13
66  ADC_2 PC0/ADC10
67  ADC_3 PC1/ADC11
68  ADC_4 PC5/ADC15
69  ADC_6 PC2/ADC12
70  BATT PC4/ADC14
71 */
72 #define BOARD_ADC_CHANNEL_1 ADC_Channel_13
73 #define BOARD_ADC_CHANNEL_2 ADC_Channel_10
74 #define BOARD_ADC_CHANNEL_3 ADC_Channel_11
75 // we can only use ADC1,2,3; the last channel is for bat monitoring
76 #define BOARD_ADC_CHANNEL_4 ADC_Channel_14
77 
78 /* provide defines that can be used to access the ADC_x in the code or airframe file
79  * these directly map to the index number of the 4 adc channels defined above
80  * 4th (index 3) is used for bat monitoring by default
81  */
82 #define ADC_1 0
83 #define ADC_2 1
84 #define ADC_3 2
85 
86 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
87 #ifndef ADC_CHANNEL_VSUPPLY
88 #define ADC_CHANNEL_VSUPPLY 3
89 #endif
90 
91 /* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */
92 // FIXME, this is not very nice, is also stm lib specific
93 #ifdef USE_AD1
94 #define ADC1_GPIO_INIT(gpio) { \
95  (gpio).GPIO_Pin = GPIO_Pin_3 | GPIO_Pin_0 | GPIO_Pin_1 | GPIO_Pin_4; \
96  (gpio).GPIO_Mode = GPIO_Mode_AIN; \
97  GPIO_Init(GPIOC, (&gpio)); \
98  }
99 #endif // USE_AD1
100 
101 
102 
103 #define BOARD_HAS_BARO 1
104 
105 #define USE_OPENCM3 1
106 
107 // not needed with USE_OPENCM3:
108 //#define HSE_TYPE_EXT_CLK
109 //#define STM32_RCC_MODE RCC_HSE_ON
110 //#define STM32_PLL_MULT RCC_PLLMul_6
111 
112 #define PWM_5AND6_TIMER TIM5
113 #define PWM_5AND6_RCC RCC_APB1Periph_TIM5
114 #define PWM5_OC 1
115 #define PWM6_OC 2
116 #define PWM_5AND6_GPIO GPIOA
117 #define PWM5_Pin GPIO_Pin_0
118 #define PWM6_Pin GPIO_Pin_1
119 
120 #endif /* CONFIG_LISA_M_1_0_H */