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_0.99.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 28
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 19
37 
38 /* Default actuators driver */
39 #define DEFAULT_ACTUATORS "subsystems/actuators/actuators_4015.h"
40 #define ActuatorDefaultSet(_x,_y) Actuator4015Set(_x,_y)
41 #define ActuatorsDefaultInit() Actuators4015Init()
42 #define ActuatorsDefaultCommit() Actuators4015Commit()
43 
44 /* P0.5 aka MAT0.1 */
45 #define SERVO_CLOCK_PIN 5
46 #define SERVO_CLOCK_PINSEL PINSEL0
47 #define SERVO_CLOCK_PINSEL_VAL 0x02
48 #define SERVO_CLOCK_PINSEL_BIT 10
49 /* p1.23 */
50 #define SERVO_DATA_PIN 20
51 /* p1.24 */
52 #define SERVO_RESET_PIN 29
53 
54 /* PPM : rc rx on P0.6*/
55 #define PPM_PINSEL PINSEL0
56 #define PPM_PINSEL_VAL 0x02
57 #define PPM_PINSEL_BIT 12
58 #define PPM_CRI TIR_CR2I
59 #define PPM_CCR_CRF TCCR_CR2_F
60 #define PPM_CCR_CRR TCCR_CR2_R
61 #define PPM_CCR_CRI TCCR_CR2_I
62 #define PPM_CR T0CR2
63 
64 /* ADC */
65 
66 #define ADC_0 AdcBank0(3)
67 #ifdef USE_ADC_0
68 #ifndef USE_AD0
69 #define USE_AD0
70 #endif
71 #define USE_AD0_3
72 #endif
73 
74 #define ADC_1 AdcBank0(2)
75 #ifdef USE_ADC_1
76 #ifndef USE_AD0
77 #define USE_AD0
78 #endif
79 #define USE_AD0_2
80 #endif
81 
82 
83 #define ADC_2 AdcBank0(1)
84 #ifdef USE_ADC_2
85 #ifndef USE_AD0
86 #define USE_AD0
87 #endif
88 #define USE_AD0_1
89 #endif
90 
91 #define ADC_3 AdcBank1(7)
92 #ifdef USE_ADC_3
93 #ifndef USE_AD1
94 #define USE_AD1
95 #endif
96 #define USE_AD1_7
97 #endif
98 
99 #define ADC_4 AdcBank1(3)
100 #ifdef USE_ADC_4
101 #ifndef USE_AD1
102 #define USE_AD1
103 #endif
104 #define USE_AD1_3
105 #endif
106 
107 #define ADC_5 AdcBank1(4)
108 #ifdef USE_ADC_5
109 #ifndef USE_AD1
110 #define USE_AD1
111 #endif
112 #define USE_AD1_4
113 #endif
114 
115 #define ADC_6 AdcBank1(5)
116 #ifdef USE_ADC_6
117 #ifndef USE_AD1
118 #define USE_AD1
119 #endif
120 #define USE_AD1_5
121 #endif
122 
123 #define ADC_7 AdcBank1(2)
124 #ifdef USE_ADC_7
125 #ifndef USE_AD1
126 #define USE_AD1
127 #endif
128 #define USE_AD1_2
129 #endif
130 
131 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
132 #ifndef ADC_CHANNEL_VSUPPLY
133 #define ADC_CHANNEL_VSUPPLY AdcBank1(6)
134 #ifndef USE_AD1
135 #define USE_AD1
136 #endif
137 #define USE_AD1_6
138 #endif
139 
140 #define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
141 
142 #define SPI_SELECT_SLAVE0_PORT 0
143 #define SPI_SELECT_SLAVE0_PIN 20
144 #define SPI_SELECT_SLAVE0_PINSEL PINSEL1
145 #define SPI_SELECT_SLAVE0_PINSEL_BIT 8
146 #define SPI_SELECT_SLAVE0_PINSEL_VAL 0
147 
148 /* MAX1168 EOC pin (e.g. booz2 imu) */
149 #define MAX1168_EOC_PIN 16
150 #define MAX1168_EOC_PINSEL PINSEL1
151 #define MAX1168_EOC_PINSEL_BIT 0
152 #define MAX1168_EOC_PINSEL_VAL 1
153 #define MAX1168_EOC_EINT 0
154 #define MAX1168_EOC_VIC_IT VIC_EINT0
155 
156 
157 #endif /* CONFIG_TINY_H */