Paparazzi UAS  v4.0.4_stable-3-gf39211a
Paparazzi is a free software Unmanned Aircraft System.
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros 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 /* P0.5 aka MAT0.1 */
39 #define SERVO_CLOCK_PIN 5
40 #define SERVO_CLOCK_PINSEL PINSEL0
41 #define SERVO_CLOCK_PINSEL_VAL 0x02
42 #define SERVO_CLOCK_PINSEL_BIT 10
43 /* p1.23 */
44 #define SERVO_DATA_PIN 20
45 /* p1.24 */
46 #define SERVO_RESET_PIN 29
47 
48 /* PPM : rc rx on P0.6*/
49 #define PPM_PINSEL PINSEL0
50 #define PPM_PINSEL_VAL 0x02
51 #define PPM_PINSEL_BIT 12
52 #define PPM_CRI TIR_CR2I
53 #define PPM_CCR_CRF TCCR_CR2_F
54 #define PPM_CCR_CRR TCCR_CR2_R
55 #define PPM_CCR_CRI TCCR_CR2_I
56 #define PPM_CR T0CR2
57 
58 /* ADC */
59 
60 #define ADC_0 AdcBank0(3)
61 #ifdef USE_ADC_0
62 #ifndef USE_AD0
63 #define USE_AD0
64 #endif
65 #define USE_AD0_3
66 #endif
67 
68 #define ADC_1 AdcBank0(2)
69 #ifdef USE_ADC_1
70 #ifndef USE_AD0
71 #define USE_AD0
72 #endif
73 #define USE_AD0_2
74 #endif
75 
76 
77 #define ADC_2 AdcBank0(1)
78 #ifdef USE_ADC_2
79 #ifndef USE_AD0
80 #define USE_AD0
81 #endif
82 #define USE_AD0_1
83 #endif
84 
85 #define ADC_3 AdcBank1(7)
86 #ifdef USE_ADC_3
87 #ifndef USE_AD1
88 #define USE_AD1
89 #endif
90 #define USE_AD1_7
91 #endif
92 
93 #define ADC_4 AdcBank1(3)
94 #ifdef USE_ADC_4
95 #ifndef USE_AD1
96 #define USE_AD1
97 #endif
98 #define USE_AD1_3
99 #endif
100 
101 #define ADC_5 AdcBank1(4)
102 #ifdef USE_ADC_5
103 #ifndef USE_AD1
104 #define USE_AD1
105 #endif
106 #define USE_AD1_4
107 #endif
108 
109 #define ADC_6 AdcBank1(5)
110 #ifdef USE_ADC_6
111 #ifndef USE_AD1
112 #define USE_AD1
113 #endif
114 #define USE_AD1_5
115 #endif
116 
117 #define ADC_7 AdcBank1(2)
118 #ifdef USE_ADC_7
119 #ifndef USE_AD1
120 #define USE_AD1
121 #endif
122 #define USE_AD1_2
123 #endif
124 
125 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
126 #ifndef ADC_CHANNEL_VSUPPLY
127 #define ADC_CHANNEL_VSUPPLY AdcBank1(6)
128 #ifndef USE_AD1
129 #define USE_AD1
130 #endif
131 #define USE_AD1_6
132 #endif
133 
134 #define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
135 
136 #define SPI_SELECT_SLAVE0_PORT 0
137 #define SPI_SELECT_SLAVE0_PIN 20
138 
139 #endif /* CONFIG_TINY_H */