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