dRonin  adbada4
dRonin firmware
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
PIOS Core hardware abstraction layer

Modules

 Debugging Functions
 Debugging functionality.
 
 ADC Functions
 Upper level Analog to Digital converter layer.
 
 Annunciator DAC Functions
 PIOS interface for Annunciator DAC implementation.
 
 BMI160 Functions
 Hardware functions to deal with the 6DOF gyro / accel sensor.
 
 PIOS_BMM150
 Driver for Bosch BMM150 IMU Sensor (part of BMX055)
 
 BMP280 Functions
 Driver for BMP280.
 
 PIOS_BMX055
 Driver for Bosch BMX055 IMU Sensor.
 
 COM layer functions
 Hardware communication layer.
 
 PiOS TBS Crossfire receiver driver
 Receives and decodes CRSF protocol receiver packets.
 
 Spektrum/JR DSMx satellite receiver functions
 Code to bind and read Spektrum/JR DSMx satellite receiver serial stream.
 
 ETASV3 Functions
 Hardware functions to deal with the Eagle Tree Airspeed MicroSensor V3.
 
 Flash Partition Abstraction
 Flash Partition Abstraction to hide details of underlying flash device details.
 
 Flash Filesystem Function
 Log Structured Filesystem for internal or external NOR Flash.
 
 FSK DAC Functions
 PIOS interface for FSK DAC implementation.
 
 Hardware abstraction layer files
 Code to initialize ports/devices for multiple targets.
 
 HCSR04 Functions
 Hardware functions to deal with the altitude pressure sensor.
 
 Heap Allocation Abstraction
 Heap allocation abstraction to hide details of allocation from SRAM and CCM RAM.
 
 HMC5883 Functions
 Deals with the hardware interface to the magnetometers.
 
 HMC5983 Functions
 Deals with the hardware interface to the magnetometers.
 
 Graupner HoTT receiver functions
 Graupner HoTT receiver functions for SUMD/H.
 
 PiOS IBus receiver driver
 Receives and decodes IBus protocol reciever packets.
 
 PIOS_LIS3MDL
 Driver for Bosch LIS3MDL IMU Sensor (part of BMX055)
 
 Max7456 Functions
 
 Module Functions
 Allows control of module enable/disable from PiOS.
 
 Invensense MPU Functions
 Common driver for Invensense MPU-xxx0 6/9-axis IMUs.
 
 MPXV5004 Functions
 Hardware functions to deal with the DIYDrones airspeed kit, using MPXV5004. This is a differential sensor, so the value returned is first converted into calibrated airspeed, using http://en.wikipedia.org/wiki/Calibrated_airspeed.
 
 MPXV7002 Functions
 Hardware functions to deal with the DIYDrones airspeed kit, using MPXV7002. This is a differential sensor, so the value returned is first converted into calibrated airspeed, using http://en.wikipedia.org/wiki/Calibrated_airspeed.
 
 MS5611 Functions
 Hardware functions to deal with the altitude pressure sensor.
 
 Mutex Abstraction
 Abstracts the concept of a mutex to hide different implementations.
 
 Driver for OmniPreSense mm-wave radar modules
 Interfaces with simple serial-based doppler & ranging devices.
 
 Radio Functions
 PIOS OpenLRS interface for for the RFM22B radio.
 
 PX4Flow Functions
 Deals with the hardware interface to the PixHawk optical flow sensor.
 
 Queue Abstraction
 Abstracts the concept of a queue to hide different implementations.
 
 Futaba S.Bus receiver functions
 Code to read Futaba S.Bus receiver serial stream.
 
 Semaphore Abstraction
 Abstracts the concept of a binary semaphore to hide different implementations.
 
 Generic sensor interface functions
 Generic interface for sensors.
 
 Multiplex SRXL protocol receiver driver
 Supports receivers using the Multiplex SRXL protocol.
 
 Thread Abstraction
 Abstracts the concept of a thread to hide different implementations.
 
 Receiver-over-UAVTALK Input Functions
 Code to read the channels within the Receiver UAVObject.
 
 USB Descriptor definitions
 USB Descriptor definitions for HID and CDC.
 
 USB utility functions
 USB utility functions.
 
 Annunciator functions
 Annunciator functions– Annunciators, buzzers, etc.
 
 LED Functions
 PIOS interface for LEDs.
 
 Functions
 HAL code to interface to the OpenPilot AHRS module.
 
 PiOS CAN interface layer
 CAN interface for PiOS.
 
 CRC Functions
 
 Delay Functions
 PiOS Delay functionality.
 
 External Interrupt Handlers
 External interrupt handler functions.
 
 PIOS_FLYINGPIO
 Driver for FLYINGPIO IO expander.
 
 I2C Functions
 Linux I2C functionality.
 
 IAP Functions
 Common PIOS IAP Function header.
 
 Generic Initcall Macros
 Initcall Macros.
 
 Internal ADC Functions
 
 IRQ Setup Functions
 STM32 Hardware code to enable and disable interrupts.
 
 PiOS MAX7456 Driver
 Driver for MAX7456 OSD.
 
 RFM22b receiver functions
 Deals with the RFM22b module.
 
 PPM Input Functions
 PIOS interface to read and write from ppm port.
 
 PWM Input Functions
 Code to measure with PWM input.
 
 Servo Functions
 PIOS interface to read and write from servo PWM ports.
 
 RCVR layer functions
 Hardware communication layer.
 
 Reset functions
 Hardware functions to deal with the reset register.
 
 RTC Functions
 PIOS interface for RTC tick.
 
 SPI Functions
 PIOS interface to read and write from SPI ports.
 
 SPI Slave Functions
 PIOS interface for subsidiary microcontrollers.
 
 STM32 HAL
 STM32 specific global data structures.
 
 System Functions
 PIOS System Initialization code.
 
 USB Functions
 Defines for board specific usb information.
 
 USB board layer functions
 
 USB CDC COM layer functions
 Hardware communication layer.
 
 USB standard types and definitions
 USB Standard types and definitions.
 
 USB HID Functions
 PIOS USB COM implementation for HID interfaces This implements serial emulation over HID reports.
 
 USB glue code
 Glue between PiOS and STM32 libs.
 
 Watchdog Functions
 PIOS Comamnds to initialize and clear watchdog timer.
 
 WS2811 Functions
 Driver for WS2811 LEDs. Uses one timer (generally TIM1 advanced control timer) and two DMAs. First DMA sets the bit high at the beginning of each cycle. Next DMA picks one of two phases to lower the bit at.
 
 File Output Driver
 
 FlightGear driver
 
 Serial Driver
 
 TCP Driver
 
 ChibiOS Interface
 
 Digital IO subsystem
 Provides an interface to configure and efficiently use GPIOs.
 
 Inline delay subsystem
 Inline delay routines for fine-resolution spinloops.
 
 USART Functions
 PIOS interface for USART port.
 
 Timer Functions
 PIOS Timer control code.
 
 PIOS Flash internal flash driver
 
 DAC Functions
 Driver for DAC output. Uses a timer (usually TIM6), a DMA channel, and a DAC.
 
 PiOS DMA-driven DShot driver
 Generates DShot signal by updating timer CC registers via DMA bursts.
 
 Code for OSD video generator
 Output video (black & white pixels) over SPI.
 

Files

file  pios_max7456.c
 
file  printf-stdarg.c
 Formatted print functions.
 
file  pios_max7456.c
 
file  openpilot.h
 Includes PiOS and core architecture components.
 
file  pios.h
 Main PiOS header to include all the compiled in PiOS options.
 
file  pios_dac.h
 

Data Structures

struct  pios_dac_cfg
 

Macros

#define PAD_RIGHT   1
 
#define PAD_ZERO   2
 
#define PRINT_BUF_LEN   12
 
#define MAX7456_MODE_PAL   0
 
#define MAX7456_MODE_NTSC   1
 
#define MAX7456_ATTR_NONE   0
 
#define MAX7456_ATTR_INVERT   1
 
#define MAX7456_ATTR_BLINK   2
 
#define MAX7456_ATTR_LBC   4
 
#define MAX7456_PAL_COLUMNS   30
 
#define MAX7456_PAL_ROWS   16
 
#define MAX7456_PAL_HCENTER   (MAX7456_PAL_COLUMNS / 2)
 
#define MAX7456_PAL_VCENTER   (MAX7456_PAL_ROWS / 2)
 
#define MAX7456_NTSC_COLUMNS   30
 
#define MAX7456_NTSC_ROWS   13
 
#define MAX7456_NTSC_HCENTER   (MAX7456_NTSC_COLUMNS / 2)
 
#define MAX7456_NTSC_VCENTER   (MAX7456_NTSC_ROWS / 2)
 
#define MAX7456_COLUMNS   MAX7456_NTSC_COLUMNS
 
#define MAX7456_HCENTER   MAX7456_NTSC_HCENTER
 
#define MAX7456_FMT_H_CENTER   31
 
#define NELEMENTS(x)   (sizeof(x) / sizeof(*(x)))
 
#define DONT_BUILD_IF(COND, MSG)   typedef char static_assertion_##MSG[(COND)?-1:1]
 
#define CPU_TO_LE16(x)   (x)
 
#define CPU_TO_LE32(x)   (x)
 
#define CPU_TO_BE16(x)
 
#define CPU_TO_BE32(x)
 
#define LE16_TO_CPU(x)   CPU_TO_LE16(x)
 
#define LE32_TO_CPU(x)   CPU_TO_LE32(x)
 
#define BE16_TO_CPU(x)   CPU_TO_BE16(x)
 
#define BE32_TO_CPU(x)   CPU_TO_BE32(x)
 
#define HANDLER(_name)   extern vector _name __attribute__((weak, alias("default_cpu_handler")))
 
#define HANDLER(_name)   extern vector _name __attribute__((weak, alias("default_io_handler")))
 
#define HANDLER(_name)   extern vector _name __attribute__((weak, alias("default_cpu_handler")))
 
#define HANDLER(_name)   extern vector _name __attribute__((weak, alias("default_io_handler")))
 

Typedefs

typedef struct max7456_dev_s * max7456_dev_t
 
typedef const void( vector )(void)
 
typedef struct dac_dev_s * dac_dev_t
 
typedef bool(* fill_dma_cb )(void *ctx, uint16_t *buf, int len)
 
typedef const void( vector )(void)
 

Functions

static void printchar (char **str, int c)
 
static int prints (char **out, const char *string, int width, int pad)
 
static int printi (char **out, int i, int b, int sg, int width, int pad, int letbase)
 
static int print (char **out, const char *format, va_list args)
 
int printf (const char *format,...)
 
int vprintf (const char *format, va_list args)
 
int sprintf (char *out, const char *format,...)
 
int vsprintf (char *out, const char *format, va_list args)
 
int snprintf (char *buf, size_t count, const char *format,...)
 
void PIOS_MAX7456_wait_vsync ()
 
int PIOS_MAX7456_init (max7456_dev_t *dev_out, pios_spi_t spi_handle, uint32_t slave_idx)
 Allocate and initialise MAX7456 device. More...
 
void PIOS_MAX7456_clear (max7456_dev_t dev)
 Clear the screen. More...
 
void PIOS_MAX7456_upload_char (max7456_dev_t dev, uint8_t char_index, const uint8_t *data)
 Upload a character to the device. More...
 
void PIOS_MAX7456_download_char (max7456_dev_t dev, uint8_t char_index, uint8_t *data)
 Download a character from the device. More...
 
void PIOS_MAX7456_put (max7456_dev_t dev, uint8_t col, uint8_t row, uint8_t chr, uint8_t attr)
 Sets a position of character memory. More...
 
void PIOS_MAX7456_puts (max7456_dev_t dev, uint8_t col, uint8_t row, const char *s, uint8_t attr)
 Sets a string into character memory. More...
 
void PIOS_MAX7456_get_extents (max7456_dev_t dev, uint8_t *mode, uint8_t *right, uint8_t *bottom, uint8_t *hcenter, uint8_t *vcenter)
 Gets the extents of the screen. More...
 
void PIOS_MAX7456_wait_vsync (max7456_dev_t dev)
 Waits for vsync in a configuration-dependant way. More...
 
bool PIOS_MAX7456_stall_detect (max7456_dev_t dev)
 Detects whether the OSD chip has stalled and attempts to restart it. More...
 
void PIOS_MAX7456_set_mode (max7456_dev_t dev, bool force, uint8_t fallback)
 Allows overriding the video mode used by OSD. More...
 
int main (void)
 
void _main (void)
 
static void default_cpu_handler (void)
 
 HANDLER (NMI_Handler)
 
 HANDLER (HardFault_Handler)
 
 HANDLER (MemManage_Handler)
 
 HANDLER (BusFault_Handler)
 
 HANDLER (UsageFault_Handler)
 
 HANDLER (DebugMon_Handler)
 
struct cm3_vectors cpu_vectors __attribute ((section(".cpu_vectors")))
 
static void default_io_handler (void)
 
 HANDLER (Reserved_IRQHandler)
 
 HANDLER (WWDG_IRQHandler)
 
 HANDLER (PVD_IRQHandler)
 
 HANDLER (TAMP_STAMP_IRQHandler)
 
 HANDLER (RTC_WKUP_IRQHandler)
 
 HANDLER (FLASH_IRQHandler)
 
 HANDLER (RCC_IRQHandler)
 
 HANDLER (EXTI0_IRQHandler)
 
 HANDLER (EXTI1_IRQHandler)
 
 HANDLER (EXTI2_TS_IRQHandler)
 
 HANDLER (EXTI3_IRQHandler)
 
 HANDLER (EXTI4_IRQHandler)
 
 HANDLER (DMA1_Channel1_IRQHandler)
 
 HANDLER (DMA1_Channel2_IRQHandler)
 
 HANDLER (DMA1_Channel3_IRQHandler)
 
 HANDLER (DMA1_Channel4_IRQHandler)
 
 HANDLER (DMA1_Channel5_IRQHandler)
 
 HANDLER (DMA1_Channel6_IRQHandler)
 
 HANDLER (DMA1_Channel7_IRQHandler)
 
 HANDLER (ADC1_2_IRQHandler)
 
 HANDLER (USB_HP_CAN1_TX_IRQHandler)
 
 HANDLER (USB_LP_CAN1_RX0_IRQHandler)
 
 HANDLER (CAN1_RX1_IRQHandler)
 
 HANDLER (CAN1_SCE_IRQHandler)
 
 HANDLER (EXTI9_5_IRQHandler)
 
 HANDLER (TIM1_BRK_TIM15_IRQHandler)
 
 HANDLER (TIM1_UP_TIM16_IRQHandler)
 
 HANDLER (TIM1_TRG_COM_TIM17_IRQHandler)
 
 HANDLER (TIM1_CC_IRQHandler)
 
 HANDLER (TIM2_IRQHandler)
 
 HANDLER (TIM3_IRQHandler)
 
 HANDLER (TIM4_IRQHandler)
 
 HANDLER (I2C1_EV_EXTI23_IRQHandler)
 
 HANDLER (I2C1_ER_IRQHandler)
 
 HANDLER (I2C2_EV_EXTI24_IRQHandler)
 
 HANDLER (I2C2_ER_IRQHandler)
 
 HANDLER (SPI1_IRQHandler)
 
 HANDLER (SPI2_IRQHandler)
 
 HANDLER (USART1_EXTI25_IRQHandler)
 
 HANDLER (USART2_EXTI26_IRQHandler)
 
 HANDLER (USART3_EXTI28_IRQHandler)
 
 HANDLER (EXTI15_10_IRQHandler)
 
 HANDLER (RTC_Alarm_IRQHandler)
 
 HANDLER (USB_WKUP_IRQHandler)
 
 HANDLER (TIM8_BRK_IRQHandler)
 
 HANDLER (TIM8_UP_IRQHandler)
 
 HANDLER (TIM8_TRG_COM_IRQHandler)
 
 HANDLER (TIM8_CC_IRQHandler)
 
 HANDLER (ADC3_IRQHandler)
 
 HANDLER (SPI3_IRQHandler)
 
 HANDLER (UART4_EXTI34_IRQHandler)
 
 HANDLER (UART5_EXTI35_IRQHandler)
 
 HANDLER (TIM6_DAC_IRQHandler)
 
 HANDLER (TIM7_IRQHandler)
 
 HANDLER (DMA2_Channel1_IRQHandler)
 
 HANDLER (DMA2_Channel2_IRQHandler)
 
 HANDLER (DMA2_Channel3_IRQHandler)
 
 HANDLER (DMA2_Channel4_IRQHandler)
 
 HANDLER (DMA2_Channel5_IRQHandler)
 
 HANDLER (ADC4_IRQHandler)
 
 HANDLER (COMP1_2_3_IRQHandler)
 
 HANDLER (COMP4_5_6_IRQHandler)
 
 HANDLER (COMP7_IRQHandler)
 
 HANDLER (USB_HP_IRQHandler)
 
 HANDLER (USB_LP_IRQHandler)
 
 HANDLER (USB_WKUP_RMP_IRQHandler)
 
 HANDLER (FPU_IRQHandler)
 
vector *io_vectors[] __attribute__ ((section(".io_vectors")))
 
int PIOS_DAC_init (dac_dev_t *dev_out, const struct pios_dac_cfg *cfg)
 Allocate and initialise DAC device. More...
 
void PIOS_DAC_dma_interrupt_handler (dac_dev_t dev)
 Handles a DMA completion interrupt on dma_stream. More...
 
bool PIOS_DAC_install_callback (dac_dev_t dev, uint8_t priority, fill_dma_cb cb, void *ctx)
 
register void *stack_pointer asm ("sp")
 
 HANDLER (EXTI2_IRQHandler)
 
 HANDLER (DMA1_Stream0_IRQHandler)
 
 HANDLER (DMA1_Stream1_IRQHandler)
 
 HANDLER (DMA1_Stream2_IRQHandler)
 
 HANDLER (DMA1_Stream3_IRQHandler)
 
 HANDLER (DMA1_Stream4_IRQHandler)
 
 HANDLER (DMA1_Stream5_IRQHandler)
 
 HANDLER (DMA1_Stream6_IRQHandler)
 
 HANDLER (ADC_IRQHandler)
 
 HANDLER (CAN1_TX_IRQHandler)
 
 HANDLER (CAN1_RX0_IRQHandler)
 
 HANDLER (TIM1_BRK_TIM9_IRQHandler)
 
 HANDLER (TIM1_UP_TIM10_IRQHandler)
 
 HANDLER (TIM1_TRG_COM_TIM11_IRQHandler)
 
 HANDLER (I2C1_EV_IRQHandler)
 
 HANDLER (I2C2_EV_IRQHandler)
 
 HANDLER (USART1_IRQHandler)
 
 HANDLER (USART2_IRQHandler)
 
 HANDLER (USART3_IRQHandler)
 
 HANDLER (OTG_FS_WKUP_IRQHandler)
 
 HANDLER (TIM8_BRK_TIM12_IRQHandler)
 
 HANDLER (TIM8_UP_TIM13_IRQHandler)
 
 HANDLER (TIM8_TRG_COM_TIM14_IRQHandler)
 
 HANDLER (DMA1_Stream7_IRQHandler)
 
 HANDLER (FSMC_IRQHandler)
 
 HANDLER (SDIO_IRQHandler)
 
 HANDLER (TIM5_IRQHandler)
 
 HANDLER (USART4_IRQHandler)
 
 HANDLER (USART5_IRQHandler)
 
 HANDLER (DMA2_Stream0_IRQHandler)
 
 HANDLER (DMA2_Stream1_IRQHandler)
 
 HANDLER (DMA2_Stream2_IRQHandler)
 
 HANDLER (DMA2_Stream3_IRQHandler)
 
 HANDLER (DMA2_Stream4_IRQHandler)
 
 HANDLER (ETH_IRQHandler)
 
 HANDLER (ETH_WKUP_IRQHandler)
 
 HANDLER (CAN2_TX_IRQHandler)
 
 HANDLER (CAN2_RX0_IRQHandler)
 
 HANDLER (CAN2_RX1_IRQHandler)
 
 HANDLER (CAN2_SCE_IRQHandler)
 
 HANDLER (OTG_FS_IRQHandler)
 
 HANDLER (DMA2_Stream5_IRQHandler)
 
 HANDLER (DMA2_Stream6_IRQHandler)
 
 HANDLER (DMA2_Stream7_IRQHandler)
 
 HANDLER (USART6_IRQHandler)
 
 HANDLER (I2C3_EV_IRQHandler)
 
 HANDLER (I2C3_ER_IRQHandler)
 
 HANDLER (OTG_HS_EP1_OUT_IRQHandler)
 
 HANDLER (OTG_HS_EP1_IN_IRQHandler)
 
 HANDLER (OTG_HS_WKUP_IRQHandler)
 
 HANDLER (OTG_HS_IRQHandler)
 
 HANDLER (DCMI_IRQHandler)
 
 HANDLER (CRYP_IRQHandler)
 
 HANDLER (HASH_RNG_IRQHandler)
 

Variables

TIM_TypeDef * pios_dac_cfg::timer
 
TIM_TimeBaseInitTypeDef pios_dac_cfg::clock_cfg
 
NVIC_InitTypeDef pios_dac_cfg::interrupt
 
GPIO_TypeDef * pios_dac_cfg::gpio
 
uint16_t pios_dac_cfg::gpio_pin
 
DMA_Stream_TypeDef * pios_dac_cfg::dma_stream
 
uint32_t pios_dac_cfg::dma_channel
 
uint32_t pios_dac_cfg::dac_channel
 
uint32_t pios_dac_cfg::dac_trigger
 
uintptr_t pios_dac_cfg::dac_outreg
 
uint32_t pios_dac_cfg::dma_tcif
 
void ** HARDFAULT_PSP
 

Detailed Description

Macro Definition Documentation

#define BE16_TO_CPU (   x)    CPU_TO_BE16(x)

Definition at line 221 of file pios.h.

#define BE32_TO_CPU (   x)    CPU_TO_BE32(x)

Definition at line 222 of file pios.h.

#define CPU_TO_BE16 (   x)
Value:
( (((x) & 0xff00) >> 8) | \
(((x) & 0x00ff) << 8) )

Definition at line 199 of file pios.h.

#define CPU_TO_BE32 (   x)
Value:
( (((x) & 0xff000000) >> 24) | \
(((x) & 0x00ff0000) >> 8) | \
(((x) & 0x0000ff00) << 8) | \
(((x) & 0x000000ff) << 24) )

Definition at line 201 of file pios.h.

#define CPU_TO_LE16 (   x)    (x)

Definition at line 196 of file pios.h.

#define CPU_TO_LE32 (   x)    (x)

Definition at line 197 of file pios.h.

#define DONT_BUILD_IF (   COND,
  MSG 
)    typedef char static_assertion_##MSG[(COND)?-1:1]

Definition at line 193 of file pios.h.

#define HANDLER (   _name)    extern vector _name __attribute__((weak, alias("default_io_handler")))

prototypes an interrupt handler

Definition at line 38 of file vectors_stm32f4xx.c.

#define HANDLER (   _name)    extern vector _name __attribute__((weak, alias("default_io_handler")))

prototypes an interrupt handler

Definition at line 39 of file vectors_stm32f30x.c.

#define HANDLER (   _name)    extern vector _name __attribute__((weak, alias("default_cpu_handler")))

Prototype for optional exception vector handlers

Definition at line 114 of file startup.c.

#define HANDLER (   _name)    extern vector _name __attribute__((weak, alias("default_cpu_handler")))

Prototype for optional exception vector handlers

Definition at line 125 of file startup.c.

#define LE16_TO_CPU (   x)    CPU_TO_LE16(x)

Definition at line 219 of file pios.h.

#define LE32_TO_CPU (   x)    CPU_TO_LE32(x)

Definition at line 220 of file pios.h.

#define MAX7456_ATTR_BLINK   2

Definition at line 45 of file pios_max7456.h.

#define MAX7456_ATTR_INVERT   1

Definition at line 44 of file pios_max7456.h.

#define MAX7456_ATTR_LBC   4

Definition at line 46 of file pios_max7456.h.

#define MAX7456_ATTR_NONE   0

Definition at line 43 of file pios_max7456.h.

#define MAX7456_COLUMNS   MAX7456_NTSC_COLUMNS

Definition at line 59 of file pios_max7456.h.

#define MAX7456_FMT_H_CENTER   31

Definition at line 63 of file pios_max7456.h.

#define MAX7456_HCENTER   MAX7456_NTSC_HCENTER

Definition at line 60 of file pios_max7456.h.

#define MAX7456_MODE_NTSC   1

Definition at line 41 of file pios_max7456.h.

#define MAX7456_MODE_PAL   0

Definition at line 40 of file pios_max7456.h.

#define MAX7456_NTSC_COLUMNS   30

Definition at line 53 of file pios_max7456.h.

#define MAX7456_NTSC_HCENTER   (MAX7456_NTSC_COLUMNS / 2)

Definition at line 55 of file pios_max7456.h.

#define MAX7456_NTSC_ROWS   13

Definition at line 54 of file pios_max7456.h.

#define MAX7456_NTSC_VCENTER   (MAX7456_NTSC_ROWS / 2)

Definition at line 56 of file pios_max7456.h.

#define MAX7456_PAL_COLUMNS   30

Definition at line 48 of file pios_max7456.h.

#define MAX7456_PAL_HCENTER   (MAX7456_PAL_COLUMNS / 2)

Definition at line 50 of file pios_max7456.h.

#define MAX7456_PAL_ROWS   16

Definition at line 49 of file pios_max7456.h.

#define MAX7456_PAL_VCENTER   (MAX7456_PAL_ROWS / 2)

Definition at line 51 of file pios_max7456.h.

#define NELEMENTS (   x)    (sizeof(x) / sizeof(*(x)))

Definition at line 192 of file pios.h.

#define PAD_RIGHT   1

Definition at line 53 of file printf-stdarg.c.

#define PAD_ZERO   2

Definition at line 54 of file printf-stdarg.c.

#define PRINT_BUF_LEN   12

Definition at line 91 of file printf-stdarg.c.

Typedef Documentation

typedef struct dac_dev_s* dac_dev_t

Definition at line 40 of file pios_dac.h.

typedef bool(* fill_dma_cb)(void *ctx, uint16_t *buf, int len)

Definition at line 76 of file pios_dac.h.

typedef struct max7456_dev_s* max7456_dev_t

Definition at line 65 of file pios_max7456.h.

typedef const void( vector)(void)

interrupt handler

Definition at line 28 of file vectors_stm32f4xx.c.

typedef const void( vector)(void)

interrupt handler

Definition at line 29 of file vectors_stm32f30x.c.

Function Documentation

struct cm3_vectors cpu_vectors __attribute ( (section(".cpu_vectors"))  )
Initial value:
= {
.initial_stack = &irq_stack[sizeof(irq_stack)],
.vectors = {
NMI_Handler,
HardFault_Handler,
MemManage_Handler,
BusFault_Handler,
UsageFault_Handler,
0,
0,
0,
0,
0,
DebugMon_Handler,
0,
0,
0,
}
}
void _main(void)
Definition: startup.c:64
const void( vector)(void)
Definition: startup.c:32
static void entry()
Definition: loadabletest.c:40

CortexM3 vector table

vector* io_vectors [] __attribute__ ( (section(".io_vectors"))  )

stm32f30x interrupt vector table

stm32f4xx interrupt vector table

void _main ( void  )

Initial startup code.

Definition at line 64 of file startup.c.

register void* stack_pointer asm ( "sp"  )
static void default_cpu_handler ( void  )
static

Default handler for CPU exceptions.

Definition at line 108 of file startup.c.

static void default_io_handler ( void  )
static

default interrupt handler

Definition at line 33 of file vectors_stm32f30x.c.

HANDLER ( Reserved_IRQHandler  )
HANDLER ( WWDG_IRQHandler  )
HANDLER ( PVD_IRQHandler  )
HANDLER ( TAMP_STAMP_IRQHandler  )
HANDLER ( RTC_WKUP_IRQHandler  )
HANDLER ( FLASH_IRQHandler  )
HANDLER ( RCC_IRQHandler  )
HANDLER ( EXTI0_IRQHandler  )
HANDLER ( EXTI2_IRQHandler  )
HANDLER ( EXTI1_IRQHandler  )
HANDLER ( EXTI2_TS_IRQHandler  )
HANDLER ( EXTI3_IRQHandler  )
HANDLER ( DMA1_Stream0_IRQHandler  )
HANDLER ( EXTI4_IRQHandler  )
HANDLER ( DMA1_Stream1_IRQHandler  )
HANDLER ( DMA1_Channel1_IRQHandler  )
HANDLER ( DMA1_Stream2_IRQHandler  )
HANDLER ( DMA1_Channel2_IRQHandler  )
HANDLER ( DMA1_Stream3_IRQHandler  )
HANDLER ( DMA1_Channel3_IRQHandler  )
HANDLER ( DMA1_Stream4_IRQHandler  )
HANDLER ( DMA1_Channel4_IRQHandler  )
HANDLER ( DMA1_Stream5_IRQHandler  )
HANDLER ( DMA1_Channel5_IRQHandler  )
HANDLER ( DMA1_Stream6_IRQHandler  )
HANDLER ( DMA1_Channel6_IRQHandler  )
HANDLER ( ADC_IRQHandler  )
HANDLER ( DMA1_Channel7_IRQHandler  )
HANDLER ( CAN1_TX_IRQHandler  )
HANDLER ( ADC1_2_IRQHandler  )
HANDLER ( CAN1_RX0_IRQHandler  )
HANDLER ( CAN1_RX1_IRQHandler  )
HANDLER ( CAN1_SCE_IRQHandler  )
HANDLER ( TIM1_BRK_TIM9_IRQHandler  )
HANDLER ( EXTI9_5_IRQHandler  )
HANDLER ( TIM1_UP_TIM10_IRQHandler  )
HANDLER ( TIM1_UP_TIM16_IRQHandler  )
HANDLER ( TIM1_CC_IRQHandler  )
HANDLER ( TIM2_IRQHandler  )
HANDLER ( I2C1_EV_IRQHandler  )
HANDLER ( TIM3_IRQHandler  )
HANDLER ( TIM4_IRQHandler  )
HANDLER ( I2C2_EV_IRQHandler  )
HANDLER ( I2C1_ER_IRQHandler  )
HANDLER ( I2C2_ER_IRQHandler  )
HANDLER ( SPI1_IRQHandler  )
HANDLER ( USART1_IRQHandler  )
HANDLER ( SPI2_IRQHandler  )
HANDLER ( USART2_IRQHandler  )
HANDLER ( USART1_EXTI25_IRQHandler  )
HANDLER ( USART3_IRQHandler  )
HANDLER ( USART2_EXTI26_IRQHandler  )
HANDLER ( USART3_EXTI28_IRQHandler  )
HANDLER ( EXTI15_10_IRQHandler  )
HANDLER ( OTG_FS_WKUP_IRQHandler  )
HANDLER ( RTC_Alarm_IRQHandler  )
HANDLER ( USB_WKUP_IRQHandler  )
HANDLER ( TIM8_UP_TIM13_IRQHandler  )
HANDLER ( TIM8_BRK_IRQHandler  )
HANDLER ( TIM8_UP_IRQHandler  )
HANDLER ( TIM8_TRG_COM_IRQHandler  )
HANDLER ( DMA1_Stream7_IRQHandler  )
HANDLER ( FSMC_IRQHandler  )
HANDLER ( TIM8_CC_IRQHandler  )
HANDLER ( SDIO_IRQHandler  )
HANDLER ( ADC3_IRQHandler  )
HANDLER ( TIM5_IRQHandler  )
HANDLER ( SPI3_IRQHandler  )
HANDLER ( UART4_EXTI34_IRQHandler  )
HANDLER ( USART4_IRQHandler  )
HANDLER ( UART5_EXTI35_IRQHandler  )
HANDLER ( USART5_IRQHandler  )
HANDLER ( TIM6_DAC_IRQHandler  )
HANDLER ( TIM7_IRQHandler  )
HANDLER ( DMA2_Channel1_IRQHandler  )
HANDLER ( DMA2_Stream0_IRQHandler  )
HANDLER ( DMA2_Channel2_IRQHandler  )
HANDLER ( DMA2_Stream1_IRQHandler  )
HANDLER ( DMA2_Channel3_IRQHandler  )
HANDLER ( DMA2_Stream2_IRQHandler  )
HANDLER ( DMA2_Channel4_IRQHandler  )
HANDLER ( DMA2_Stream3_IRQHandler  )
HANDLER ( DMA2_Channel5_IRQHandler  )
HANDLER ( DMA2_Stream4_IRQHandler  )
HANDLER ( ADC4_IRQHandler  )
HANDLER ( ETH_IRQHandler  )
HANDLER ( COMP1_2_3_IRQHandler  )
HANDLER ( COMP4_5_6_IRQHandler  )
HANDLER ( ETH_WKUP_IRQHandler  )
HANDLER ( CAN2_TX_IRQHandler  )
HANDLER ( COMP7_IRQHandler  )
HANDLER ( CAN2_RX0_IRQHandler  )
HANDLER ( USB_HP_IRQHandler  )
HANDLER ( CAN2_RX1_IRQHandler  )
HANDLER ( USB_LP_IRQHandler  )
HANDLER ( USB_WKUP_RMP_IRQHandler  )
HANDLER ( CAN2_SCE_IRQHandler  )
HANDLER ( OTG_FS_IRQHandler  )
HANDLER ( FPU_IRQHandler  )
HANDLER ( DMA2_Stream5_IRQHandler  )
HANDLER ( DMA2_Stream6_IRQHandler  )
HANDLER ( DMA2_Stream7_IRQHandler  )
HANDLER ( USART6_IRQHandler  )
HANDLER ( I2C3_EV_IRQHandler  )
HANDLER ( I2C3_ER_IRQHandler  )
HANDLER ( OTG_HS_EP1_IN_IRQHandler  )
HANDLER ( OTG_HS_WKUP_IRQHandler  )
HANDLER ( NMI_Handler  )
HANDLER ( OTG_HS_IRQHandler  )
HANDLER ( HardFault_Handler  )
HANDLER ( DCMI_IRQHandler  )
HANDLER ( MemManage_Handler  )
HANDLER ( CRYP_IRQHandler  )
HANDLER ( BusFault_Handler  )
HANDLER ( HASH_RNG_IRQHandler  )
HANDLER ( UsageFault_Handler  )
HANDLER ( DebugMon_Handler  )
int main ( void  )

CortexM3 CPU vectors

Definition at line 33 of file startup.c.

void PIOS_DAC_dma_interrupt_handler ( dac_dev_t  dev)

Handles a DMA completion interrupt on dma_stream.

Parameters
[in]devDAC device handle
int PIOS_DAC_init ( dac_dev_t dev_out,
const struct pios_dac_cfg cfg 
)

Allocate and initialise DAC device.

Parameters
[out]dev_outDevice handle, only valid when return value is success
[in]cfgConfiguration structure
Return values
0on success, else failure
bool PIOS_DAC_install_callback ( dac_dev_t  dev,
uint8_t  priority,
fill_dma_cb  cb,
void *  ctx 
)

Installs a DAC sample-generating callback. Also starts DMA if necessary.

Parameters
[in]devA DAC device
[in]priorityThe priority for this callback; higher numbers prevail.
[in]cbThe callback function.
[in]ctxAn optional context pointer provided to the callback function.
Return values
trueif the callback was installed, false if a higher prio is running.
void PIOS_MAX7456_clear ( max7456_dev_t  dev)

Clear the screen.

Parameters
[in]devThe max7456 device handle
void PIOS_MAX7456_download_char ( max7456_dev_t  dev,
uint8_t  char_index,
uint8_t *  data 
)

Download a character from the device.

Parameters
[in]devThe max7456 device handle
[in]char_indexThe index of the character memory to retrieve
[out]data54 bytes of memory (18x12x2 bpp) filled with the character.
void PIOS_MAX7456_get_extents ( max7456_dev_t  dev,
uint8_t *  mode,
uint8_t *  right,
uint8_t *  bottom,
uint8_t *  hcenter,
uint8_t *  vcenter 
)

Gets the extents of the screen.

Parameters
[in]devThe max7456 device handle
[out]modeVideo mode– MAX7456_MODE_PAL or MAX7456_MODE_NTSC
[out]rightA screen coordinate
[out]bottomA screen coordinate
[out]hcenterHorizontal center of the screen
[out]vcenterVertical center of the screen
int PIOS_MAX7456_init ( max7456_dev_t dev_out,
pios_spi_t  spi_handle,
uint32_t  slave_idx 
)

Allocate and initialise MAX7456 device.

Parameters
[out]dev_outDevice handle, only valid when return value is success
[in]spi_devSPI device driver handle for communication with MAX7456
[in]spi_slaveSPI slave number
Return values
0on success, else failure
void PIOS_MAX7456_put ( max7456_dev_t  dev,
uint8_t  col,
uint8_t  row,
uint8_t  chr,
uint8_t  attr 
)

Sets a position of character memory.

Parameters
[in]devThe max7456 device handle
[in]colThe column to update
[in]rowThe row of the character to update
[in]chrThe character to store at this position
[in]attrAn attribute mask for this character.
void PIOS_MAX7456_puts ( max7456_dev_t  dev,
uint8_t  col,
uint8_t  row,
const char *  s,
uint8_t  attr 
)

Sets a string into character memory.

Parameters
[in]devThe max7456 device handle
[in]colThe column to begin the update at
[in]rowThe row of the character to update
[in]sThe string to store at this position
[in]attrAn attribute mask for this string
void PIOS_MAX7456_set_mode ( max7456_dev_t  dev,
bool  force,
uint8_t  fallback 
)

Allows overriding the video mode used by OSD.

Parameters
[in]devThe max7456 dev handle
[in]forceWhether to force the mode and skip autodetection.
[in]fallbackThe mode to select if autodetection fails or is skipped.
bool PIOS_MAX7456_stall_detect ( max7456_dev_t  dev)

Detects whether the OSD chip has stalled and attempts to restart it.

Parameters
[in]devThe max7456 device handle
Returns
true if the chip was detected to have stalled
void PIOS_MAX7456_upload_char ( max7456_dev_t  dev,
uint8_t  char_index,
const uint8_t *  data 
)

Upload a character to the device.

Parameters
[in]devThe max7456 device handle
[in]char_indexThe index of the character memory to update
[in]dataA pointer to 54 bytes of memory (18x12x2 bpp)
void PIOS_MAX7456_wait_vsync ( )
void PIOS_MAX7456_wait_vsync ( max7456_dev_t  dev)

Waits for vsync in a configuration-dependant way.

Parameters
[in]devThe max7456 device handle
static int print ( char **  out,
const char *  format,
va_list  args 
)
static

Definition at line 135 of file printf-stdarg.c.

static void printchar ( char **  str,
int  c 
)
static

Definition at line 40 of file printf-stdarg.c.

int printf ( const char *  format,
  ... 
)

Definition at line 201 of file printf-stdarg.c.

static int printi ( char **  out,
int  i,
int  b,
int  sg,
int  width,
int  pad,
int  letbase 
)
static

Definition at line 93 of file printf-stdarg.c.

static int prints ( char **  out,
const char *  string,
int  width,
int  pad 
)
static

Definition at line 56 of file printf-stdarg.c.

int snprintf ( char *  buf,
size_t  count,
const char *  format,
  ... 
)

Definition at line 231 of file printf-stdarg.c.

int sprintf ( char *  out,
const char *  format,
  ... 
)

Definition at line 215 of file printf-stdarg.c.

int vprintf ( const char *  format,
va_list  args 
)

Definition at line 210 of file printf-stdarg.c.

int vsprintf ( char *  out,
const char *  format,
va_list  args 
)

Definition at line 224 of file printf-stdarg.c.

Variable Documentation

TIM_TimeBaseInitTypeDef pios_dac_cfg::clock_cfg

Definition at line 44 of file pios_dac.h.

uint32_t pios_dac_cfg::dac_channel

Definition at line 54 of file pios_dac.h.

uintptr_t pios_dac_cfg::dac_outreg

Definition at line 56 of file pios_dac.h.

uint32_t pios_dac_cfg::dac_trigger

Definition at line 55 of file pios_dac.h.

uint32_t pios_dac_cfg::dma_channel

Definition at line 52 of file pios_dac.h.

DMA_Stream_TypeDef* pios_dac_cfg::dma_stream

Definition at line 51 of file pios_dac.h.

uint32_t pios_dac_cfg::dma_tcif

Definition at line 58 of file pios_dac.h.

GPIO_TypeDef* pios_dac_cfg::gpio

Definition at line 48 of file pios_dac.h.

uint16_t pios_dac_cfg::gpio_pin

Definition at line 49 of file pios_dac.h.

void** HARDFAULT_PSP

Default handler for CPU exceptions.

Definition at line 111 of file startup.c.

NVIC_InitTypeDef pios_dac_cfg::interrupt

Definition at line 46 of file pios_dac.h.

TIM_TypeDef* pios_dac_cfg::timer

Definition at line 43 of file pios_dac.h.