dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Tau Labs Sparky

Modules

 CMSIS
 

Files

file  pios_board.c
 Board specific initialization for the bootloader.
 
file  pios_config.h
 Board specific bootloader configuration file for PiOS.
 
file  board_hw_defs.c
 Defines board specific static initializers for hardware for the Sparky board.
 
file  cmsis_system.c
 CMSIS Cortex-M4 Device Peripheral Access Layer System Source File. This file contains the system clock configuration for STM32F30x devices, and is generated by the clock configuration tool stm32f30x_Clock_Configuration_V1.0.0.xls.
 
file  pios_board.h
 Board header file for Sparky board.
 
file  pios_board.c
 The board specific initialization routines.
 
file  pios_config.h
 Board specific options that modify PiOS capabilities.
 

Macros

#define PIOS_INCLUDE_ANNUNC
 
#define PIOS_INCLUDE_SPI
 
#define PIOS_INCLUDE_SYS
 
#define PIOS_INCLUDE_IAP
 
#define PIOS_INCLUDE_USB
 
#define PIOS_INCLUDE_USB_HID
 
#define PIOS_INCLUDE_COM_MSG
 
#define PIOS_INCLUDE_FLASH
 
#define PIOS_INCLUDE_FLASH_INTERNAL
 
#define DEBUG_PRINTF(level,...)
 
#define BOARD_READABLE   true
 
#define BOARD_WRITABLE   true
 
#define MAX_DEL_RETRYS   3
 
#define PIOS_LED_HEARTBEAT   0
 
#define PIOS_LED_ALARM   1
 
#define PIOS_WATCHDOG_TIMEOUT   250
 
#define PIOS_WDG_REGISTER   RTC_BKP_DR4
 
#define PIOS_COM_GPS   (pios_com_gps_id)
 
#define PIOS_COM_TELEM_USB   (pios_com_telem_usb_id)
 
#define PIOS_COM_BRIDGE   (pios_com_bridge_id)
 
#define PIOS_COM_VCP   (pios_com_vcp_id)
 
#define PIOS_COM_MAVLINK   (pios_com_mavlink_id)
 
#define PIOS_COM_HOTT   (pios_com_hott_id)
 
#define PIOS_COM_FRSKY_SENSOR_HUB   (pios_com_frsky_sensor_hub_id)
 
#define PIOS_COM_LIGHTTELEMETRY   (pios_com_lighttelemetry_id)
 
#define PIOS_COM_FRSKY_SPORT   (pios_com_frsky_sport_id)
 
#define PIOS_COM_OPENLOG   (pios_com_openlog_logging_id)
 
#define PIOS_COM_STORM32BGC   (pios_com_storm32bgc_id)
 
#define PIOS_SYSCLK   72000000
 
#define PIOS_PERIPHERAL_APB1_CLOCK   (PIOS_SYSCLK / 2)
 
#define PIOS_PERIPHERAL_APB2_CLOCK   (PIOS_SYSCLK / 1)
 
#define PIOS_IRQ_PRIO_LOW   12
 
#define PIOS_IRQ_PRIO_MID   8
 
#define PIOS_IRQ_PRIO_HIGH   5
 
#define PIOS_IRQ_PRIO_HIGHEST   4
 
#define PIOS_RCVR_MAX_CHANNELS   12
 
#define PIOS_PPM_NUM_INPUTS   12
 
#define PIOS_PWM_NUM_INPUTS   10
 
#define PIOS_DSM_NUM_INPUTS   12
 
#define PIOS_HSUM_MAX_DEVS   2
 
#define PIOS_HSUM_NUM_INPUTS   32
 
#define PIOS_SBUS_NUM_INPUTS   (16+2)
 
#define PIOS_SERVO_UPDATE_HZ   50
 
#define PIOS_SERVOS_INITIAL_POSITION   0 /* dont want to start motors, have no pulse till settings loaded */
 
#define PIOS_TIM_MAX_DEVS   8
 
#define VREF_PLUS   3.3
 
#define PIOS_DMA_MAX_CHANNELS   12
 
#define PIOS_DMA_MAX_HANDLERS_PER_CHANNEL   3
 
#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}
 
#define PIOS_USB_ENABLED   1 /* Should remove all references to this */
 
#define PIOS_COM_CAN_RX_BUF_LEN   256
 
#define PIOS_COM_CAN_TX_BUF_LEN   256
 
#define STABILIZATION_LQG
 
#define PIOS_INCLUDE_DMA_CB_SUBSCRIBING_FUNCTION
 
#define PIOS_INCLUDE_I2C
 
#define PIOS_INCLUDE_MPU
 
#define PIOS_INCLUDE_MPU_MAG
 
#define PIOS_INCLUDE_MS5611
 
#define PIOS_INCLUDE_HMC5883
 
#define PIOS_INCLUDE_HMC5983_I2C
 
#define PIOS_INCLUDE_MAVLINK
 
#define PIOS_INCLUDE_LIGHTTELEMETRY
 
#define PIOS_INCLUDE_PWM
 
#define AUTOTUNE_AVERAGING_DECIMATION   2
 
#define PIOS_EVENTDISPATCHER_STACK_SIZE   1024
 
#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD   (2175780)
 
#define PIOS_INCLUDE_FASTHEAP
 

Functions

void PIOS_Board_Init ()
 

Variables

uintptr_t pios_com_telem_usb_id
 
static const
TIM_TimeBaseInitTypeDef 
tim_1_15_16_17_time_base
 
static const
TIM_TimeBaseInitTypeDef 
tim_2_3_time_base
 
static const struct
pios_tim_clock_cfg 
tim_2_cfg
 
static const struct
pios_tim_clock_cfg 
tim_3_cfg
 
static const struct
pios_tim_clock_cfg 
tim_1_cfg
 
static const struct
pios_tim_clock_cfg 
tim_15_cfg
 
static const struct
pios_tim_clock_cfg 
tim_16_cfg
 
static const struct
pios_tim_clock_cfg 
tim_17_cfg
 
static const struct
pios_tim_channel 
pios_tim_servoport_v02_pins []
 
uintptr_t pios_com_telem_serial_id
 
uintptr_t pios_com_gps_id
 
uintptr_t pios_com_telem_usb_id
 
uintptr_t pios_com_bridge_id
 
uintptr_t pios_com_vcp_id
 
uintptr_t pios_com_mavlink_id
 
uintptr_t pios_com_hott_id
 
uintptr_t pios_com_frsky_sensor_hub_id
 
uintptr_t pios_com_lighttelemetry_id
 
uintptr_t pios_com_frsky_sport_id
 
uintptr_t pios_com_openlog_logging_id
 
uintptr_t pios_com_storm32bgc_id
 
uintptr_t pios_com_aux_id
 
uintptr_t pios_com_can_id
 
uintptr_t pios_uavo_settings_fs_id
 
uintptr_t pios_can_id
 
uintptr_t pios_com_openlog_logging_id
 

Detailed Description

Macro Definition Documentation

#define AUTOTUNE_AVERAGING_DECIMATION   2

Definition at line 57 of file pios_config.h.

#define BOARD_READABLE   true

Definition at line 78 of file pios_board.h.

#define BOARD_WRITABLE   true

Definition at line 79 of file pios_board.h.

#define DEBUG_PRINTF (   level,
  ... 
)

Definition at line 39 of file pios_board.h.

#define IDLE_COUNTS_PER_SEC_AT_NO_LOAD   (2175780)

Definition at line 79 of file pios_config.h.

#define MAX_DEL_RETRYS   3

Definition at line 80 of file pios_board.h.

#define PIOS_COM_BRIDGE   (pios_com_bridge_id)

Definition at line 115 of file pios_board.h.

#define PIOS_COM_CAN_RX_BUF_LEN   256

Definition at line 49 of file pios_board.c.

#define PIOS_COM_CAN_TX_BUF_LEN   256

Definition at line 50 of file pios_board.c.

#define PIOS_COM_FRSKY_SENSOR_HUB   (pios_com_frsky_sensor_hub_id)

Definition at line 119 of file pios_board.h.

#define PIOS_COM_FRSKY_SPORT   (pios_com_frsky_sport_id)

Definition at line 121 of file pios_board.h.

#define PIOS_COM_GPS   (pios_com_gps_id)

Definition at line 113 of file pios_board.h.

#define PIOS_COM_HOTT   (pios_com_hott_id)

Definition at line 118 of file pios_board.h.

#define PIOS_COM_LIGHTTELEMETRY   (pios_com_lighttelemetry_id)

Definition at line 120 of file pios_board.h.

#define PIOS_COM_MAVLINK   (pios_com_mavlink_id)

Definition at line 117 of file pios_board.h.

#define PIOS_COM_OPENLOG   (pios_com_openlog_logging_id)

Definition at line 122 of file pios_board.h.

#define PIOS_COM_STORM32BGC   (pios_com_storm32bgc_id)

Definition at line 123 of file pios_board.h.

#define PIOS_COM_TELEM_USB   (pios_com_telem_usb_id)

Definition at line 114 of file pios_board.h.

#define PIOS_COM_VCP   (pios_com_vcp_id)

Definition at line 116 of file pios_board.h.

#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}

Definition at line 208 of file pios_board.h.

#define PIOS_DMA_MAX_CHANNELS   12

Definition at line 206 of file pios_board.h.

#define PIOS_DMA_MAX_HANDLERS_PER_CHANNEL   3

Definition at line 207 of file pios_board.h.

#define PIOS_DSM_NUM_INPUTS   12

Definition at line 170 of file pios_board.h.

#define PIOS_EVENTDISPATCHER_STACK_SIZE   1024

Definition at line 66 of file pios_config.h.

#define PIOS_HSUM_MAX_DEVS   2

Definition at line 175 of file pios_board.h.

#define PIOS_HSUM_NUM_INPUTS   32

Definition at line 176 of file pios_board.h.

#define PIOS_INCLUDE_ANNUNC

Definition at line 34 of file pios_config.h.

#define PIOS_INCLUDE_COM_MSG

Definition at line 40 of file pios_config.h.

#define PIOS_INCLUDE_DMA_CB_SUBSCRIBING_FUNCTION

Definition at line 38 of file pios_config.h.

#define PIOS_INCLUDE_FASTHEAP

Definition at line 81 of file pios_config.h.

#define PIOS_INCLUDE_FLASH

Definition at line 41 of file pios_config.h.

#define PIOS_INCLUDE_FLASH_INTERNAL

Definition at line 42 of file pios_config.h.

#define PIOS_INCLUDE_HMC5883

Definition at line 46 of file pios_config.h.

#define PIOS_INCLUDE_HMC5983_I2C

Definition at line 47 of file pios_config.h.

#define PIOS_INCLUDE_I2C

Definition at line 40 of file pios_config.h.

#define PIOS_INCLUDE_IAP

Definition at line 37 of file pios_config.h.

#define PIOS_INCLUDE_LIGHTTELEMETRY

Definition at line 51 of file pios_config.h.

#define PIOS_INCLUDE_MAVLINK

Definition at line 50 of file pios_config.h.

#define PIOS_INCLUDE_MPU

Definition at line 43 of file pios_config.h.

#define PIOS_INCLUDE_MPU_MAG

Definition at line 44 of file pios_config.h.

#define PIOS_INCLUDE_MS5611

Definition at line 45 of file pios_config.h.

#define PIOS_INCLUDE_PWM

Definition at line 54 of file pios_config.h.

#define PIOS_INCLUDE_SPI

Definition at line 35 of file pios_config.h.

#define PIOS_INCLUDE_SYS

Definition at line 36 of file pios_config.h.

#define PIOS_INCLUDE_USB

Definition at line 38 of file pios_config.h.

#define PIOS_INCLUDE_USB_HID

Definition at line 39 of file pios_config.h.

#define PIOS_IRQ_PRIO_HIGH   5

Definition at line 147 of file pios_board.h.

#define PIOS_IRQ_PRIO_HIGHEST   4

Definition at line 148 of file pios_board.h.

#define PIOS_IRQ_PRIO_LOW   12

Definition at line 145 of file pios_board.h.

#define PIOS_IRQ_PRIO_MID   8

Definition at line 146 of file pios_board.h.

#define PIOS_LED_ALARM   1

Definition at line 87 of file pios_board.h.

#define PIOS_LED_HEARTBEAT   0

Definition at line 86 of file pios_board.h.

#define PIOS_PERIPHERAL_APB1_CLOCK   (PIOS_SYSCLK / 2)

Definition at line 138 of file pios_board.h.

#define PIOS_PERIPHERAL_APB2_CLOCK   (PIOS_SYSCLK / 1)

Definition at line 139 of file pios_board.h.

#define PIOS_PPM_NUM_INPUTS   12

Definition at line 160 of file pios_board.h.

#define PIOS_PWM_NUM_INPUTS   10

Definition at line 165 of file pios_board.h.

#define PIOS_RCVR_MAX_CHANNELS   12

Definition at line 155 of file pios_board.h.

#define PIOS_SBUS_NUM_INPUTS   (16+2)

Definition at line 181 of file pios_board.h.

#define PIOS_SERVO_UPDATE_HZ   50

Definition at line 186 of file pios_board.h.

#define PIOS_SERVOS_INITIAL_POSITION   0 /* dont want to start motors, have no pulse till settings loaded */

Definition at line 187 of file pios_board.h.

#define PIOS_SYSCLK   72000000

Definition at line 137 of file pios_board.h.

#define PIOS_TIM_MAX_DEVS   8

Definition at line 192 of file pios_board.h.

#define PIOS_USB_ENABLED   1 /* Should remove all references to this */

Definition at line 213 of file pios_board.h.

#define PIOS_WATCHDOG_TIMEOUT   250

Definition at line 92 of file pios_board.h.

#define PIOS_WDG_REGISTER   RTC_BKP_DR4

Definition at line 93 of file pios_board.h.

#define STABILIZATION_LQG

Definition at line 35 of file pios_config.h.

#define VREF_PLUS   3.3

Definition at line 201 of file pios_board.h.

Function Documentation

void PIOS_Board_Init ( void  )

PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c

Definition at line 44 of file pios_board.c.

Variable Documentation

uintptr_t pios_can_id

Definition at line 55 of file pios_board.c.

uintptr_t pios_com_aux_id

Definition at line 52 of file pios_board.c.

uintptr_t pios_com_bridge_id

Definition at line 81 of file pios_hal.c.

uintptr_t pios_com_can_id

Definition at line 53 of file pios_board.c.

uintptr_t pios_com_frsky_sensor_hub_id
uintptr_t pios_com_frsky_sport_id
uintptr_t pios_com_gps_id

Definition at line 80 of file pios_hal.c.

uintptr_t pios_com_hott_id
uintptr_t pios_com_lighttelemetry_id
uintptr_t pios_com_mavlink_id
uintptr_t pios_com_openlog_logging_id

Definition at line 56 of file pios_board.c.

uintptr_t pios_com_openlog_logging_id

Definition at line 49 of file pios_board.c.

uintptr_t pios_com_storm32bgc_id
uintptr_t pios_com_telem_serial_id

Definition at line 127 of file pios_hal.c.

uintptr_t pios_com_telem_usb_id

Definition at line 42 of file pios_board.c.

uintptr_t pios_com_telem_usb_id

Definition at line 42 of file pios_board.c.

uintptr_t pios_com_vcp_id
const struct pios_tim_channel pios_tim_servoport_v02_pins[]
static

Definition at line 684 of file board_hw_defs.c.

uintptr_t pios_uavo_settings_fs_id

Simulation of the flash filesystem

Todo:
something nicer about these

Definition at line 54 of file pios_board.c.

const struct pios_tim_clock_cfg tim_15_cfg
static
Initial value:
= {
.timer = TIM15,
.time_base_init = &tim_1_15_16_17_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM1_BRK_TIM15_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base

Definition at line 633 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_16_cfg
static
Initial value:
= {
.timer = TIM16,
.time_base_init = &tim_1_15_16_17_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM1_UP_TIM16_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base

Definition at line 646 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_17_cfg
static
Initial value:
= {
.timer = TIM17,
.time_base_init = &tim_1_15_16_17_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM1_TRG_COM_TIM17_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base

Definition at line 658 of file board_hw_defs.c.

const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base
static
Initial value:
= {
.TIM_Prescaler = (PIOS_PERIPHERAL_APB2_CLOCK / 1000000) - 1,
.TIM_ClockDivision = TIM_CKD_DIV1,
.TIM_CounterMode = TIM_CounterMode_Up,
.TIM_Period = ((1000000 / PIOS_SERVO_UPDATE_HZ) - 1),
.TIM_RepetitionCounter = 0x0000,
}
#define PIOS_SERVO_UPDATE_HZ
Definition: pios_board.h:209
#define PIOS_PERIPHERAL_APB2_CLOCK
Definition: pios_board.h:164

Definition at line 579 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_1_cfg
static
Initial value:
= {
.timer = TIM1,
.time_base_init = &tim_1_15_16_17_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM1_CC_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_1_15_16_17_time_base

Definition at line 621 of file board_hw_defs.c.

const TIM_TimeBaseInitTypeDef tim_2_3_time_base
static
Initial value:
= {
.TIM_Prescaler = (PIOS_PERIPHERAL_APB1_CLOCK / 1000000 * 2) - 1,
.TIM_ClockDivision = TIM_CKD_DIV1,
.TIM_CounterMode = TIM_CounterMode_Up,
.TIM_Period = ((1000000 / PIOS_SERVO_UPDATE_HZ) - 1),
.TIM_RepetitionCounter = 0x0000,
}
#define PIOS_SERVO_UPDATE_HZ
Definition: pios_board.h:209
#define PIOS_PERIPHERAL_APB1_CLOCK
Definition: pios_board.h:154

Definition at line 587 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_2_cfg
static
Initial value:
= {
.timer = TIM2,
.time_base_init = &tim_2_3_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM2_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_2_3_time_base

Definition at line 595 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_3_cfg
static
Initial value:
= {
.timer = TIM3,
.time_base_init = &tim_2_3_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM3_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
#define PIOS_IRQ_PRIO_MID
Definition: pios_board.h:170
static const TIM_TimeBaseInitTypeDef tim_2_3_time_base

Definition at line 608 of file board_hw_defs.c.