APM:Libraries
|
Board-specific pin information. More...
#include <hal.h>
#include <stm32f4xx_conf.h>
#include <hal_types.h>
#include <exti.h>
#include <gpio_hal.h>
#include <timer.h>
#include <adc.h>
#include <usart.h>
#include <pwm_in.h>
Go to the source code of this file.
Classes | |
struct | stm32_pin_info |
Stores STM32-specific information related to a given Maple pin. More... | |
Macros | |
#define | CLOCK_SPEED_MHZ CYCLES_PER_MICROSECOND |
#define | CLOCK_SPEED_HZ (CLOCK_SPEED_MHZ * 1000000UL) |
#define | BOOT_RTC_SIGNATURE 0xb007b007 |
#define | DFU_RTC_SIGNATURE 0xDEADBEEF |
#define | FORCE_APP_RTC_SIGNATURE 0x4000AbbA |
#define | DSM_BIND_SIGNATURE 0xD82B14D0 |
#define | DSM_BIND_SIGN_MASK 0xF |
#define | CONSOLE_PORT_SIGNATURE 0xC07501e0 |
#define | CONSOLE_PORT_MASK 0xF |
#define | MASS_STORAGE_SIGNATURE 0x5106a8ed |
#define | OVERCLOCK_SIGNATURE 0xFACED1A0 |
#define | OVERCLOCK_SIG_MASK 0xF |
#define | OV_GUARD_SIGNATURE 0xBABEFACE |
#define | OV_GUARD_FAIL_SIGNATURE 0xBABEFA17 |
#define | RTC_SIGNATURE_REG 0 |
#define | RTC_DSM_BIND_REG 1 |
#define | RTC_MASS_STORAGE_REG 2 |
#define | RTC_CONSOLE_REG 3 |
#define | RTC_OVERCLOCK_REG 4 |
#define | RTC_OV_GUARD_REG 5 |
#define | digitalPinToPort(P) ( PIN_MAP[P].gpio_device ) |
#define | digitalPinToBitMask(P) ( BIT(PIN_MAP[P].gpio_bit) ) |
#define | portOutputRegister(port) ( &(port->regs->ODR) ) |
#define | portInputRegister(port) ( &(port->regs->IDR) ) |
#define | portSetRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BSRR) ) |
#define | portClearRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->BRR) ) |
#define | portConfigRegister(pin) ( &(PIN_MAP[pin].gpio_device->regs->CRL) ) |
Typedefs | |
typedef struct stm32_pin_info | stm32_pin_info |
Stores STM32-specific information related to a given Maple pin. More... | |
Enumerations | |
enum | { D0 =0, D1, D2, D3, D4, D5, D6, D7, D8, D9, D10, D11, D12, D13, D14, D15, D16, D17, D18, D19, D20, D21, D22, D23, D24, D25, D26, D27, D28, D29, D30, D31, D32, D33, D34, D35, D36, D37, D38, D39, D40, D41, D42, D43, D44, D45, D46, D47, D48, D49, D50, D51, D52, D53, D54, D55, D56, D57, D58, D59, D60, D61, D62, D63, D64, D65, D66, D67, D68, D69, D70, D71, D72, D73, D74, D75, D76, D77, D78, D79, D80, D81, D82, D83, D84, D85, D86, D87, D88, D89, D90, D91, D92, D93, D94, D95, D96, D97, D98, D99, D100, D101, D102, D103, D104, D105, D106, D107, D108, D109, D110, D111 } |
enum | { PB10 =0, PB2 =1, PB12 =2, PB13 =3, PB14 =4, PB15 =5, PC0 =6, PC1 =7, PC2 =8, PC3 =9, PC4 =10, PC5 =11, PC6 =12, PC7 =13, PC8 =14, PC9 =15, PC10 =16, PC11 =17, PC12 =18, PC13 =19, PC14 =20, PC15 =21, PA8 =22, PA9 =23, PA10 =24, PB9 =25, PD2 =26, PD3 =27, PD6 =28, PG11 =29, PG12 =30, PG13 =31, PG14 =32, PG8 =33, PG7 =34, PG6 =35, PB5 =36, PB6 =37, PB7 =38, PF6 =39, PF7 =40, PF8 =41, PF9 =42, PF10 =43, PF11 =44, PB1 =45, PB0 =46, PA0 =47, PA1 =48, PA2 =49, PA3 =50, PA4 =51, PA5 =52, PA6 =53, PA7 =54, PF0 =55, PD11 =56, PD14 =57, PF1 =58, PD12 =59, PD15 =60, PF2 =61, PD13 =62, PD0 =63, PF3 =64, PE3 =65, PD1 =66, PF4 =67, PE4 =68, PE7 =69, PF5 =70, PE5 =71, PE8 =72, PF12 =73, PE6 =74, PE9 =75, PF13 =76, PE10 =77, PF14 =78, PG9 =79, PE11 =80, PF15 =81, PG10 =82, PE12 =83, PG0 =84, PD5 =85, PE13 =86, PG1 =87, PD4 =88, PE14 =89, PG2 =90, PE1 =91, PE15 =92, PG3 =93, PE0 =94, PD8 =95, PG4 =96, PD9 =97, PG5 =98, PD10 =99, PB11 =100, PB8 =101, PE2 =102, PA15 =103, PB3 =104, PB4 =105, PA13 =106, PA14 =107, PA11 =108 } |
Functions | |
void | init (void) |
Generic board initialization function. More... | |
void | boardInit (void) |
Board-specific initialization function. More... | |
void | pre_init (void) |
void | board_set_rtc_register (uint32_t sig, uint16_t reg) |
uint32_t | board_get_rtc_register (uint16_t reg) |
static void | goDFU () |
static bool | is_bare_metal () |
void | NMI_Handler () |
void | emerg_delay (uint32_t n) |
void | SetSysClock (uint8_t oc) |
Configures the System clock source, PLL Multiplier and Divider factors, AHB/APBx prescalers and Flash settings This function should be called only once the RCC clock configuration is reset to the default reset state (done in systemInit() function). More... | |
void | clock_gettime (uint32_t mode, void *ptr) |
void | systemInit (uint8_t oc) |
Setup the microcontroller system Initialize the Embedded Flash Interface, the PLL and update the SystemFrequency variable. More... | |
Variables | |
const stm32_pin_info | PIN_MAP [] |
Maps each Maple pin to a corresponding stm32_pin_info. More... | |
unsigned | __isr_vector_start |
voidFuncPtr | boardEmergencyHandler |
Board-specific pin information.
(c) 2017 night _gho st@yk octp a.ru
based on:
To add a new board type, add a new pair of files to /wirish/boards/, update the section below with a new "BOARD" type, and update /wirish/rules.mk to include your boards/your_board.cpp file in the top-level Makefile build.
Definition in file boards.h.
#define BOOT_RTC_SIGNATURE 0xb007b007 |
Definition at line 291 of file boards.h.
Referenced by F4Light::Scheduler::_reboot().
#define CLOCK_SPEED_HZ (CLOCK_SPEED_MHZ * 1000000UL) |
#define CLOCK_SPEED_MHZ CYCLES_PER_MICROSECOND |
#define CONSOLE_PORT_MASK 0xF |
Definition at line 300 of file boards.h.
Referenced by HAL_F4Light::HAL_F4Light(), and HAL_F4Light::lateInit().
#define CONSOLE_PORT_SIGNATURE 0xC07501e0 |
Definition at line 299 of file boards.h.
Referenced by HAL_F4Light::HAL_F4Light(), and HAL_F4Light::lateInit().
#define DFU_RTC_SIGNATURE 0xDEADBEEF |
Definition at line 292 of file boards.h.
Referenced by F4Light::Scheduler::_reboot(), init(), and VCP_DataRx().
#define DSM_BIND_SIGN_MASK 0xF |
Definition at line 297 of file boards.h.
Referenced by F4Light::DSM_parser::init().
#define DSM_BIND_SIGNATURE 0xD82B14D0 |
Definition at line 296 of file boards.h.
Referenced by F4Light::DSM_parser::init().
#define FORCE_APP_RTC_SIGNATURE 0x4000AbbA |
Definition at line 293 of file boards.h.
Referenced by F4Light::Scheduler::_try_kill_task_or_reboot(), and HAL_F4Light::lateInit().
#define MASS_STORAGE_SIGNATURE 0x5106a8ed |
Definition at line 303 of file boards.h.
Referenced by HAL_F4Light::lateInit(), and HAL_F4Light::run().
#define OV_GUARD_FAIL_SIGNATURE 0xBABEFA17 |
Definition at line 309 of file boards.h.
Referenced by init(), and HAL_F4Light::lateInit().
#define OV_GUARD_SIGNATURE 0xBABEFACE |
#define OVERCLOCK_SIG_MASK 0xF |
Definition at line 307 of file boards.h.
Referenced by init(), and HAL_F4Light::lateInit().
#define OVERCLOCK_SIGNATURE 0xFACED1A0 |
Definition at line 306 of file boards.h.
Referenced by init(), and HAL_F4Light::lateInit().
#define RTC_CONSOLE_REG 3 |
Definition at line 315 of file boards.h.
Referenced by HAL_F4Light::HAL_F4Light(), and HAL_F4Light::lateInit().
#define RTC_DSM_BIND_REG 1 |
Definition at line 313 of file boards.h.
Referenced by F4Light::DSM_parser::init().
#define RTC_MASS_STORAGE_REG 2 |
Definition at line 314 of file boards.h.
Referenced by HAL_F4Light::lateInit(), and HAL_F4Light::run().
#define RTC_OV_GUARD_REG 5 |
Definition at line 317 of file boards.h.
Referenced by init(), and HAL_F4Light::lateInit().
#define RTC_OVERCLOCK_REG 4 |
Definition at line 316 of file boards.h.
Referenced by init(), and HAL_F4Light::lateInit().
#define RTC_SIGNATURE_REG 0 |
Definition at line 312 of file boards.h.
Referenced by F4Light::Scheduler::_reboot(), F4Light::Scheduler::_try_kill_task_or_reboot(), init(), HAL_F4Light::lateInit(), F4Light::Scheduler::system_initialized(), and VCP_DataRx().
typedef struct stm32_pin_info stm32_pin_info |
Stores STM32-specific information related to a given Maple pin.
anonymous enum |
anonymous enum |
uint32_t board_get_rtc_register | ( | uint16_t | reg | ) |
Definition at line 151 of file boards.cpp.
Referenced by HAL_F4Light::HAL_F4Light(), F4Light::DSM_parser::init(), init(), HAL_F4Light::lateInit(), and HAL_F4Light::run().
void board_set_rtc_register | ( | uint32_t | sig, |
uint16_t | reg | ||
) |
Definition at line 141 of file boards.cpp.
Referenced by F4Light::Scheduler::_reboot(), F4Light::Scheduler::_try_kill_task_or_reboot(), F4Light::DSM_parser::init(), init(), HAL_F4Light::lateInit(), HAL_F4Light::run(), F4Light::Scheduler::system_initialized(), and VCP_DataRx().
void boardInit | ( | void | ) |
Board-specific initialization function.
This function is called from init() after all generic board initialization has been performed. Each board is required to define its own.
Board-specific initialization function.
Definition at line 118 of file board.c.
Referenced by init().
void clock_gettime | ( | uint32_t | mode, |
void * | ptr | ||
) |
Definition at line 201 of file syscalls.c.
Referenced by is_bare_metal().
void emerg_delay | ( | uint32_t | n | ) |
Definition at line 257 of file boards.cpp.
Referenced by is_bare_metal(), and NMI_Handler().
|
inlinestatic |
|
inline |
Generic board initialization function.
This function is called before main(). It ensures that the clocks and peripherals are configured properly for use with wirish, then calls boardInit().
Definition at line 136 of file system.cpp.
Referenced by HALSITL::AnalogIn::AnalogIn(), PX4::PX4_I2C::do_transfer(), VRBRAIN::VRBRAIN_I2C::do_transfer(), Linux::GPIO_Sysfs::from(), Linux::RCOutput_Bebop::from(), F4Light::I2CDevice::get_device(), Linux::CANManager::getNumIfaces(), AP_HAL::GPIO::GPIO(), AP_HAL::HAL::HAL(), pre_init(), PX4::PX4CAN::PX4CAN(), HAL_Linux::run(), and VRBRAIN::VRBRAINCAN::VRBRAINCAN().
|
inlinestatic |
Definition at line 149 of file boards.h.
Referenced by F4Light::Scheduler::_reboot(), goDFU(), and VCP_DataRx().
void NMI_Handler | ( | ) |
Definition at line 45 of file system.cpp.
Referenced by __cxa_pure_virtual(), and is_bare_metal().
void pre_init | ( | void | ) |
unsigned __isr_vector_start |
Referenced by goDFU(), and systemInit().
voidFuncPtr boardEmergencyHandler |
Referenced by is_bare_metal().
const stm32_pin_info PIN_MAP[] |
Maps each Maple pin to a corresponding stm32_pin_info.