Paparazzi UAS
v5.18.0_stable
Paparazzi is a free software Unmanned Aircraft System.
booz_1.0.h
Go to the documentation of this file.
1
#ifndef CONFIG_BOOZ2_V1_0_H
2
#define CONFIG_BOOZ2_V1_0_H
3
4
/* Master oscillator freq. */
5
#define FOSC (12000000)
6
7
/* PLL multiplier */
8
#define PLL_MUL (5)
9
10
/* CPU clock freq. */
11
#define CCLK (FOSC * PLL_MUL)
12
13
/* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
14
#define PBSD_BITS 0x02
15
#define PBSD_VAL 2
16
17
/* Peripheral bus clock freq. */
18
#define PCLK (CCLK / PBSD_VAL)
19
20
/* Onboard LEDs */
21
#ifndef USE_LED_1
22
#define USE_LED_1 1
23
#endif
24
#define LED_1_BANK 1
25
#define LED_1_PIN 25
26
27
#ifndef USE_LED_2
28
#define USE_LED_2 1
29
#endif
30
#define LED_2_BANK 1
31
#define LED_2_PIN 24
32
33
#ifndef USE_LED_3
34
#define USE_LED_3 1
35
#endif
36
#define LED_3_BANK 1
37
#define LED_3_PIN 23
38
39
#ifndef USE_LED_4
40
#define USE_LED_4 1
41
#endif
42
#define LED_4_BANK 1
43
#define LED_4_PIN 31
44
45
#define POWER_SWITCH_GPIO GPIOB,GPIO18
46
47
#define CAM_SWITCH_GPIO GPIOB,GPIO22
48
49
/* PPM : rc rx on P0.28 ( CAP0.2 ) */
50
#define PPM_PINSEL PINSEL1
51
#define PPM_PINSEL_VAL 0x02
52
#define PPM_PINSEL_BIT 24
53
#define PPM_CRI TIR_CR2I
54
#define PPM_CCR_CRF TCCR_CR2_F
55
#define PPM_CCR_CRR TCCR_CR2_R
56
#define PPM_CCR_CRI TCCR_CR2_I
57
#define PPM_CR T0CR2
58
59
60
/* ADC */
61
62
/* select P0.13 (ADC_SPARE) as AD1.4 for ADC_0 */
63
#define ADC_0 AdcBank1(4)
64
#if USE_ADC_0
65
#ifndef USE_AD1
66
#define USE_AD1
67
#endif
68
#define USE_AD1_4
69
#endif
70
71
/* select P0.4 (SCK_0) as AD0.6 for ADC_1 */
72
#define ADC_1 AdcBank0(6)
73
#if USE_ADC_1
74
#ifndef USE_AD0
75
#define USE_AD0
76
#endif
77
#define USE_AD0_6
78
#endif
79
80
/* select P0.5 (MISO_0) as AD0.7 for ADC_2 */
81
#define ADC_2 AdcBank0(7)
82
#if USE_ADC_2
83
#ifndef USE_AD0
84
#define USE_AD0
85
#endif
86
#define USE_AD0_7
87
#endif
88
89
/* select P0.6 (MOSI_0) as AD1.0 for ADC_3 */
90
#define ADC_3 AdcBank1(0)
91
#if USE_ADC_3
92
#ifndef USE_AD1
93
#define USE_AD1
94
#endif
95
#define USE_AD1_0
96
#endif
97
98
/* battery */
99
/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
100
#ifndef ADC_CHANNEL_VSUPPLY
101
#define ADC_CHANNEL_VSUPPLY AdcBank0(2)
102
#ifndef USE_AD0
103
#define USE_AD0
104
#endif
105
#define USE_AD0_2
106
#endif
107
108
#define DefaultVoltageOfAdc(adc) (0.0183*adc)
109
110
/* baro */
111
#define ADC_CHANNEL_BARO AdcBank1(2)
112
#ifndef USE_AD1
113
#define USE_AD1
114
#endif
115
#define USE_AD1_2
116
117
118
/* SPI slaves (IMU connector) */
119
#define SPI_SELECT_SLAVE0_PORT 0
120
#define SPI_SELECT_SLAVE0_PIN 20
121
#define SPI_SELECT_SLAVE0_PINSEL PINSEL1
122
#define SPI_SELECT_SLAVE0_PINSEL_BIT 8
123
#define SPI_SELECT_SLAVE0_PINSEL_VAL 0
124
125
#define SPI_SELECT_SLAVE1_PORT 1
126
#define SPI_SELECT_SLAVE1_PIN 28
127
#define SPI_SELECT_SLAVE1_PINSEL PINSEL2
128
#define SPI_SELECT_SLAVE1_PINSEL_BIT 2
129
#define SPI_SELECT_SLAVE1_PINSEL_VAL 0
130
131
132
/* MAX1168 EOC pin (booz2 imu) */
133
#define MAX1168_EOC_PIN 16
134
#define MAX1168_EOC_PINSEL PINSEL1
135
#define MAX1168_EOC_PINSEL_BIT 0
136
#define MAX1168_EOC_PINSEL_VAL 1
137
#define MAX1168_EOC_EINT 0
138
#define MAX1168_EOC_VIC_IT VIC_EINT0
139
140
141
/* MS2100 EOC and reset pins (booz2 imu) */
142
#define MS2100_RESET_PIN 19
143
#define MS2100_RESET_IODIR IO1DIR
144
#define MS2100_RESET_IOSET IO1SET
145
#define MS2100_RESET_IOCLR IO1CLR
146
147
#define MS2100_DRDY_PIN 30
148
#define MS2100_DRDY_PINSEL PINSEL1
149
#define MS2100_DRDY_PINSEL_BIT 28
150
#define MS2100_DRDY_PINSEL_VAL 2
151
#define MS2100_DRDY_EINT 3
152
#define MS2100_DRDY_VIC_IT VIC_EINT3
153
154
155
/* Servo definition for actruators_pwm driver */
156
157
/* BOOZ PWM0 = PWM_SERVO_5 (driver) = PWM5 (lpc)
158
* on CAM connector */
159
#if USE_PWM0
160
#define PWM_SERVO_5 1
161
#define SERVO_REG_0 PWMMR5
162
#endif
163
164
/* BOOZ PWM1 = PWM_SERVO_2 (driver) = PWM2 (lpc)
165
* on SPI connector */
166
#if USE_PWM1
167
#define PWM_SERVO_2 1
168
#define SERVO_REG_1 PWMMR2
169
#endif
170
171
172
/* by default enable onboard baro */
173
#ifndef USE_BARO_BOARD
174
#define USE_BARO_BOARD 1
175
#endif
176
177
#endif
/* CONFIG_BOOZ2_V1_0_H */
sw
airborne
boards
booz_1.0.h
Generated on Tue Feb 1 2022 13:51:13 for Paparazzi UAS by
1.8.17