dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_board.h
Go to the documentation of this file.
1 
15 /*
16  * This program is free software; you can redistribute it and/or modify
17  * it under the terms of the GNU General Public License as published by
18  * the Free Software Foundation; either version 3 of the License, or
19  * (at your option) any later version.
20  *
21  * This program is distributed in the hope that it will be useful, but
22  * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
23  * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
24  * for more details.
25  *
26  * You should have received a copy of the GNU General Public License along
27  * with this program; if not, see <http://www.gnu.org/licenses/>
28  */
29 
30 
31 #ifndef STM32F30X_omnibusf3_H_
32 #define STM32F30X_omnibusf3_H_
33 
34 #include <stdbool.h>
35 
36 #if defined(PIOS_INCLUDE_DEBUG_CONSOLE)
37 #define DEBUG_LEVEL 0
38 #define DEBUG_PRINTF(level, ...) {if(level <= DEBUG_LEVEL && pios_com_aux_id > 0) { PIOS_COM_SendFormattedStringNonBlocking(pios_com_aux_id, __VA_ARGS__); }}
39 #else
40 #define DEBUG_PRINTF(level, ...)
41 #endif /* PIOS_INCLUDE_DEBUG_CONSOLE */
42 
43 //------------------------
44 // Timers and Channels Used
45 //------------------------
46 /*
47 Timer | Channel 1 | Channel 2 | Channel 3 | Channel 4
48 ------+-----------+-----------+-----------+----------
49 TIM1 | | | |
50 TIM2 | PWM1 | PWM2 | |
51 TIM3 | PWM5 | PWM6 | PWM7 | PWM8
52 TIM4 | | | |
53 TIM5 | | | |
54 TIM6 | | | |
55 TIM7 | | | |
56 TIM8 | | | |
57 TIM15 | PWM3 | PWM4 | |
58 ------+-----------+-----------+-----------+----------
59 */
60 
61 //------------------------
62 // DMA 1 Channels Used
63 //------------------------
64 /* Channel 1 - */
65 /* Channel 2 - */
66 /* Channel 3 - */
67 /* Channel 4 - */
68 /* Channel 5 - */
69 /* Channel 6 - */
70 /* Channel 7 - */
71 
72 //------------------------
73 // DMA 2 Channels Used
74 //------------------------
75 /* Channel 1 - ADC2 */
76 /* Channel 2 - */
77 /* Channel 3 - */
78 /* Channel 4 - */
79 /* Channel 5 - */
80 
81 //------------------------
82 // BOOTLOADER_SETTINGS
83 //------------------------
84 #define BOARD_READABLE true
85 #define BOARD_WRITABLE true
86 #define MAX_DEL_RETRYS 3
87 
88 
89 //------------------------
90 // PIOS_LED
91 //------------------------
92 #define PIOS_LED_HEARTBEAT 0
93 #define PIOS_LED_ALARM 0
94 #define PIOS_ANNUNCIATOR_BUZZER 1
95 
96 //------------------------
97 // PIOS_WDG
98 //------------------------
99 #define PIOS_WATCHDOG_TIMEOUT 250
100 #define PIOS_WDG_REGISTER RTC_BKP_DR4
101 
102 //-------------------------
103 // PIOS_COM
104 //
105 // See also pios_board.c
106 //-------------------------
107 extern uintptr_t pios_com_telem_serial_id;
108 extern uintptr_t pios_com_gps_id;
109 extern uintptr_t pios_com_telem_usb_id;
110 extern uintptr_t pios_com_bridge_id;
111 extern uintptr_t pios_com_vcp_id;
112 extern uintptr_t pios_com_mavlink_id;
113 extern uintptr_t pios_com_hott_id;
114 extern uintptr_t pios_com_frsky_sensor_hub_id;
115 extern uintptr_t pios_com_lighttelemetry_id;
116 extern uintptr_t pios_com_frsky_sport_id;
117 extern uintptr_t pios_com_openlog_logging_id;
118 extern uintptr_t pios_com_storm32bgc_id;
119 
120 #define PIOS_COM_GPS (pios_com_gps_id)
121 #define PIOS_COM_TELEM_USB (pios_com_telem_usb_id)
122 #define PIOS_COM_BRIDGE (pios_com_bridge_id)
123 #define PIOS_COM_VCP (pios_com_vcp_id)
124 #define PIOS_COM_MAVLINK (pios_com_mavlink_id)
125 #define PIOS_COM_HOTT (pios_com_hott_id)
126 #define PIOS_COM_FRSKY_SENSOR_HUB (pios_com_frsky_sensor_hub_id)
127 #define PIOS_COM_LIGHTTELEMETRY (pios_com_lighttelemetry_id)
128 #define PIOS_COM_FRSKY_SPORT (pios_com_frsky_sport_id)
129 #define PIOS_COM_OPENLOG (pios_com_openlog_logging_id)
130 #define PIOS_COM_STORM32BGC (pios_com_storm32bgc_id)
131 
132 #if defined(PIOS_INCLUDE_DEBUG_CONSOLE)
133 extern uintptr_t pios_com_debug_id;
134 #define PIOS_COM_DEBUG (pios_com_debug_id)
135 #endif /* PIOS_INCLUDE_DEBUG_CONSOLE */
136 
137 #ifdef PIOS_INCLUDE_WS2811
138 #include <pios_ws2811.h>
140 #endif
141 
142 //-------------------------
143 // System Settings
144 //
145 // See also system_stm32f30x.c
146 //-------------------------
147 //These macros are deprecated
148 
149 #define PIOS_SYSCLK 72000000
150 #define PIOS_PERIPHERAL_APB1_CLOCK (PIOS_SYSCLK / 2)
151 #define PIOS_PERIPHERAL_APB2_CLOCK (PIOS_SYSCLK / 1)
152 
153 
154 //-------------------------
155 // Interrupt Priorities
156 //-------------------------
157 #define PIOS_IRQ_PRIO_LOW 12 // lower than RTOS
158 #define PIOS_IRQ_PRIO_MID 8 // higher than RTOS
159 #define PIOS_IRQ_PRIO_HIGH 5 // for SPI, ADC, I2C etc...
160 #define PIOS_IRQ_PRIO_HIGHEST 4 // for USART etc...
161 
162 
163 //------------------------
164 // PIOS_RCVR
165 // See also pios_board.c
166 //------------------------
167 #define PIOS_RCVR_MAX_CHANNELS 12
168 
169 //-------------------------
170 // Receiver PPM input
171 //-------------------------
172 #define PIOS_PPM_NUM_INPUTS 12
173 
174 //-------------------------
175 // Receiver PWM input
176 //-------------------------
177 #define PIOS_PWM_NUM_INPUTS 1
178 
179 //-------------------------
180 // Receiver DSM input
181 //-------------------------
182 #define PIOS_DSM_NUM_INPUTS 12
183 
184 //-------------------------
185 // Receiver HSUM input
186 //-------------------------
187 #define PIOS_HSUM_MAX_DEVS 2
188 #define PIOS_HSUM_NUM_INPUTS 32
189 
190 //-------------------------
191 // Receiver S.Bus input
192 //-------------------------
193 #define PIOS_SBUS_NUM_INPUTS (16+2)
194 
195 //-------------------------
196 // Servo outputs
197 //-------------------------
198 #define PIOS_SERVO_UPDATE_HZ 50
199 #define PIOS_SERVOS_INITIAL_POSITION 0 /* dont want to start motors, have no pulse till settings loaded */
200 
201 //--------------------------
202 // Timer controller settings
203 //--------------------------
204 #define PIOS_TIM_MAX_DEVS 8
205 
206 //-------------------------
207 // ADC
208 // ADC0 : PA4 ADC2_IN1 VBat
209 // ADC1 : PA5 ADC2_IN2 Current
210 // ADC2 : PB2 ADC2_IN12 RSSI
211 //-------------------------
212 
213 #define VREF_PLUS 3.3
214 
215 #ifdef PIOS_INCLUDE_MAX7456
216 #include <pios_max7456.h>
217 
218 extern max7456_dev_t pios_max7456_id;
219 #endif
220 
221 //-------------------------
222 // DMA
223 //-------------------------
224 #define PIOS_DMA_MAX_CHANNELS 12
225 #define PIOS_DMA_MAX_HANDLERS_PER_CHANNEL 3
226 #define PIOS_DMA_CHANNELS {DMA1_Channel1, DMA1_Channel2, DMA1_Channel3, DMA1_Channel4, DMA1_Channel5, DMA1_Channel6, DMA1_Channel7, DMA2_Channel1, DMA2_Channel2, DMA2_Channel3, DMA2_Channel4, DMA2_Channel5}
227 
228 //-------------------------
229 // USB
230 //-------------------------
231 #define PIOS_USB_ENABLED 1 /* Should remove all references to this */
232 
233 #endif /* STM32F30X_omnibusf3_H_ */
234 
235 
uintptr_t pios_com_frsky_sport_id
uintptr_t pios_com_frsky_sensor_hub_id
uintptr_t pios_com_telem_serial_id
Definition: pios_hal.c:127
uintptr_t pios_com_debug_id
Definition: pios_board.c:76
uintptr_t pios_com_hott_id
struct max7456_dev_s * max7456_dev_t
Definition: pios_max7456.h:65
uintptr_t pios_com_mavlink_id
uintptr_t pios_com_lighttelemetry_id
ws2811_dev_t pios_ws2811
Definition: pios_board.c:66
uintptr_t pios_com_openlog_logging_id
Definition: pios_board.c:49
uintptr_t pios_com_telem_usb_id
Definition: pios_board.c:42
uintptr_t pios_com_bridge_id
Definition: pios_hal.c:81
uintptr_t pios_com_storm32bgc_id
uintptr_t pios_com_gps_id
Definition: pios_hal.c:80
uintptr_t pios_com_vcp_id