Paparazzi UAS  v5.0.5_stable-7-g4b8bbb7
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Modules 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 #include "boards/lisa_m_common.h"
5 
6 #define BOARD_LISA_M
7 
8 /* Lisa/M has a 12MHz external clock and 72MHz internal. */
9 #define EXT_CLK 12000000
10 #define AHB_CLK 72000000
11 
12 /* Onboard LEDs */
13 /* red */
14 #ifndef USE_LED_1
15 #define USE_LED_1 1
16 #endif
17 #define LED_1_GPIO GPIOB
18 #define LED_1_GPIO_CLK RCC_APB2ENR_IOPBEN | RCC_APB2ENR_AFIOEN
19 #define LED_1_GPIO_PIN GPIO4
20 #define LED_1_GPIO_ON gpio_clear
21 #define LED_1_GPIO_OFF gpio_set
22 #define LED_1_AFIO_REMAP AFIO_MAPR |= AFIO_MAPR_SWJ_CFG_FULL_SWJ_NO_JNTRST
23 
24 /* blue */
25 #ifndef USE_LED_2
26 #define USE_LED_2 1
27 #endif
28 #define LED_2_GPIO GPIOC
29 #define LED_2_GPIO_CLK RCC_APB2ENR_IOPCEN
30 #define LED_2_GPIO_PIN GPIO5
31 #define LED_2_GPIO_ON gpio_clear
32 #define LED_2_GPIO_OFF gpio_set
33 #define LED_2_AFIO_REMAP ((void)0)
34 
35 /* blue */
36 #ifndef USE_LED_3
37 #define USE_LED_3 1
38 #endif
39 #define LED_3_GPIO GPIOC
40 #define LED_3_GPIO_CLK RCC_APB2ENR_IOPCEN
41 #define LED_3_GPIO_PIN GPIO2
42 #define LED_3_GPIO_ON gpio_clear
43 #define LED_3_GPIO_OFF gpio_set
44 #define LED_3_AFIO_REMAP ((void)0)
45 
46 // GPIO pins
47 #ifndef USE_LED_4
48 #define USE_LED_4 1
49 #endif
50 #define LED_4_GPIO GPIOC
51 #define LED_4_GPIO_CLK RCC_APB2ENR_IOPCEN
52 #define LED_4_GPIO_PIN GPIO12
53 #define LED_4_GPIO_ON gpio_clear
54 #define LED_4_GPIO_OFF gpio_set
55 #define LED_4_AFIO_REMAP ((void)0)
56 
57 #ifndef USE_LED_5
58 #define USE_LED_5 1
59 #endif
60 #define LED_5_GPIO GPIOC
61 #define LED_5_GPIO_CLK RCC_APB2ENR_IOPCEN
62 #define LED_5_GPIO_PIN GPIO10
63 #define LED_5_GPIO_ON gpio_clear
64 #define LED_5_GPIO_OFF gpio_set
65 #define LED_5_AFIO_REMAP ((void)0)
66 
67 /* PB1, DRDY on EXT SPI connector*/
68 #define LED_BODY_GPIO GPIOB
69 #define LED_BODY_GPIO_CLK RCC_APB2ENR_IOPBEN
70 #define LED_BODY_GPIO_PIN GPIO1
71 #define LED_BODY_GPIO_ON gpio_set
72 #define LED_BODY_GPIO_OFF gpio_clear
73 #define LED_BODY_AFIO_REMAP ((void)0)
74 
75 
76 /* Default actuators driver */
77 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_pwm.h"
78 #define ActuatorDefaultSet(_x,_y) ActuatorPwmSet(_x,_y)
79 #define ActuatorsDefaultInit() ActuatorsPwmInit()
80 #define ActuatorsDefaultCommit() ActuatorsPwmCommit()
81 
82 
83 #define DefaultVoltageOfAdc(adc) (0.00485*adc)
84 
85 /* Onboard ADCs */
86 /*
87  ADC_1 PC3/ADC13
88  ADC_2 PC0/ADC10
89  ADC_3 PC1/ADC11
90  ADC_4 PC5/ADC15
91  ADC_6 PC2/ADC12
92  BATT PC4/ADC14
93 */
94 #define BOARD_ADC_CHANNEL_1 13
95 #define BOARD_ADC_CHANNEL_2 10
96 #define BOARD_ADC_CHANNEL_3 11
97 // we can only use ADC1,2,3; the last channel is for bat monitoring
98 #define BOARD_ADC_CHANNEL_4 14
99 
100 /* provide defines that can be used to access the ADC_x in the code or airframe file
101  * these directly map to the index number of the 4 adc channels defined above
102  * 4th (index 3) is used for bat monitoring by default
103  */
104 #define ADC_1 0
105 #define ADC_2 1
106 #define ADC_3 2
107 
108 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
109 #ifndef ADC_CHANNEL_VSUPPLY
110 #define ADC_CHANNEL_VSUPPLY 3
111 #endif
112 
113 /* GPIO mapping for ADC1 pins, overwrites the default in arch/stm32/mcu_periph/adc_arch.c */
114 // FIXME, this is not very nice, is also stm lib specific
115 #ifdef USE_AD1
116 #define ADC1_GPIO_INIT(gpio) { \
117  gpio_set_mode(GPIOC, GPIO_MODE_INPUT, \
118  GPIO_CNF_INPUT_ANALOG, \
119  GPIO3 | GPIO0 | GPIO1 | GPIO4); \
120  }
121 #endif // USE_AD1
122 
123 #define BOARD_HAS_BARO 1
124 
125 #endif /* CONFIG_LISA_M_1_0_H */