dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
FlyingPi IO Hat

Defines board specific static initializers for hardware for the FlyingPIO IO expander. More...

Modules

 CMSIS
 

Files

file  system_stm32f0xx.c
 CMSIS Cortex-M0 Device Peripheral Access Layer System Source File. This file contains the system clock configuration for STM32F0xx devices, and is generated by the clock configuration tool STM32F0xx_Clock_Configuration_V1.0.1.xls.
 

Macros

#define PIOS_LED_HEARTBEAT   0
 
#define PIOS_WATCHDOG_TIMEOUT   125
 
#define PIOS_SYSCLK   40000000
 
#define PIOS_PERIPHERAL_APB1_CLOCK   (PIOS_SYSCLK)
 
#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_IRQ_PRIO_EXTREME   0
 
#define PIOS_RCVR_MAX_CHANNELS   12
 
#define PIOS_PPM_NUM_INPUTS   12
 
#define PIOS_DSM_NUM_INPUTS   12
 
#define PIOS_HSUM_MAX_DEVS   1
 
#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   3
 
#define PIOS_ADC_SUB_DRIVER_MAX_INSTANCES   1
 
#define VREF_PLUS   3.3
 
#define PIOS_INCLUDE_SYS
 
#define PIOS_INCLUDE_ADC
 
#define PIOS_INCLUDE_COM
 
#define PIOS_INCLUDE_IRQ
 
#define PIOS_INCLUDE_ANNUNC
 
#define PIOS_INCLUDE_RTC
 
#define PIOS_INCLUDE_SERVO
 
#define PIOS_INCLUDE_SPISLAVE
 
#define PIOS_INCLUDE_TIM
 
#define PIOS_INCLUDE_USART
 
#define PIOS_INCLUDE_WDG
 
#define PIOS_NO_ALARMS
 
#define PIOS_NO_MODULES
 
#define PIOS_INCLUDE_RCVR
 
#define PIOS_INCLUDE_DSM
 
#define PIOS_INCLUDE_HSUM
 
#define PIOS_INCLUDE_SBUS
 
#define PIOS_INCLUDE_PPM
 
#define PIOS_INCLUDE_SRXL
 
#define PIOS_INCLUDE_IBUS
 

Enumerations

enum  board_revision { BOARD_REVISION_1 = 0x01 }
 

Functions

const struct pios_sbus_cfgget_sbus_cfg (enum board_revision board_rev)
 
void PIOS_Board_Init (void)
 
void TIM1_CC_IRQHandler (void)
 
void TIM1_BRK_UP_TRG_COM_IRQHandler (void)
 
void TIM2_IRQHandler (void)
 
void TIM3_IRQHandler (void)
 
void TIM14_IRQHandler (void)
 
void TIM15_IRQHandler (void)
 
void TIM16_IRQHandler (void)
 
void TIM17_IRQHandler (void)
 
void USART1_IRQHandler (void)
 
const void *_interrupt_vectors[USART2_IRQn] __attribute ((section(".interrupt_vectors")))
 
static void handle_cfg_fa (struct flyingpicmd_cfg_fa *cmd)
 
static void handle_actuator_fc (struct flyingpicmd_actuator_fc *cmd)
 
static void generate_status_message (int *resp_len)
 
static void process_pio_message_impl (int *resp_len)
 
static void process_pio_message (void *ctx, int len, int *resp_len)
 
int main ()
 

Variables

static const
TIM_TimeBaseInitTypeDef 
tim_time_base
 
static const struct
pios_tim_clock_cfg 
tim_1_cfg
 
static const struct
pios_tim_clock_cfg 
tim_3_cfg
 
static const struct
pios_tim_clock_cfg 
tim_14_cfg
 
static const struct
pios_tim_channel 
pios_tim_rcvrport_pin
 
static const struct
pios_tim_channel 
pios_tim_servoport_pins []
 
static bool inited
 
static struct flyingpicmd_cfg_fa cfg
 
uintptr_t adc_id
 
static uint16_t msg_num
 

Detailed Description

Defines board specific static initializers for hardware for the FlyingPIO IO expander.

Board specific options that modify PiOS capabilities.

Start the RTOS and the Modules.

Board header file for FlyingPIO IO Expander.

See Also
The GNU Public License (GPL) Version 3

Macro Definition Documentation

#define PIOS_ADC_SUB_DRIVER_MAX_INSTANCES   1

Definition at line 108 of file pios_board.h.

#define PIOS_DSM_NUM_INPUTS   12

Definition at line 76 of file pios_board.h.

#define PIOS_HSUM_MAX_DEVS   1

Definition at line 81 of file pios_board.h.

#define PIOS_HSUM_NUM_INPUTS   32

Definition at line 82 of file pios_board.h.

#define PIOS_INCLUDE_ADC

Definition at line 38 of file pios_config.h.

#define PIOS_INCLUDE_ANNUNC

Definition at line 41 of file pios_config.h.

#define PIOS_INCLUDE_COM

Definition at line 39 of file pios_config.h.

#define PIOS_INCLUDE_DSM

Definition at line 54 of file pios_config.h.

#define PIOS_INCLUDE_HSUM

Definition at line 55 of file pios_config.h.

#define PIOS_INCLUDE_IBUS

Definition at line 59 of file pios_config.h.

#define PIOS_INCLUDE_IRQ

Definition at line 40 of file pios_config.h.

#define PIOS_INCLUDE_PPM

Definition at line 57 of file pios_config.h.

#define PIOS_INCLUDE_RCVR

Definition at line 53 of file pios_config.h.

#define PIOS_INCLUDE_RTC

Definition at line 42 of file pios_config.h.

#define PIOS_INCLUDE_SBUS

Definition at line 56 of file pios_config.h.

#define PIOS_INCLUDE_SERVO

Definition at line 43 of file pios_config.h.

#define PIOS_INCLUDE_SPISLAVE

Definition at line 44 of file pios_config.h.

#define PIOS_INCLUDE_SRXL

Definition at line 58 of file pios_config.h.

#define PIOS_INCLUDE_SYS

Definition at line 33 of file pios_config.h.

#define PIOS_INCLUDE_TIM

Definition at line 45 of file pios_config.h.

#define PIOS_INCLUDE_USART

Definition at line 46 of file pios_config.h.

#define PIOS_INCLUDE_WDG

Definition at line 47 of file pios_config.h.

#define PIOS_IRQ_PRIO_EXTREME   0

Definition at line 60 of file pios_board.h.

#define PIOS_IRQ_PRIO_HIGH   5

Definition at line 58 of file pios_board.h.

#define PIOS_IRQ_PRIO_HIGHEST   4

Definition at line 59 of file pios_board.h.

#define PIOS_IRQ_PRIO_LOW   12

Definition at line 56 of file pios_board.h.

#define PIOS_IRQ_PRIO_MID   8

Definition at line 57 of file pios_board.h.

#define PIOS_LED_HEARTBEAT   0

Definition at line 38 of file pios_board.h.

#define PIOS_NO_ALARMS

Definition at line 49 of file pios_config.h.

#define PIOS_NO_MODULES

Definition at line 50 of file pios_config.h.

#define PIOS_PERIPHERAL_APB1_CLOCK   (PIOS_SYSCLK)

Definition at line 50 of file pios_board.h.

#define PIOS_PPM_NUM_INPUTS   12

Definition at line 71 of file pios_board.h.

#define PIOS_RCVR_MAX_CHANNELS   12

Definition at line 66 of file pios_board.h.

#define PIOS_SBUS_NUM_INPUTS   (16+2)

Definition at line 87 of file pios_board.h.

#define PIOS_SERVO_UPDATE_HZ   50

Definition at line 92 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 93 of file pios_board.h.

#define PIOS_SYSCLK   40000000

Definition at line 49 of file pios_board.h.

#define PIOS_TIM_MAX_DEVS   3

Definition at line 98 of file pios_board.h.

#define PIOS_WATCHDOG_TIMEOUT   125

Definition at line 43 of file pios_board.h.

#define VREF_PLUS   3.3

Definition at line 110 of file pios_board.h.

Enumeration Type Documentation

Enumerator
BOARD_REVISION_1 

Definition at line 35 of file board_hw_defs.c.

Function Documentation

const void* _interrupt_vectors [USART2_IRQn] __attribute ( (section(".interrupt_vectors"))  )
static void generate_status_message ( int *  resp_len)
static

Definition at line 145 of file main.c.

const struct pios_sbus_cfg* get_sbus_cfg ( enum board_revision  board_rev)

Definition at line 500 of file board_hw_defs.c.

static void handle_actuator_fc ( struct flyingpicmd_actuator_fc cmd)
static

Definition at line 121 of file main.c.

static void handle_cfg_fa ( struct flyingpicmd_cfg_fa cmd)
static

Definition at line 77 of file main.c.

int main ( void  )

dRonin Main function:

Initialize PiOS
Create the "System" task (SystemModInitializein Modules/System/systemmod.c)
Start the RTOS Scheduler

CortexM3 CPU vectors

CortexM3 CPU vectors

Definition at line 207 of file main.c.

void PIOS_Board_Init ( void  )

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

Initialise PWM Output for black/white level setting PIOS_Board_Init() initializes all the core subsystems on this specific hardware called from System/openpilot.c

PIOS_Board_Init() initializes all the core subsystems on this specific hardware

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

Definition at line 44 of file pios_board.c.

static void process_pio_message ( void *  ctx,
int  len,
int *  resp_len 
)
static

Definition at line 195 of file main.c.

static void process_pio_message_impl ( int *  resp_len)
static

Definition at line 174 of file main.c.

void TIM14_IRQHandler ( void  )

Definition at line 351 of file pios_tim.c.

void TIM15_IRQHandler ( void  )

Definition at line 359 of file pios_tim.c.

void TIM16_IRQHandler ( void  )

Definition at line 367 of file pios_tim.c.

void TIM17_IRQHandler ( void  )

Definition at line 375 of file pios_tim.c.

void TIM1_BRK_UP_TRG_COM_IRQHandler ( void  )
void TIM1_CC_IRQHandler ( void  )

Definition at line 317 of file pios_tim.c.

void TIM2_IRQHandler ( void  )

Definition at line 327 of file pios_tim.c.

void TIM3_IRQHandler ( void  )

Definition at line 335 of file pios_tim.c.

void USART1_IRQHandler ( void  )

Variable Documentation

uintptr_t adc_id

Definition at line 51 of file main.c.

struct flyingpicmd_cfg_fa cfg
static

Definition at line 49 of file main.c.

bool inited
static

Definition at line 47 of file main.c.

uint16_t msg_num
static

Definition at line 52 of file main.c.

const struct pios_tim_channel pios_tim_rcvrport_pin
static
Initial value:
= {
.timer = TIM14,
.timer_chan = TIM_Channel_1,
.remap = GPIO_AF_0,
.pin = {
.gpio = GPIOB,
.init = {
.GPIO_Pin = GPIO_Pin_1,
.GPIO_Mode = GPIO_Mode_AF,
.GPIO_PuPd = GPIO_PuPd_UP,
.GPIO_OType = GPIO_OType_PP,
.GPIO_Speed = GPIO_Speed_2MHz,
},
.pin_source = GPIO_PinSource1,
},
}

Definition at line 251 of file board_hw_defs.c.

const struct pios_tim_channel pios_tim_servoport_pins[]
static

Definition at line 268 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_14_cfg
static
Initial value:
= {
.timer = TIM14,
.time_base_init = &tim_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM14_IRQn,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
static const TIM_TimeBaseInitTypeDef tim_time_base

Definition at line 228 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_1_cfg
static
Initial value:
= {
.timer = TIM1,
.time_base_init = &tim_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM1_CC_IRQn,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
static const TIM_TimeBaseInitTypeDef tim_time_base

Definition at line 205 of file board_hw_defs.c.

const struct pios_tim_clock_cfg tim_3_cfg
static
Initial value:
= {
.timer = TIM3,
.time_base_init = &tim_time_base,
.irq = {
.init = {
.NVIC_IRQChannel = TIM3_IRQn,
.NVIC_IRQChannelCmd = ENABLE,
},
},
}
static const TIM_TimeBaseInitTypeDef tim_time_base

Definition at line 216 of file board_hw_defs.c.

const TIM_TimeBaseInitTypeDef tim_time_base
static
Initial value:
= {
.TIM_Prescaler = (PIOS_SYSCLK / 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_SYSCLK
Definition: pios_board.h:143

Definition at line 197 of file board_hw_defs.c.