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
umarim_lite_2.0.h
Go to the documentation of this file.
1 #ifndef CONFIG_UMARIM_LITE_V2_0_H
2 #define CONFIG_UMARIM_LITE_V2_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 /* P0.5 aka MAT0.1 */
34 #define SERVO_CLOCK_PIN 5
35 #define SERVO_CLOCK_PINSEL PINSEL0
36 #define SERVO_CLOCK_PINSEL_VAL 0x02
37 #define SERVO_CLOCK_PINSEL_BIT 10
38 /* p1.20 */
39 #define SERVO_RESET_PIN 20
40 
41 /* PPM : rc rx on P0.28 ( CAP0.2 ) */
42 #define PPM_PINSEL PINSEL1
43 #define PPM_PINSEL_VAL 0x02
44 #define PPM_PINSEL_BIT 24
45 #define PPM_CRI TIR_CR2I
46 #define PPM_CCR_CRF TCCR_CR2_F
47 #define PPM_CCR_CRR TCCR_CR2_R
48 #define PPM_CCR_CRI TCCR_CR2_I
49 #define PPM_CR T0CR2
50 
51 /* ADC */
52 
53 #define ADC_0 AdcBank1(5)
54 #ifdef USE_ADC_0
55 #ifndef USE_AD1
56 #define USE_AD1
57 #endif
58 #define USE_AD1_5
59 #endif
60 
61 #define ADC_1 AdcBank1(4)
62 #ifdef USE_ADC_1
63 #ifndef USE_AD1
64 #define USE_AD1
65 #endif
66 #define USE_AD1_4
67 #endif
68 
69 #define ADC_2 AdcBank1(3)
70 #ifdef USE_ADC_2
71 #ifndef USE_AD1
72 #define USE_AD1
73 #endif
74 #define USE_AD1_3
75 #endif
76 
77 #define ADC_3 AdcBank1(2)
78 #ifdef USE_ADC_3
79 #ifndef USE_AD1
80 #define USE_AD1
81 #endif
82 #define USE_AD1_2
83 #endif
84 
85 
86 /* battery */
87 /* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
88 #ifndef ADC_CHANNEL_VSUPPLY
89 #define ADC_CHANNEL_VSUPPLY AdcBank0(2)
90 #ifndef USE_AD0
91 #define USE_AD0
92 #endif
93 #define USE_AD0_2
94 #endif
95 
96 #define DefaultVoltageOfAdc(adc) (0.0247*adc)
97 
98 /* SPI (SSP) */
99 #define SPI_SELECT_SLAVE0_PORT 0
100 #define SPI_SELECT_SLAVE0_PIN 20
101 
102 #define SPI1_DRDY_PINSEL PINSEL1
103 #define SPI1_DRDY_PINSEL_BIT 0
104 #define SPI1_DRDY_PINSEL_VAL 1
105 #define SPI1_DRDY_EINT 0
106 #define SPI1_DRDY_VIC_IT VIC_EINT0
107 
108 #endif /* CONFIG_UMARIM_LITE_V2_0_H */