Paparazzi UAS
v5.14.0_stable-0-g3f680d1
Paparazzi is a free software Unmanned Aircraft System.
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Namespaces
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
#define POWER_SWITCH_GPIO GPIOA,GPIO11
42
43
/* Default actuators driver */
44
#define DEFAULT_ACTUATORS "subsystems/actuators/actuators_4015.h"
45
#define ActuatorDefaultSet(_x,_y) Actuator4015Set(_x,_y)
46
#define ActuatorsDefaultInit() Actuators4015Init()
47
#define ActuatorsDefaultCommit() Actuators4015Commit()
48
49
/* P0.5 aka MAT0.1 */
50
#define SERVO_CLOCK_PIN 5
51
#define SERVO_CLOCK_PINSEL PINSEL0
52
#define SERVO_CLOCK_PINSEL_VAL 0x02
53
#define SERVO_CLOCK_PINSEL_BIT 10
54
/* p1.23 */
55
#define SERVO_DATA_PIN 23
56
/* p1.24 */
57
#define SERVO_RESET_PIN 24
58
59
/* PPM : rc rx on P0.6*/
60
#define PPM_PINSEL PINSEL0
61
#define PPM_PINSEL_VAL 0x02
62
#define PPM_PINSEL_BIT 12
63
#define PPM_CRI TIR_CR2I
64
#define PPM_CCR_CRF TCCR_CR2_F
65
#define PPM_CCR_CRR TCCR_CR2_R
66
#define PPM_CCR_CRI TCCR_CR2_I
67
#define PPM_CR T0CR2
68
69
/* ADC */
70
71
#define ADC_0 AdcBank0(3)
72
#if USE_ADC_0
73
#ifndef USE_AD0
74
#define USE_AD0
75
#endif
76
#define USE_AD0_3
77
#endif
78
79
#define ADC_1 AdcBank0(2)
80
#if USE_ADC_1
81
#ifndef USE_AD0
82
#define USE_AD0
83
#endif
84
#define USE_AD0_2
85
#endif
86
87
88
#define ADC_2 AdcBank0(1)
89
#if USE_ADC_2
90
#ifndef USE_AD0
91
#define USE_AD0
92
#endif
93
#define USE_AD0_1
94
#endif
95
96
#define ADC_3 AdcBank0(4)
97
#if USE_ADC_3
98
#ifndef USE_AD0
99
#define USE_AD0
100
#endif
101
#define USE_AD0_4
102
#endif
103
104
#define ADC_4 AdcBank1(7)
105
#if USE_ADC_4
106
#ifndef USE_AD1
107
#define USE_AD1
108
#endif
109
#define USE_AD1_7
110
#endif
111
112
#define ADC_5 AdcBank1(3)
113
#if USE_ADC_5
114
#ifndef USE_AD1
115
#define USE_AD1
116
#endif
117
#define USE_AD1_3
118
#endif
119
120
#define ADC_6 AdcBank1(4)
121
#if USE_ADC_6
122
#ifndef USE_AD1
123
#define USE_AD1
124
#endif
125
#define USE_AD1_4
126
#endif
127
128
#define ADC_7 AdcBank1(5)
129
#if USE_ADC_7
130
#ifndef USE_AD1
131
#define USE_AD1
132
#endif
133
#define USE_AD1_5
134
#endif
135
136
/* allow to define ADC_CHANNEL_VSUPPLY in the airframe file*/
137
#ifndef ADC_CHANNEL_VSUPPLY
138
#define ADC_CHANNEL_VSUPPLY AdcBank1(6)
139
#ifndef USE_AD1
140
#define USE_AD1
141
#endif
142
#define USE_AD1_6
143
#endif
144
145
#define DefaultVoltageOfAdc(adc) (0.01787109375*adc)
146
147
#define SPI_SELECT_SLAVE0_PORT 0
148
#define SPI_SELECT_SLAVE0_PIN 20
149
#define SPI_SELECT_SLAVE0_PINSEL PINSEL1
150
#define SPI_SELECT_SLAVE0_PINSEL_BIT 8
151
#define SPI_SELECT_SLAVE0_PINSEL_VAL 0
152
153
#define SPI1_DRDY_PINSEL PINSEL0
154
#define SPI1_DRDY_PINSEL_BIT 14
155
#define SPI1_DRDY_PINSEL_VAL 3
156
#define SPI1_DRDY_EINT 2
157
#define SPI1_DRDY_VIC_IT VIC_EINT2
158
159
/* MAX1168 EOC pin (e.g. booz2 imu) */
160
#define MAX1168_EOC_PIN 16
161
#define MAX1168_EOC_PINSEL PINSEL1
162
#define MAX1168_EOC_PINSEL_BIT 0
163
#define MAX1168_EOC_PINSEL_VAL 1
164
#define MAX1168_EOC_EINT 0
165
#define MAX1168_EOC_VIC_IT VIC_EINT0
166
167
168
#endif
/* CONFIG_TINY_H */
sw
airborne
boards
tiny_1.1.h
Generated on Sat Feb 9 2019 07:05:38 for Paparazzi UAS by
1.8.8