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