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
tiny_2.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_TINY_H
2 #define CONFIG_TINY_H
3 
4 #ifdef SITL
5 /* Dummy definitions: adc are unused anyway */
6 #define AdcBank0(x) (x)
7 #define AdcBank1(x) (x)
8 #endif /* SITL */
9 
10 /* Master oscillator freq. */
11 #define FOSC (12000000)
12 
13 /* PLL multiplier */
14 #define PLL_MUL (5)
15 
16 /* CPU clock freq. */
17 #define CCLK (FOSC * PLL_MUL)
18 
19 /* Peripheral bus speed mask 0x00->4, 0x01-> 1, 0x02 -> 2 */
20 #define PBSD_BITS 0x00
21 #define PBSD_VAL 4
22 
23 /* Peripheral bus clock freq. */
24 #define PCLK (CCLK / PBSD_VAL)
25 
26 #ifndef USE_LED_1
27 #define USE_LED_1 1
28 #endif
29 #define LED_1_BANK 1
30 #define LED_1_PIN 17
31 
32 #ifndef USE_LED_2
33 #define USE_LED_2 1
34 #endif
35 #define LED_2_BANK 1
36 #define LED_2_PIN 16
37 
38 #ifndef USE_LED_3
39 #define USE_LED_3 1
40 #endif
41 #define LED_3_BANK 1
42 #define LED_3_PIN 23
43 
44 #ifndef USE_LED_4
45 #define USE_LED_4 1
46 #endif
47 #define LED_4_BANK 1
48 #define LED_4_PIN 18
49 
50 #define POWER_SWITCH_LED 4
51 
52 /* Default actuators driver */
53 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_4017.h"
54 #define ActuatorDefaultSet(_x,_y) Actuator4017Set(_x,_y)
55 #define ActuatorsDefaultInit() Actuators4017Init()
56 #define ActuatorsDefaultCommit() Actuators4017Commit()
57 
58 /* P0.5 aka MAT0.1 */
59 #define SERVO_CLOCK_PIN 5
60 #define SERVO_CLOCK_PINSEL PINSEL0
61 #define SERVO_CLOCK_PINSEL_VAL 0x02
62 #define SERVO_CLOCK_PINSEL_BIT 10
63 /* p1.20 */
64 #define SERVO_RESET_PIN 20
65 
66 /* PPM : rc rx on P0.6*/
67 #define PPM_PINSEL PINSEL0
68 #define PPM_PINSEL_VAL 0x02
69 #define PPM_PINSEL_BIT 12
70 #define PPM_CRI TIR_CR2I
71 #define PPM_CCR_CRF TCCR_CR2_F
72 #define PPM_CCR_CRR TCCR_CR2_R
73 #define PPM_CCR_CRI TCCR_CR2_I
74 #define PPM_CR T0CR2
75 
76 /* ADC */
77 
78 #define ADC_0 AdcBank1(6)
79 #ifdef USE_ADC_0
80 #ifndef USE_AD1
81 #define USE_AD1
82 #endif
83 #define USE_AD1_6
84 #endif
85 
86 #define ADC_1 AdcBank1(7)
87 #ifdef USE_ADC_1
88 #ifndef USE_AD1
89 #define USE_AD1
90 #endif
91 #define USE_AD1_7
92 #endif
93 
94 
95 #define ADC_2 AdcBank0(4)
96 #ifdef USE_ADC_2
97 #ifndef USE_AD0
98 #define USE_AD0
99 #endif
100 #define USE_AD0_4
101 #endif
102 
103 #define ADC_3 AdcBank0(6)
104 #ifdef USE_ADC_3
105 #ifndef USE_AD0
106 #define USE_AD0
107 #endif
108 #define USE_AD0_6
109 #endif
110 
111 #define ADC_4 AdcBank0(3)
112 #ifdef USE_ADC_4
113 #ifndef USE_AD0
114 #define USE_AD0
115 #endif
116 #define USE_AD0_3
117 #endif
118 
119 #define ADC_5 AdcBank0(2)
120 #ifdef USE_ADC_5
121 #ifndef USE_AD0
122 #define USE_AD0
123 #endif
124 #define USE_AD0_2
125 #endif
126 
127 #define ADC_6 AdcBank0(1)
128 #ifdef USE_ADC_6
129 #ifndef USE_AD0
130 #define USE_AD0
131 #endif
132 #define USE_AD0_1
133 #endif
134 
135 #define ADC_7 AdcBank1(3)
136 #ifdef USE_ADC_7
137 #ifndef USE_AD1
138 #define USE_AD1
139 #endif
140 #define USE_AD1_3
141 #endif
142 
143 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
144 #ifndef ADC_CHANNEL_VSUPPLY
145 #define ADC_CHANNEL_VSUPPLY AdcBank1(5)
146 #ifndef USE_AD1
147 #define USE_AD1
148 #endif
149 #define USE_AD1_5
150 #endif
151 
152 
153 #define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
154 
155 #define SPI_SELECT_SLAVE0_PORT 0
156 #define SPI_SELECT_SLAVE0_PIN 20
157 #define SPI_SELECT_SLAVE0_PINSEL PINSEL1
158 #define SPI_SELECT_SLAVE0_PINSEL_BIT 8
159 #define SPI_SELECT_SLAVE0_PINSEL_VAL 0
160 
161 /* MAX1168 EOC pin (e.g. booz2 imu) */
162 #define MAX1168_EOC_PIN 16
163 #define MAX1168_EOC_PINSEL PINSEL1
164 #define MAX1168_EOC_PINSEL_BIT 0
165 #define MAX1168_EOC_PINSEL_VAL 1
166 #define MAX1168_EOC_EINT 0
167 #define MAX1168_EOC_VIC_IT VIC_EINT0
168 
169 
170 #endif /* CONFIG_TINY_H */