dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
pios_board.c
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  * Additional note on redistribution: The copyright and license notices above
30  * must be maintained in each individual source file that is a derivative work
31  * of this source file; otherwise redistribution is prohibited.
32  */
33 
34 /* Pull in the board-specific static HW definitions.
35  * Including .c files is a bit ugly but this allows all of
36  * the HW definitions to be const and static to limit their
37  * scope.
38  *
39  * NOTE: THIS IS THE ONLY PLACE THAT SHOULD EVER INCLUDE THIS FILE
40  */
41 
42 #include "board_hw_defs.c"
43 
44 #include <pios.h>
45 #include <pios_hal.h>
46 #include <openpilot.h>
47 #include <uavobjectsinit.h>
48 #include <taskmonitor.h>
49 #include "hwseppuku.h"
50 #include "manualcontrolsettings.h"
51 #include "modulesettings.h"
52 #include "onscreendisplaysettings.h"
53 
54 #if defined(PIOS_INCLUDE_WS2811)
55 #include "rgbledsettings.h"
56 #endif
57 
61 
63 
68 #if defined(PIOS_INCLUDE_VIDEO)
69 void OSD_configure_bw_levels(void)
70 {
71  GPIO_InitTypeDef GPIO_InitStructure;
72  TIM_OCInitTypeDef TIM_OCInitStructure;
73  TIM_TimeBaseInitTypeDef TIM_TimeBaseStructure;
74 
75  /*-------------------------- GPIO Configuration ----------------------------*/
76  GPIO_StructInit(&GPIO_InitStructure); // Reset init structure
77  GPIO_InitStructure.GPIO_Pin = GPIO_Pin_9 | GPIO_Pin_15;
78  GPIO_InitStructure.GPIO_Mode = GPIO_Mode_AF;
79  GPIO_InitStructure.GPIO_OType = GPIO_OType_PP;
80  GPIO_InitStructure.GPIO_PuPd = GPIO_PuPd_NOPULL;
81  GPIO_InitStructure.GPIO_Speed = GPIO_Speed_25MHz;
82  GPIO_Init(GPIOB, &GPIO_InitStructure);
83 
84  GPIO_PinAFConfig(GPIOB, GPIO_PinSource9, GPIO_AF_TIM11); // White
85  GPIO_PinAFConfig(GPIOB, GPIO_PinSource15, GPIO_AF_TIM12); // Black
86 
87  /* Time base configuration */
88  TIM_TimeBaseStructInit(&TIM_TimeBaseStructure);
89  TIM_TimeBaseStructure.TIM_Prescaler = 0; // Run as fast as we can.
90  TIM_TimeBaseStructure.TIM_Period = 192;
91  TIM_TimeBaseStructure.TIM_ClockDivision = 0;
92  TIM_TimeBaseStructure.TIM_CounterMode = TIM_CounterMode_Up;
93  TIM_TimeBaseInit(TIM11, &TIM_TimeBaseStructure);
94  TIM_TimeBaseInit(TIM12, &TIM_TimeBaseStructure);
95 
96  /* PWM mode configuation */
97  TIM_OCStructInit(&TIM_OCInitStructure);
98  TIM_OCInitStructure.TIM_OCMode = TIM_OCMode_PWM1;
99  TIM_OCInitStructure.TIM_OutputState = TIM_OutputState_Enable;
100  TIM_OCInitStructure.TIM_Pulse = 90;
101  TIM_OCInitStructure.TIM_OCPolarity = TIM_OCPolarity_High;
102 
103  TIM_OC1Init(TIM11, &TIM_OCInitStructure);
104  TIM_OC2Init(TIM12, &TIM_OCInitStructure);
105 
106  /* TIM11/12 Main Output Enable */
107  TIM_CtrlPWMOutputs(TIM11, ENABLE);
108  TIM_CtrlPWMOutputs(TIM12, ENABLE);
109 
110  /* TIM1 enable counter */
111  TIM_Cmd(TIM11, ENABLE);
112  TIM_Cmd(TIM12, ENABLE);
113 
114  TIM11->CCR1 = 180;
115  TIM12->CCR2 = 100;
116 }
117 #endif /* PIOS_INCLUDE_VIDEO */
118 
125 #include <pios_board_info.h>
126 
127 void PIOS_Board_Init(void) {
128  const struct pios_board_info * bdinfo = &pios_board_info_blob;
129 
130 #if defined(PIOS_INCLUDE_ANNUNC)
131  const struct pios_annunc_cfg * led_cfg = PIOS_BOARD_HW_DEFS_GetLedCfg(bdinfo->board_rev);
132  PIOS_Assert(led_cfg);
133  PIOS_ANNUNC_Init(led_cfg);
134 #endif /* PIOS_INCLUDE_ANNUNC */
135 
136 #if defined(PIOS_INCLUDE_SPI)
137  if (PIOS_SPI_Init(&pios_spi_gyro_accel_id, &pios_spi_gyro_accel_cfg)) {
138  PIOS_Assert(0);
139  }
140 #endif
141 
142 #if defined(PIOS_INCLUDE_FLASH)
143  /* Inititialize all flash drivers */
144  if (PIOS_Flash_Internal_Init(&pios_internal_flash_id, &flash_internal_cfg) != 0) {
145 #ifdef PIOS_INCLUDE_WS2811
147 #endif
149  }
150 
151  /* Register the partition table */
152  const struct pios_flash_partition * flash_partition_table;
153  uint32_t num_partitions;
154  flash_partition_table = PIOS_BOARD_HW_DEFS_GetPartitionTable(bdinfo->board_rev, &num_partitions);
155  PIOS_FLASH_register_partition_table(flash_partition_table, num_partitions);
156 
157  /* Mount all filesystems */
159 #ifdef PIOS_INCLUDE_WS2811
161 #endif
163  }
164 #endif /* PIOS_INCLUDE_FLASH */
165 
166  PIOS_RESET_Clear(); // Clear the RCC reset flags after use.
167 
168  /* Initialize the hardware UAVOs */
169  HwSeppukuInitialize();
170  ModuleSettingsInitialize();
171 
172 #if defined(PIOS_INCLUDE_RTC)
173  /* Initialize the real-time clock and its associated tick */
174  PIOS_RTC_Init(&pios_rtc_main_cfg);
175 #endif
176 
177  /* Initialize watchdog as early as possible to catch faults during init
178  * but do it only if there is no debugger connected
179  */
180  if ((CoreDebug->DHCSR & CoreDebug_DHCSR_C_DEBUGEN_Msk) == 0) {
181  PIOS_WDG_Init();
182  }
183 
184  /* Set up pulse timers */
185 
186  // Timers used for outputs (8, 14, 3, 5)
192 
193  /* IAP System Setup */
194  PIOS_IAP_Init();
195  uint16_t boot_count = PIOS_IAP_ReadBootCount();
196  if (boot_count < 3) {
197  PIOS_IAP_WriteBootCount(++boot_count);
198  AlarmsClear(SYSTEMALARMS_ALARM_BOOTFAULT);
199  } else {
200  /* Too many failed boot attempts, force hw config to defaults */
201  HwSeppukuSetDefaults(HwSeppukuHandle(), 0);
202  ModuleSettingsSetDefaults(ModuleSettingsHandle(),0);
203  AlarmsSet(SYSTEMALARMS_ALARM_BOOTFAULT, SYSTEMALARMS_ALARM_CRITICAL);
204  }
205 
206 #if defined(PIOS_INCLUDE_USB)
207  /* Initialize board specific USB data */
209 
210  /* Flags to determine if various USB interfaces are advertised */
211  bool usb_hid_present = false;
212  bool usb_cdc_present = false;
213 
214 #if defined(PIOS_INCLUDE_USB_CDC)
216  PIOS_Assert(0);
217  }
218  usb_hid_present = true;
219  usb_cdc_present = true;
220 #else
222  PIOS_Assert(0);
223  }
224  usb_hid_present = true;
225 #endif
226 
227  uintptr_t pios_usb_id;
228  PIOS_USB_Init(&pios_usb_id, PIOS_BOARD_HW_DEFS_GetUsbCfg(bdinfo->board_rev));
229 
230 #if defined(PIOS_INCLUDE_USB_CDC)
231 
232  uint8_t hw_usb_vcpport;
233  /* Configure the USB VCP port */
234  HwSeppukuUSB_VCPPortGet(&hw_usb_vcpport);
235 
236  if (!usb_cdc_present) {
237  /* Force VCP port function to disabled if we haven't advertised VCP in our USB descriptor */
238  hw_usb_vcpport = HWSEPPUKU_USB_VCPPORT_DISABLED;
239  }
240 
241  PIOS_HAL_ConfigureCDC(hw_usb_vcpport, pios_usb_id, &pios_usb_cdc_cfg);
242 
243 #endif /* PIOS_INCLUDE_USB_CDC */
244 
245 #if defined(PIOS_INCLUDE_USB_HID)
246  /* Configure the usb HID port */
247  uint8_t hw_usb_hidport;
248  HwSeppukuUSB_HIDPortGet(&hw_usb_hidport);
249 
250  if (!usb_hid_present) {
251  /* Force HID port function to disabled if we haven't advertised HID in our USB descriptor */
252  hw_usb_hidport = HWSEPPUKU_USB_HIDPORT_DISABLED;
253  }
254 
255  PIOS_HAL_ConfigureHID(hw_usb_hidport, pios_usb_id, &pios_usb_hid_cfg);
256 
257 #endif /* PIOS_INCLUDE_USB_HID */
258 
259  if (usb_hid_present || usb_cdc_present) {
261  }
262 #endif /* PIOS_INCLUDE_USB */
263 
264  /* Configure the IO ports */
265  HwSeppukuDSMxModeOptions hw_DSMxMode;
266  HwSeppukuDSMxModeGet(&hw_DSMxMode);
267 
268  /* Configure the receiver port*/
269  uint8_t hw_rcvrport;
270  HwSeppukuRcvrPortGet(&hw_rcvrport);
271 
272  PIOS_HAL_ConfigurePort(hw_rcvrport, // port type protocol
273  &pios_usart2_cfg, // usart_port_cfg
274  &pios_usart_com_driver, // com_driver
275  NULL, // i2c_id
276  NULL, // i2c_cfg
277  &pios_ppm_cfg, // ppm_cfg
278  NULL, // pwm_cfg
279  PIOS_LED_ALARM, // led_id
280  &pios_usart2_dsm_aux_cfg, // dsm_cfg
281  hw_DSMxMode, // dsm_mode
282  &pios_usart2_sbus_aux_cfg); // sbus_cfg
283 
284  /* UART1 Port */
285  uint8_t hw_uart1;
286  HwSeppukuUart1Get(&hw_uart1);
287 
288  PIOS_HAL_ConfigurePort(hw_uart1, // port type protocol
289  &pios_usart1_cfg, // usart_port_cfg
290  &pios_usart_com_driver, // com_driver
291  NULL, // i2c_id
292  NULL, // i2c_cfg
293  NULL, // ppm_cfg
294  NULL, // pwm_cfg
295  PIOS_LED_ALARM, // led_id
296  &pios_usart1_dsm_aux_cfg, // dsm_cfg
297  hw_DSMxMode, // dsm_mode
298  NULL); // sbus_cfg
299 
300  /* UART3 Port */
301  uint8_t hw_uart3;
302  HwSeppukuUart3Get(&hw_uart3);
303 
304  PIOS_HAL_ConfigurePort(hw_uart3, // port type protocol
305  &pios_usart3_cfg, // usart_port_cfg
306  &pios_usart_com_driver, // com_driver
307  &pios_i2c_usart3_adapter_id, // i2c_id
308  &pios_i2c_usart3_adapter_cfg, // i2c_cfg
309  NULL, // ppm_cfg
310  NULL, // pwm_cfg
311  PIOS_LED_ALARM, // led_id
312  &pios_usart3_dsm_aux_cfg, // dsm_cfg
313  hw_DSMxMode, // dsm_mode
314  NULL); // sbus_cfg
315 
316  /* UART3 Port */
317  uint8_t hw_uart6;
318  HwSeppukuUart6Get(&hw_uart6);
319 
320  PIOS_HAL_ConfigurePort(hw_uart6, // port type protocol
321  &pios_usart6_cfg, // usart_port_cfg
322  &pios_usart_com_driver, // com_driver
323  NULL, // i2c_id
324  NULL, // i2c_cfg
325  NULL, // ppm_cfg
326  NULL, // pwm_cfg
327  PIOS_LED_ALARM, // led_id
328  &pios_usart6_dsm_aux_cfg, // dsm_cfg
329  hw_DSMxMode, // dsm_mode
330  NULL); // sbus_cfg
331 
332  uint8_t hw_outputconf;
333  HwSeppukuOutputConfigurationGet(&hw_outputconf);
334 
335  switch (hw_outputconf) {
336  case HWSEPPUKU_OUTPUTCONFIGURATION_SIXCHANNELSUART4:
337  (void) 0;
338  uint8_t hw_uart4;
339  HwSeppukuUart4Get(&hw_uart4);
340 
341  PIOS_HAL_ConfigurePort(hw_uart4, // port type protocol
342  &pios_uart4_cfg, // usart_port_cfg
343  &pios_usart_com_driver, // com_driver
344  NULL, // i2c_id
345  NULL, // i2c_cfg
346  NULL, // ppm_cfg
347  NULL, // pwm_cfg
348  PIOS_LED_ALARM, // led_id
349  &pios_uart4_dsm_aux_cfg, // dsm_cfg
350  hw_DSMxMode, // dsm_mode
351  NULL); // sbus_cfg
352 
353 #ifdef PIOS_INCLUDE_SERVO
354  PIOS_Servo_Init(&pios_servo_with_uart_cfg);
355 #endif
356  break;
357  default:
358 #ifdef PIOS_INCLUDE_SERVO
360 #endif
361  break;
362  }
363 
364 #if defined(PIOS_INCLUDE_DMASHOT)
365  PIOS_DMAShot_Init(&dmashot_config);
366 #endif
367 
368 #ifdef PIOS_INCLUDE_WS2811
369  uint8_t num_leds;
370 
371  RGBLEDSettingsInitialize();
372 
373  RGBLEDSettingsNumLedsGet(&num_leds);
374 
375  if (num_leds < 1) {
376  num_leds = 1; // Always enable the on-board LED.
377  }
378 
381 #endif
382 
383 #ifdef PIOS_INCLUDE_DAC
384  PIOS_DAC_init(&pios_dac, &pios_dac_cfg);
385 
386  PIOS_HAL_ConfigureDAC(pios_dac);
387 #endif /* PIOS_INCLUDE_DAC */
388 
389 /* init sensor queue registration */
391 
392  PIOS_WDG_Clear();
393 
394 #if defined(PIOS_INCLUDE_SPI)
395 
396 #if defined(PIOS_INCLUDE_BMI160)
397  uint8_t bmi160_foc;
398  HwSeppukuBMI160FOCGet(&bmi160_foc);
399 
400  bool do_foc = (bmi160_foc == HWSEPPUKU_BMI160FOC_DO_FOC);
401 
402  if(PIOS_BMI160_Init(pios_spi_gyro_accel_id, 0, &pios_bmi160_cfg, do_foc) != 0){
404  }
405 
406  /* Disable FOC. We only do this once. */
407  if (do_foc) {
408  bmi160_foc = HWSEPPUKU_BMI160FOC_DISABLED;
409  HwSeppukuBMI160FOCSet(&bmi160_foc);
410  UAVObjSave(HwSeppukuHandle(), 0);
411  }
412 #endif /* PIOS_INCLUDE_BMI160 */
413 
414 #ifdef PIOS_INCLUDE_BMP280_SPI
415  // BMP280 support
416  if (PIOS_BMP280_SPI_Init(&pios_bmp280_cfg, pios_spi_gyro_accel_id,
417  1)) {
419  } else if (PIOS_BMP280_Test()) {
421  }
422 #endif /* PIOS_INCLUDE_BMP280_SPI */
423 
424 #endif /* PIOS_INCLUDE_SPI */
425 
426  PIOS_WDG_Clear();
427 
428  uint8_t hw_magnetometer;
429  HwSeppukuMagnetometerGet(&hw_magnetometer);
430 
431  switch (hw_magnetometer) {
432  case HWSEPPUKU_MAGNETOMETER_NONE:
433  break;
434 
435  case HWSEPPUKU_MAGNETOMETER_INTERNAL:
436 #if defined(PIOS_INCLUDE_SPI) && defined(PIOS_INCLUDE_LIS3MDL)
437  (void) 0;
438  lis3mdl_dev_t lis3mdl;
439 
440  if (PIOS_LIS3MDL_SPI_Init(&lis3mdl, pios_spi_gyro_accel_id,
441  2, &pios_lis3mdl_cfg)) {
443  }
444 #endif /* PIOS_INCLUDE_SPI && PIOS_INCLUDE_LIS3MDL */
445  break;
446 
447  /* default external mags and handle them in PiOS HAL rather than maintaining list here */
448  default:
449 #if defined(PIOS_INCLUDE_I2C)
450  {
451  if (pios_i2c_usart3_adapter_id) {
452  uint8_t hw_orientation;
453  HwSeppukuExtMagOrientationGet(&hw_orientation);
454 
455  PIOS_HAL_ConfigureExternalMag(hw_magnetometer, hw_orientation,
456  &pios_i2c_usart3_adapter_id,
457  &pios_i2c_usart3_adapter_cfg);
458  } else {
460  }
461  }
462 #else
464 #endif // PIOS_INCLUDE_I2C
465 
466  break;
467  }
468 
469  /* I2C is slow, sensor init as well, reset watchdog to prevent reset here */
470  PIOS_WDG_Clear();
471 
472 #if defined(PIOS_INCLUDE_ADC)
473  uintptr_t internal_adc_id;
474  PIOS_INTERNAL_ADC_Init(&internal_adc_id, &pios_adc_cfg);
476 #endif
477 
478 #if defined(PIOS_INCLUDE_VIDEO)
479  // make sure the mask pin is low
480  GPIO_Init(pios_video_cfg.mask.miso.gpio, (GPIO_InitTypeDef*)&pios_video_cfg.mask.miso.init);
481  GPIO_ResetBits(pios_video_cfg.mask.miso.gpio, pios_video_cfg.mask.miso.init.GPIO_Pin);
482 
483  // Initialize settings
484  OnScreenDisplaySettingsInitialize();
485 
486  uint8_t osd_state;
487  OnScreenDisplaySettingsOSDEnabledGet(&osd_state);
488  if (osd_state == ONSCREENDISPLAYSETTINGS_OSDENABLED_ENABLED) {
489  OSD_configure_bw_levels();
490  }
491 #endif
492 
493  /* Make sure we have at least one telemetry link configured or else fail initialization */
495 }
496 
int32_t PIOS_Flash_Internal_Init(uintptr_t *flash_id, const struct pios_flash_internal_cfg *cfg)
int32_t PIOS_USB_DESC_HID_CDC_Init(void)
void PIOS_HAL_ConfigureCDC(HwSharedUSB_VCPPortOptions port_type, uintptr_t usb_id, const struct pios_usb_cdc_cfg *cdc_cfg)
int32_t PIOS_BMI160_Init(pios_spi_t spi_id, uint32_t slave_num, const struct pios_bmi160_cfg *cfg, bool do_foc)
Main PiOS header to include all the compiled in PiOS options.
int32_t PIOS_INTERNAL_ADC_Init(uintptr_t *internal_adc_id, const struct pios_internal_adc_cfg *cfg)
GPIO_InitTypeDef init
Definition: pios_stm32.h:61
GPIO_TypeDef * gpio
Definition: pios_stm32.h:60
struct lis3mdl_dev * lis3mdl_dev_t
Definition: pios_lis3mdl.h:50
int PIOS_HAL_ConfigureExternalMag(HwSharedMagOptions mag, HwSharedMagOrientationOptions orientation, pios_i2c_t *i2c_id, const struct pios_i2c_adapter_cfg *i2c_cfg)
Definition: pios_hal.c:1298
int32_t UAVObjSave(UAVObjHandle obj_handle, uint16_t instId)
int32_t AlarmsSet(SystemAlarmsAlarmElem alarm, SystemAlarmsAlarmOptions severity)
Definition: alarms.c:97
uintptr_t pios_uavo_settings_fs_id
Definition: pios_board.c:50
Configuration structure for the BMP280 driver.
uint16_t PIOS_IAP_ReadBootCount(void)
Definition: pios_iap.c:93
int32_t PIOS_FLASHFS_Logfs_Init(uintptr_t *fs_id, const struct flashfs_logfs_cfg *cfg, enum pios_flash_partition_labels partition_label)
Initialize the flash object setting FS.
static const struct pios_tim_clock_cfg tim_8_cfg
const struct pios_board_info pios_board_info_blob
Task monitoring library.
int PIOS_WS2811_init(ws2811_dev_t *dev_out, const struct pios_ws2811_cfg *cfg, int max_leds)
Allocate and initialise WS2811 device.
Definition: pios_ws2811.c:64
#define PIOS_LED_ALARM
Definition: pios_board.h:86
void PIOS_WDG_Clear(void)
Clear the watchdog timer.
Definition: pios_wdg.c:147
int PIOS_DAC_init(dac_dev_t *dev_out, const struct pios_dac_cfg *cfg)
Allocate and initialise DAC device.
static const struct pios_tim_clock_cfg tim_4_cfg
uintptr_t pios_com_telem_serial_id
Definition: pios_hal.c:127
const struct pios_com_driver pios_usart_com_driver
pios_i2c_t external_i2c_adapter_id
Definition: pios_board.c:53
static const struct pios_tim_clock_cfg tim_5_cfg
void PIOS_IAP_Init(void)
PIOS_IAP_Init - performs required initializations for iap module.
Definition: pios_iap.c:44
const struct pios_adc_driver pios_internal_adc_driver
int32_t PIOS_TIM_InitClock(const struct pios_tim_clock_cfg *cfg)
Definition: pios_tim.c:62
const struct pios_spi_cfg mask
Definition: pios_video.h:97
uintptr_t pios_internal_adc_id
Definition: pios_board.c:51
ws2811_dev_t pios_ws2811
Definition: pios_board.c:66
int32_t PIOS_SPI_Init(pios_spi_t *spi_dev, const struct pios_spi_cfg *cfg)
void PIOS_Board_Init()
Definition: pios_board.c:44
int32_t PIOS_ANNUNC_Init(const struct pios_annunc_cfg *cfg)
int32_t PIOS_SENSORS_Init()
Initialize the PIOS_SENSORS interface.
Definition: pios_sensors.c:51
void PIOS_RTC_Init(const struct pios_rtc_cfg *cfg)
int32_t PIOS_BMP280_SPI_Init(const struct pios_bmp280_cfg *cfg, pios_spi_t spi_device, uint32_t spi_slave)
int32_t PIOS_USB_DESC_HID_ONLY_Init(void)
void PIOS_HAL_ConfigureHID(HwSharedUSB_HIDPortOptions port_type, uintptr_t usb_id, const struct pios_usb_hid_cfg *hid_cfg)
int32_t PIOS_Servo_Init(const struct pios_servo_cfg *cfg)
Definition: pios_servo.c:109
int32_t PIOS_LIS3MDL_SPI_Init(lis3mdl_dev_t *dev, pios_spi_t spi_id, uint32_t slave_mag, const struct pios_lis3mdl_cfg *cfg)
Initialize the LIS3MDL mag.
uintptr_t pios_com_openlog_logging_id
Definition: pios_board.c:49
uintptr_t pios_com_telem_usb_id
Definition: pios_board.c:42
static const struct pios_tim_clock_cfg tim_14_cfg
void PIOS_USBHOOK_Activate(void)
Definition: pios_usbhook.c:80
void PIOS_FLASH_register_partition_table(const struct pios_flash_partition partition_table[], uint8_t num_partitions)
Includes PiOS and core architecture components.
int32_t AlarmsClear(SystemAlarmsAlarmElem alarm)
Definition: alarms.c:171
void PIOS_WS2811_trigger_update(ws2811_dev_t dev)
Trigger an update of the LED strand.
Definition: pios_ws2811.c:197
int32_t PIOS_USB_Init(uintptr_t *usb_id, const struct pios_usb_cfg *cfg)
uint16_t PIOS_WDG_Init()
Initialize the watchdog timer for a specified timeout.
Definition: pios_wdg.c:63
int32_t PIOS_ADC_Init(uintptr_t *adc_id, const struct pios_adc_driver *driver, uintptr_t lower_id)
void PIOS_IAP_WriteBootCount(uint16_t)
Definition: pios_iap.c:98
static const struct pios_tim_clock_cfg tim_3_cfg
struct stm32_gpio miso
Definition: pios_spi_priv.h:48
void PIOS_HAL_CriticalError(uint32_t led_id, enum pios_hal_panic code)
Flash a blink code.
Definition: pios_hal.c:291
void PIOS_DMAShot_Init(const struct pios_dmashot_cfg *config)
Initializes the DMAShot driver by loading the configuration.
Definition: pios_dmashot.c:96
#define PIOS_Assert(test)
Definition: pios_debug.h:52
int32_t PIOS_USB_BOARD_DATA_Init(void)
void PIOS_RESET_Clear(void)
PIOS_RESET_Clear Does nothing on POSIX systems.
Definition: pios_reset.c:38
void PIOS_SENSORS_SetMissing(enum pios_sensor_type type)
Assert that an optional (non-accel/gyro), but expected sensor is missing.
Definition: pios_sensors.c:191