chibios hal config for F4BY

This commit is contained in:
kozinalexey 2018-03-22 15:43:45 +03:00 committed by Andrew Tridgell
parent cafa5382e9
commit 5df2b1a3ac
3 changed files with 917 additions and 0 deletions

View File

@ -72,6 +72,7 @@
#define HAL_BOARD_SUBTYPE_CHIBIOS_CRAZYFLIE2 5007
#define HAL_BOARD_SUBTYPE_CHIBIOS_OMNIBUSF7V2 5008
#define HAL_BOARD_SUBTYPE_CHIBIOS_GENERIC 5009
#define HAL_BOARD_SUBTYPE_CHIBIOS_F4BY 5010
/* InertialSensor driver types */
#define HAL_INS_NONE 0

View File

@ -0,0 +1,194 @@
# hw definition file for processing by chibios_hwdef.py
# for F4BY v2.1.5 board description http://swift-flyer.com/?page_id=83
# MCU class and specific type
MCU STM32F4xx STM32F407xx
# is not declared chibios_hwdef.py for 407
define def_ccm_size 64
#default 256 NO WORK WITH DISPLAY SSD1306 CONNECTED and compass internal calibration
#use auto calculation stack size for interrupt by os
define PORT_INT_REQUIRED_STACK 0
# board ID for firmware load
APJ_BOARD_ID 20
define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_F4BY
# define AP_FEATURE_BOARD_DETECT 1
# USB setup
USB_VENDOR 0x27AC # Swift-Flyer
USB_PRODUCT 0x0201 # fmu usb driver
USB_STRING_MANUFACTURER "Swift-Flyer"
USB_STRING_PRODUCT "%BOARD%"
USB_STRING_SERIAL "%SERIAL%"
FLASH_SIZE_KB 1024
# crystal frequency
OSCILLATOR_HZ 8000000
STM32_PLLM_VALUE 8
# board voltage
STM32_VDD 330U
# this is the STM32 timer that ChibiOS will use for the low level
# driver. This must be a 32 bit timer. We currently only support
# timers 2, 3, 4, 5 and 21. See hal_st_lld.c in ChibiOS for details
# ChibiOS system timer
STM32_ST_USE_TIMER 5
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
# the normal usage of this ordering is:
# 1) SERIAL0: console (primary mavlink, usually USB)
# 2) SERIAL3: primary GPS
# 3) SERIAL1: telem1
# 4) SERIAL2: telem2
# 5) SERIAL4: GPS2
# 6) SERIAL5: extra UART (usually RTOS debug console)
STDOUT_SERIAL SD2
STDOUT_BAUDRATE 57600
# this is the pin that senses USB being connected. It is an input pin
# setup as OPENDRAIN
PA9 VBUS INPUT OPENDRAIN
# order of UARTs (and USB) 2 3 4 5 NODMA
# UART_ORDER OTG1 USART1
# UART4
UART_ORDER OTG1 USART3 USART2 USART1
# UART1 as board 2.1.5 for serial 3 gps
PB6 USART1_TX USART1
PB7 USART1_RX USART1
# USART2 serial2 telem2
PD5 USART2_TX USART2 NODMA
PD6 USART2_RX USART2
# USART3 serial3 telem1
PD8 USART3_TX USART3 NODMA
PD9 USART3_RX USART3
PC10 UART4_TX UART4 NODMA
PC11 UART4_RX UART4
# SHARE dma with I2C2_TX
PC12 UART5_TX UART5 NODMA
PD2 UART5_RX UART5 NODMA
define HAL_STORAGE_SIZE 16384
define STORAGE_FLASH_PAGE 22
define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI
#SPI1 for MPU
PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1
PA4 MPU_CS CS
# spi bus for dataflash AND SD
PB13 SPI2_SCK SPI2
PB14 SPI2_MISO SPI2
PB15 SPI2_MOSI SPI2
PB12 FRAM_CS CS SPEED_VERYLOW
PE15 FLASH_CS CS
SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ
SPIDEV ramtron SPI2 DEVID10 FRAM_CS MODE3 8*MHZ 8*MHZ
SPIDEV dataflash SPI2 DEVID1 FLASH_CS MODE3 1*MHZ 8*MHZ
# enable RAMTROM parameter storage
define HAL_WITH_RAMTRON 1
# enable FAT filesystem support (needs a microSD defined via SDIO)
# define HAL_OS_FATFS_IO 1
# now some defines for logging and terrain data files NO WORK WITHOUT FAT
# define HAL_BOARD_LOG_DIRECTORY "/APM/LOGS"
# define HAL_BOARD_TERRAIN_DIRECTORY "/APM/TERRAIN"
# this defines the default maximum clock on I2C devices.
define HAL_I2C_MAX_CLOCK 100000
I2C_ORDER I2C2 I2C1
PB8 I2C1_SCL I2C1
PB9 I2C1_SDA I2C1
PB10 I2C2_SCL I2C2
PB11 I2C2_SDA I2C2
define HAL_BARO_DEFAULT HAL_BARO_MS5611_I2C
define HAL_BARO_MS5611_I2C_BUS 0
define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
define HAL_COMPASS_HMC5843_I2C_BUS 0
define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_270
define HAL_EXT_COMPASS_HMC5843_I2C_BUS 1
# PWM out pins
PA0 TIM2_CH1 TIM2 PWM(1)
PA1 TIM2_CH2 TIM2 PWM(2)
PA2 TIM2_CH3 TIM2 PWM(3)
PA3 TIM2_CH4 TIM2 PWM(4)
PE9 TIM1_CH1 TIM1 PWM(5)
PE11 TIM1_CH2 TIM1 PWM(6)
PE13 TIM1_CH3 TIM1 PWM(7)
PE14 TIM1_CH4 TIM1 PWM(8)
PD13 TIM4_CH2 TIM4 PWM(9)
PD12 TIM4_CH1 TIM4 PWM(10)
PD15 TIM4_CH4 TIM4 PWM(11)
PD14 TIM4_CH3 TIM4 PWM(12)
# also USART6_RX for serial RC
PC7 TIM8_CH2 TIM8 RCIN PULLUP LOW DMA_CH0
# LED setup is similar to PixRacer
define HAL_HAVE_PIXRACER_LED
PE3 LED_RED OUTPUT GPIO(10)
PE2 LED_GREEN OUTPUT GPIO(11)
PE1 LED_BLUE OUTPUT GPIO(12)
PE0 LED_YELOW OUTPUT GPIO(13)
define HAL_GPIO_A_LED_PIN 10
define HAL_GPIO_B_LED_PIN 11
define HAL_GPIO_C_LED_PIN 12
define HAL_GPIO_LED_ON 0
define HAL_GPIO_LED_OFF 1
PC0 PRESSURE_SENS ADC1 SCALE(1)
PC1 RSSI_IN ADC1
PC2 BATT_CURRENT_SENS ADC1 SCALE(2)
PC3 BATT_VOLTAGE_SENS ADC1 SCALE(2)
PC4 VDD_5V_SENS ADC1 SCALE(2)
PC5 FMU_SERVORAIL_VCC_SENS ADC1 SCALE(2)
PE5 TIM9_CH1 TIM9 ALARM
PC14 EXTERN_GPIO1 GPIO(1)
PC13 EXTERN_GPIO2 GPIO(2)
PE4 EXTERN_GPIO3 GPIO(3)
PE6 EXTERN_GPIO4 GPIO(4)
PC9 EXTERN_GPIO5 GPIO(5)
# IRQ for MPU6000
PB0 EXTI_MPU6000 INPUT PULLUP
PB1 DRDY_HMC5883 INPUT PULLUP
define AP_FEATURE_BRD_PWM_COUNT_PARAM 1
define BOARD_PWM_COUNT_DEFAULT 12

View File

@ -0,0 +1,722 @@
#!/usr/bin/env python
'''
for STM32F407
STM32F407X vs STM32F42XX is not supported:
SAI1 SPI4 SPI5 SPI6
http://www.st.com/content/ccc/resource/technical/document/reference_manual/3d/6d/5a/66/b4/99/40/d4/DM00031020.pdf/files/DM00031020.pdf/jcr:content/translations/en.DM00031020.pdf
pages 307-308 dma table
'''
DMA_Map = {
# format is [DMA_TABLE, StreamNum]
# extracted from tabula-STM324x7-306.csv and tabula-STM324x7-307.csv
"ADC1" : [(2,0),(2,4)],
"ADC2" : [(2,2),(2,3)],
"ADC3" : [(2,0),(2,1)],
"CRYP_IN" : [(2,6)],
"CRYP_OUT" : [(2,5)],
"DAC1" : [(1,5)],
"DAC2" : [(1,6)],
"DCMI" : [(2,1),(2,7)],
"HASH_IN" : [(2,7)],
"I2C1_RX" : [(1,0),(1,5)],
"I2C1_TX" : [(1,6),(1,7)],
"I2C2_RX" : [(1,2),(1,3)],
"I2C2_TX" : [(1,7)],
"I2C3_RX" : [(1,2)],
"I2C3_TX" : [(1,4)],
"I2S2_EXT_RX" : [(1,3)],
"I2S2_EXT_TX" : [(1,4)],
"I2S3_EXT_RX" : [(1,2),(1,0)],
"I2S3_EXT_TX" : [(1,5)],
"SDIO" : [(2,3),(2,6)],
"SPI1_RX" : [(2,0),(2,2)],
"SPI1_TX" : [(2,3),(2,5)],
"SPI2_RX" : [(1,3)],
"SPI2_TX" : [(1,4)],
"SPI3_RX" : [(1,0),(1,2)],
"SPI3_TX" : [(1,5),(1,7)],
"TIM1_CH1" : [(2,6),(2,1),(2,3)],
"TIM1_CH2" : [(2,6),(2,2)],
"TIM1_CH3" : [(2,6),(2,6)],
"TIM1_CH4" : [(2,4)],
"TIM1_COM" : [(2,4)],
"TIM1_TRIG" : [(2,0),(2,4)],
"TIM1_UP" : [(2,5)],
"TIM2_CH1" : [(1,5)],
"TIM2_CH2" : [(1,6)],
"TIM2_CH3" : [(1,1)],
"TIM2_CH4" : [(1,6),(1,7)],
"TIM2_UP" : [(1,1),(1,7)],
"TIM3_CH1" : [(1,4)],
"TIM3_CH2" : [(1,5)],
"TIM3_CH3" : [(1,7)],
"TIM3_CH4" : [(1,2)],
"TIM3_TRIG" : [(1,4)],
"TIM3_UP" : [(1,2)],
"TIM4_CH1" : [(1,0)],
"TIM4_CH2" : [(1,3)],
"TIM4_CH3" : [(1,7)],
"TIM4_UP" : [(1,6)],
"TIM5_CH1" : [(1,2)],
"TIM5_CH2" : [(1,4)],
"TIM5_CH3" : [(1,0)],
"TIM5_CH4" : [(1,1),(1,3)],
"TIM5_TRIG" : [(1,1),(1,3)],
"TIM5_UP" : [(1,0),(1,6)],
"TIM6_UP" : [(1,1)],
"TIM7_UP" : [(1,2),(1,4)],
"TIM8_CH1" : [(2,2),(2,2)],
"TIM8_CH2" : [(2,2),(2,3)],
"TIM8_CH3" : [(2,2),(2,4)],
"TIM8_CH4" : [(2,7)],
"TIM8_COM" : [(2,7)],
"TIM8_TRIG" : [(2,7)],
"TIM8_UP" : [(2,1)],
"UART4_RX" : [(1,2)],
"UART4_TX" : [(1,4)],
"UART5_RX" : [(1,0)],
"UART5_TX" : [(1,7)],
"USART1_RX" : [(2,2),(2,5)],
"USART1_TX" : [(2,7)],
"USART2_RX" : [(1,5)],
"USART2_TX" : [(1,6)],
"USART3_RX" : [(1,1)],
"USART3_TX" : [(1,3),(1,4)],
"USART6_RX" : [(2,1),(2,2)],
"USART6_TX" : [(2,6),(2,7)],
}
AltFunction_map = {
# format is PIN:FUNCTION : AFNUM
# extracted from tabula-AF-F427.csv
"PA0:ETH_MII_CRS" : 11,
"PA0:EVENTOUT" : 15,
"PA0:TIM2_CH1" : 1,
"PA0:TIM2_ETR" : 1,
"PA0:TIM5_CH1" : 2,
"PA0:TIM8_ETR" : 3,
"PA0:UART4_TX" : 8,
"PA0:USART2_CTS" : 7,
"PA10:DCMI_D1" : 13,
"PA10:EVENTOUT" : 15,
"PA10:OTG_FS_ID" : 10,
"PA10:TIM1_CH3" : 1,
"PA10:USART1_RX" : 7,
"PA11:CAN1_RX" : 9,
"PA11:EVENTOUT" : 15,
"PA11:LCD_R4" : 14,
"PA11:OTG_FS_DM" : 10,
"PA11:TIM1_CH4" : 1,
"PA11:USART1_CTS" : 7,
"PA12:CAN1_TX" : 9,
"PA12:EVENTOUT" : 15,
"PA12:LCD_R5" : 14,
"PA12:OTG_FS_DP" : 10,
"PA12:TIM1_ETR" : 1,
"PA12:USART1_RTS" : 7,
"PA13:EVENTOUT" : 15,
"PA13:JTMS-SWDIO" : 0,
"PA14:EVENTOUT" : 15,
"PA14:JTCK-SWCLK" : 0,
"PA15:EVENTOUT" : 15,
"PA15:I2S3_WS" : 6,
"PA15:JTDI" : 0,
"PA15:SPI1_NSS" : 5,
"PA15:SPI3_NSS" : 6,
"PA15:TIM2_CH1" : 1,
"PA15:TIM2_ETR" : 1,
"PA1:ETH_MII_RX_CLK" : 11,
"PA1:ETH_RMII_REF_CLK" : 11,
"PA1:EVENTOUT" : 15,
"PA1:TIM2_CH2" : 1,
"PA1:TIM5_CH2" : 2,
"PA1:UART4_RX" : 8,
"PA1:USART2_RTS" : 7,
"PA2:ETH_MDIO" : 11,
"PA2:EVENTOUT" : 15,
"PA2:TIM2_CH3" : 1,
"PA2:TIM5_CH3" : 2,
"PA2:TIM9_CH1" : 3,
"PA2:USART2_TX" : 7,
"PA3:ETH_MII_COL" : 11,
"PA3:EVENTOUT" : 15,
"PA3:LCD_B5" : 14,
"PA3:OTG_HS_ULPI_D0" : 10,
"PA3:TIM2_CH4" : 1,
"PA3:TIM5_CH4" : 2,
"PA3:TIM9_CH2" : 3,
"PA3:USART2_RX" : 7,
"PA4:DCMI_HSYNC" : 13,
"PA4:EVENTOUT" : 15,
"PA4:I2S3_WS" : 6,
"PA4:LCD_VSYNC" : 14,
"PA4:OTG_HS_SOF" : 12,
"PA4:SPI1_NSS" : 5,
"PA4:SPI3_NSS" : 6,
"PA4:USART2_CK" : 7,
"PA5:EVENTOUT" : 15,
"PA5:OTG_HS_ULPI_CK" : 10,
"PA5:SPI1_SCK" : 5,
"PA5:TIM2_CH1" : 1,
"PA5:TIM2_ETR" : 1,
"PA5:TIM8_CH1N" : 3,
"PA6:DCMI_PIXCLK" : 13,
"PA6:EVENTOUT" : 15,
"PA6:LCD_G2" : 14,
"PA6:SPI1_MISO" : 5,
"PA6:TIM13_CH1" : 9,
"PA6:TIM1_BKIN" : 1,
"PA6:TIM3_CH1" : 2,
"PA6:TIM8_BKIN" : 3,
"PA7:ETH_MII_RX_DV" : 11,
"PA7:ETH_RMII_CRS_DV" : 11,
"PA7:EVENTOUT" : 15,
"PA7:SPI1_MOSI" : 5,
"PA7:TIM14_CH1" : 9,
"PA7:TIM1_CH1N" : 1,
"PA7:TIM3_CH2" : 2,
"PA7:TIM8_CH1N" : 3,
"PA8:EVENTOUT" : 15,
"PA8:I2C3_SCL" : 4,
"PA8:LCD_R6" : 14,
"PA8:MCO1" : 0,
"PA8:OTG_FS_SOF" : 10,
"PA8:TIM1_CH1" : 1,
"PA8:USART1_CK" : 7,
"PA9:DCMI_D0" : 13,
"PA9:EVENTOUT" : 15,
"PA9:I2C3_SMBA" : 4,
"PA9:TIM1_CH2" : 1,
"PA9:USART1_TX" : 7,
"PB0:ETH_MII_RXD2" : 11,
"PB0:EVENTOUT" : 15,
"PB0:LCD_R3" : 9,
"PB0:OTG_HS_ULPI_D1" : 10,
"PB0:TIM1_CH2N" : 1,
"PB0:TIM3_CH3" : 2,
"PB0:TIM8_CH2N" : 3,
"PB10:ETH_MII_RX_ER" : 11,
"PB10:EVENTOUT" : 15,
"PB10:I2C2_SCL" : 4,
"PB10:I2S2_CK" : 5,
"PB10:LCD_G4" : 14,
"PB10:OTG_HS_ULPI_D3" : 10,
"PB10:SPI2_SCK" : 5,
"PB10:TIM2_CH3" : 1,
"PB10:USART3_TX" : 7,
"PB11:ETH_MII_TX_EN" : 11,
"PB11:ETH_RMII_TX_EN" : 11,
"PB11:EVENTOUT" : 15,
"PB11:I2C2_SDA" : 4,
"PB11:LCD_G5" : 14,
"PB11:OTG_HS_ULPI_D4" : 10,
"PB11:TIM2_CH4" : 1,
"PB11:USART3_RX" : 7,
"PB12:CAN2_RX" : 9,
"PB12:ETH_MII_TXD0" : 11,
"PB12:ETH_RMII_TXD0" : 11,
"PB12:EVENTOUT" : 15,
"PB12:I2C2_SMBA" : 4,
"PB12:I2S2_WS" : 5,
"PB12:OTG_HS_ID" : 12,
"PB12:OTG_HS_ULPI_D5" : 10,
"PB12:SPI2_NSS" : 5,
"PB12:TIM1_BKIN" : 1,
"PB12:USART3_CK" : 7,
"PB13:CAN2_TX" : 9,
"PB13:ETH_MII_TXD1" : 11,
"PB13:ETH_RMII_TXD1" : 11,
"PB13:EVENTOUT" : 15,
"PB13:I2S2_CK" : 5,
"PB13:OTG_HS_ULPI_D6" : 10,
"PB13:SPI2_SCK" : 5,
"PB13:TIM1_CH1N" : 1,
"PB13:USART3_CTS" : 7,
"PB14:EVENTOUT" : 15,
"PB14:I2S2EXT_SD" : 6,
"PB14:OTG_HS_DM" : 12,
"PB14:SPI2_MISO" : 5,
"PB14:TIM12_CH1" : 9,
"PB14:TIM1_CH2N" : 1,
"PB14:TIM8_CH2N" : 3,
"PB14:USART3_RTS" : 7,
"PB15:EVENTOUT" : 15,
"PB15:I2S2_SD" : 5,
"PB15:OTG_HS_DP" : 12,
"PB15:RTC_REFIN" : 0,
"PB15:SPI2_MOSI" : 5,
"PB15:TIM12_CH2" : 9,
"PB15:TIM1_CH3N" : 1,
"PB15:TIM8_CH3N" : 3,
"PB1:ETH_MII_RXD3" : 11,
"PB1:EVENTOUT" : 15,
"PB1:LCD_R6" : 9,
"PB1:OTG_HS_ULPI_D2" : 10,
"PB1:TIM1_CH3N" : 1,
"PB1:TIM3_CH4" : 2,
"PB1:TIM8_CH3N" : 3,
"PB2:EVENTOUT" : 15,
"PB3:EVENTOUT" : 15,
"PB3:I2S3_CK" : 6,
"PB3:JTDO" : 0,
"PB3:SPI1_SCK" : 5,
"PB3:SPI3_SCK" : 6,
"PB3:TIM2_CH2" : 1,
"PB3:TRACESWO" : 0,
"PB4:EVENTOUT" : 15,
"PB4:I2S3EXT_SD" : 7,
"PB4:NJTRST" : 0,
"PB4:SPI1_MISO" : 5,
"PB4:SPI3_MISO" : 6,
"PB4:TIM3_CH1" : 2,
"PB5:CAN2_RX" : 9,
"PB5:DCMI_D10" : 13,
"PB5:ETH_PPS_OUT" : 11,
"PB5:EVENTOUT" : 15,
"PB5:FMC_SDCKE1" : 12,
"PB5:I2C1_SMBA" : 4,
"PB5:I2S3_SD" : 6,
"PB5:OTG_HS_ULPI_D7" : 10,
"PB5:SPI1_MOSI" : 5,
"PB5:SPI3_MOSI" : 6,
"PB5:TIM3_CH2" : 2,
"PB6:CAN2_TX" : 9,
"PB6:DCMI_D5" : 13,
"PB6:EVENTOUT" : 15,
"PB6:FMC_SDNE1" : 12,
"PB6:I2C1_SCL" : 4,
"PB6:TIM4_CH1" : 2,
"PB6:USART1_TX" : 7,
"PB7:DCMI_VSYNC" : 13,
"PB7:EVENTOUT" : 15,
"PB7:FMC_NL" : 12,
"PB7:I2C1_SDA" : 4,
"PB7:TIM4_CH2" : 2,
"PB7:USART1_RX" : 7,
"PB8:CAN1_RX" : 9,
"PB8:DCMI_D6" : 13,
"PB8:ETH_MII_TXD3" : 11,
"PB8:EVENTOUT" : 15,
"PB8:I2C1_SCL" : 4,
"PB8:LCD_B6" : 14,
"PB8:SDIO_D4" : 12,
"PB8:TIM10_CH1" : 3,
"PB8:TIM4_CH3" : 2,
"PB9:CAN1_TX" : 9,
"PB9:DCMI_D7" : 13,
"PB9:EVENTOUT" : 15,
"PB9:I2C1_SDA" : 4,
"PB9:I2S2_WS" : 5,
"PB9:LCD_B7" : 14,
"PB9:SDIO_D5" : 12,
"PB9:SPI2_NSS" : 5,
"PB9:TIM11_CH1" : 3,
"PB9:TIM4_CH4" : 2,
"PC0:EVENTOUT" : 15,
"PC0:FMC_SDNWE" : 12,
"PC0:OTG_HS_ULPI_STP" : 10,
"PC10:DCMI_D8" : 13,
"PC10:EVENTOUT" : 15,
"PC10:I2S3_CK" : 6,
"PC10:LCD_R2" : 14,
"PC10:SDIO_D2" : 12,
"PC10:SPI3_SCK" : 6,
"PC10:UART4_TX" : 8,
"PC10:USART3_TX" : 7,
"PC11:DCMI_D4" : 13,
"PC11:EVENTOUT" : 15,
"PC11:I2S3EXT_SD" : 5,
"PC11:SDIO_D3" : 12,
"PC11:SPI3_MISO" : 6,
"PC11:UART4_RX" : 8,
"PC11:USART3_RX" : 7,
"PC12:DCMI_D9" : 13,
"PC12:EVENTOUT" : 15,
"PC12:I2S3_SD" : 6,
"PC12:SDIO_CK" : 12,
"PC12:SPI3_MOSI" : 6,
"PC12:UART5_TX" : 8,
"PC12:USART3_CK" : 7,
"PC13:EVENTOUT" : 15,
"PC14:EVENTOUT" : 15,
"PC15:EVENTOUT" : 15,
"PC1:ETH_MDC" : 11,
"PC1:EVENTOUT" : 15,
"PC2:ETH_MII_TXD2" : 11,
"PC2:EVENTOUT" : 15,
"PC2:FMC_SDNE0" : 12,
"PC2:I2S2EXT_SD" : 6,
"PC2:OTG_HS_ULPI_DIR" : 10,
"PC2:SPI2_MISO" : 5,
"PC3:ETH_MII_TX_CLK" : 11,
"PC3:EVENTOUT" : 15,
"PC3:FMC_SDCKE0" : 12,
"PC3:I2S2_SD" : 5,
"PC3:OTG_HS_ULPI_NXT" : 10,
"PC3:SPI2_MOSI" : 5,
"PC4:ETH_MII_RXD0" : 11,
"PC4:ETH_RMII_RXD0" : 11,
"PC4:EVENTOUT" : 15,
"PC5:ETH_MII_RXD1" : 11,
"PC5:ETH_RMII_RXD1" : 11,
"PC5:EVENTOUT" : 15,
"PC6:DCMI_D0" : 13,
"PC6:EVENTOUT" : 15,
"PC6:I2S2_MCK" : 5,
"PC6:LCD_HSYNC" : 14,
"PC6:SDIO_D6" : 12,
"PC6:TIM3_CH1" : 2,
"PC6:TIM8_CH1" : 3,
"PC6:USART6_TX" : 8,
"PC7:DCMI_D1" : 13,
"PC7:EVENTOUT" : 15,
"PC7:I2S3_MCK" : 6,
"PC7:LCD_G6" : 14,
"PC7:SDIO_D7" : 12,
"PC7:TIM3_CH2" : 2,
"PC7:TIM8_CH2" : 3,
"PC7:USART6_RX" : 8,
"PC8:DCMI_D2" : 13,
"PC8:EVENTOUT" : 15,
"PC8:SDIO_D0" : 12,
"PC8:TIM3_CH3" : 2,
"PC8:TIM8_CH3" : 3,
"PC8:USART6_CK" : 8,
"PC9:DCMI_D3" : 13,
"PC9:EVENTOUT" : 15,
"PC9:I2C3_SDA" : 4,
"PC9:I2S_CKIN" : 5,
"PC9:MCO2" : 0,
"PC9:SDIO_D1" : 12,
"PC9:TIM3_CH4" : 2,
"PC9:TIM8_CH4" : 3,
"PD0:CAN1_RX" : 9,
"PD0:EVENTOUT" : 15,
"PD0:FMC_D2" : 12,
"PD10:EVENTOUT" : 15,
"PD10:FMC_D15" : 12,
"PD10:LCD_B3" : 14,
"PD10:USART3_CK" : 7,
"PD11:EVENTOUT" : 15,
"PD11:FMC_A16" : 12,
"PD11:USART3_CTS" : 7,
"PD12:EVENTOUT" : 15,
"PD12:FMC_A17" : 12,
"PD12:TIM4_CH1" : 2,
"PD12:USART3_RTS" : 7,
"PD13:EVENTOUT" : 15,
"PD13:FMC_A18" : 12,
"PD13:TIM4_CH2" : 2,
"PD14:EVENTOUT" : 15,
"PD14:FMC_D0" : 12,
"PD14:TIM4_CH3" : 2,
"PD15:EVENTOUT" : 15,
"PD15:FMC_D1" : 12,
"PD15:TIM4_CH4" : 2,
"PD1:CAN1_TX" : 9,
"PD1:EVENTOUT" : 15,
"PD1:FMC_D3" : 12,
"PD2:DCMI_D11" : 13,
"PD2:EVENTOUT" : 15,
"PD2:SDIO_CMD" : 12,
"PD2:TIM3_ETR" : 2,
"PD2:UART5_RX" : 8,
"PD3:DCMI_D5" : 13,
"PD3:EVENTOUT" : 15,
"PD3:FMC_CLK" : 12,
"PD3:I2S2_CK" : 5,
"PD3:LCD_G7" : 14,
"PD3:SPI2_SCK" : 5,
"PD3:USART2_CTS" : 7,
"PD4:EVENTOUT" : 15,
"PD4:FMC_NOE" : 12,
"PD4:USART2_RTS" : 7,
"PD5:EVENTOUT" : 15,
"PD5:FMC_NWE" : 12,
"PD5:USART2_TX" : 7,
"PD6:DCMI_D10" : 13,
"PD6:EVENTOUT" : 15,
"PD6:FMC_NWAIT" : 12,
"PD6:I2S3_SD" : 5,
"PD6:LCD_B2" : 14,
"PD6:SPI3_MOSI" : 5,
"PD6:USART2_RX" : 7,
"PD7:EVENTOUT" : 15,
"PD7:FMC_NCE2" : 12,
"PD7:FMC_NE1" : 12,
"PD7:USART2_CK" : 7,
"PD8:EVENTOUT" : 15,
"PD8:FMC_D13" : 12,
"PD8:USART3_TX" : 7,
"PD9:EVENTOUT" : 15,
"PD9:FMC_D14" : 12,
"PD9:USART3_RX" : 7,
"PE0:DCMI_D2" : 13,
"PE0:EVENTOUT" : 15,
"PE0:FMC_NBL0" : 12,
"PE0:TIM4_ETR" : 2,
"PE0:UART8_RX" : 8,
"PE10:EVENTOUT" : 15,
"PE10:FMC_D7" : 12,
"PE10:TIM1_CH2N" : 1,
"PE11:EVENTOUT" : 15,
"PE11:FMC_D8" : 12,
"PE11:LCD_G3" : 14,
"PE11:TIM1_CH2" : 1,
"PE12:EVENTOUT" : 15,
"PE12:FMC_D9" : 12,
"PE12:LCD_B4" : 14,
"PE12:TIM1_CH3N" : 1,
"PE13:EVENTOUT" : 15,
"PE13:FMC_D10" : 12,
"PE13:LCD_DE" : 14,
"PE13:TIM1_CH3" : 1,
"PE14:EVENTOUT" : 15,
"PE14:FMC_D11" : 12,
"PE14:LCD_CLK" : 14,
"PE14:TIM1_CH4" : 1,
"PE15:" : 5,
"PE15:EVENTOUT" : 15,
"PE15:FMC_D12" : 12,
"PE15:LCD_R7" : 14,
"PE15:TIM1_BKIN" : 1,
"PE1:DCMI_D3" : 13,
"PE1:EVENTOUT" : 15,
"PE1:FMC_NBL1" : 12,
"PE1:UART8_TX" : 8,
"PE2:ETH_MII_TXD3" : 11,
"PE2:EVENTOUT" : 15,
"PE2:FMC_A23" : 12,
"PE2:TRACECLK" : 0,
"PE3:EVENTOUT" : 15,
"PE3:FMC_A19" : 12,
"PE3:TRACED0" : 0,
"PE4:DCMI_D4" : 13,
"PE4:EVENTOUT" : 15,
"PE4:FMC_A20" : 12,
"PE4:LCD_B0" : 14,
"PE4:TRACED1" : 0,
"PE5:DCMI_D6" : 13,
"PE5:EVENTOUT" : 15,
"PE5:FMC_A21" : 12,
"PE5:LCD_G0" : 14,
"PE5:TIM9_CH1" : 3,
"PE5:TRACED2" : 0,
"PE6:DCMI_D7" : 13,
"PE6:EVENTOUT" : 15,
"PE6:FMC_A22" : 12,
"PE6:LCD_G1" : 14,
"PE6:TIM9_CH2" : 3,
"PE6:TRACED3" : 0,
"PE7:EVENTOUT" : 15,
"PE7:FMC_D4" : 12,
"PE7:TIM1_ETR" : 1,
"PE7:UART7_RX" : 8,
"PE8:EVENTOUT" : 15,
"PE8:FMC_D5" : 12,
"PE8:TIM1_CH1N" : 1,
"PE8:UART7_TX" : 8,
"PE9:EVENTOUT" : 15,
"PE9:FMC_D6" : 12,
"PE9:TIM1_CH1" : 1,
"PF0:EVENTOUT" : 15,
"PF0:FMC_A0" : 12,
"PF0:I2C2_SDA" : 4,
"PF10:DCMI_D11" : 13,
"PF10:EVENTOUT" : 15,
"PF10:FMC_INTR" : 12,
"PF10:LCD_DE" : 14,
"PF11:DCMI_D12" : 13,
"PF11:EVENTOUT" : 15,
"PF11:FMC_SDNRAS" : 12,
"PF12:EVENTOUT" : 15,
"PF12:FMC_A6" : 12,
"PF13:EVENTOUT" : 15,
"PF13:FMC_A7" : 12,
"PF14:EVENTOUT" : 15,
"PF14:FMC_A8" : 12,
"PF15:EVENTOUT" : 15,
"PF15:FMC_A9" : 12,
"PF1:" : 3,
"PF1:EVENTOUT" : 15,
"PF1:FMC_A1" : 12,
"PF1:I2C2_SCL" : 4,
"PF2:EVENTOUT" : 15,
"PF2:FMC_A2" : 12,
"PF2:I2C2_SMBA" : 4,
"PF3:" : 4,
"PF3:EVENTOUT" : 15,
"PF3:FMC_A3" : 12,
"PF4:" : 4,
"PF4:EVENTOUT" : 15,
"PF4:FMC_A4" : 12,
"PF5:" : 4,
"PF5:EVENTOUT" : 15,
"PF5:FMC_A5" : 12,
"PF6:EVENTOUT" : 15,
"PF6:FMC_NIORD" : 12,
"PF6:TIM10_CH1" : 3,
"PF6:UART7_RX" : 8,
"PF7:EVENTOUT" : 15,
"PF7:FMC_NREG" : 12,
"PF7:TIM11_CH1" : 3,
"PF7:UART7_TX" : 8,
"PF8:EVENTOUT" : 15,
"PF8:FMC_NIOWR" : 12,
"PF8:TIM13_CH1" : 9,
"PF9:EVENTOUT" : 15,
"PF9:FMC_CD" : 12,
"PF9:TIM14_CH1" : 9,
"PG0:EVENTOUT" : 15,
"PG0:FMC_A10" : 12,
"PG10:DCMI_D2" : 13,
"PG10:EVENTOUT" : 15,
"PG10:FMC_NCE4_1" : 12,
"PG10:FMC_NE3" : 12,
"PG10:LCD_B2" : 14,
"PG10:LCD_G3" : 9,
"PG11:DCMI_D3" : 13,
"PG11:ETH_MII_TX_EN" : 11,
"PG11:ETH_RMII_TX_EN" : 11,
"PG11:EVENTOUT" : 15,
"PG11:FMC_NCE4_2" : 12,
"PG11:LCD_B3" : 14,
"PG12:EVENTOUT" : 15,
"PG12:FMC_NE4" : 12,
"PG12:LCD_B1" : 14,
"PG12:LCD_B4" : 9,
"PG12:USART6_RTS" : 8,
"PG13:ETH_MII_TXD0" : 11,
"PG13:ETH_RMII_TXD0" : 11,
"PG13:EVENTOUT" : 15,
"PG13:FMC_A24" : 12,
"PG13:USART6_CTS" : 8,
"PG14:ETH_MII_TXD1" : 11,
"PG14:ETH_RMII_TXD1" : 11,
"PG14:EVENTOUT" : 15,
"PG14:FMC_A25" : 12,
"PG14:USART6_TX" : 8,
"PG15:DCMI_D13" : 13,
"PG15:EVENTOUT" : 15,
"PG15:FMC_SDNCAS" : 12,
"PG15:USART6_CTS" : 8,
"PG1:EVENTOUT" : 15,
"PG1:FMC_A11" : 12,
"PG2:EVENTOUT" : 15,
"PG2:FMC_A12" : 12,
"PG3:EVENTOUT" : 15,
"PG3:FMC_A13" : 12,
"PG4:EVENTOUT" : 15,
"PG4:FMC_A14" : 12,
"PG4:FMC_BA0" : 12,
"PG5:EVENTOUT" : 15,
"PG5:FMC_A15" : 12,
"PG5:FMC_BA1" : 12,
"PG6:DCMI_D12" : 13,
"PG6:EVENTOUT" : 15,
"PG6:FMC_INT2" : 12,
"PG6:LCD_R7" : 14,
"PG7:DCMI_D13" : 13,
"PG7:EVENTOUT" : 15,
"PG7:FMC_INT3" : 12,
"PG7:LCD_CLK" : 14,
"PG7:USART6_CK" : 8,
"PG8:ETH_PPS_OUT" : 11,
"PG8:EVENTOUT" : 15,
"PG8:FMC_SDCLK" : 12,
"PG8:USART6_RTS" : 8,
"PG9:DCMI_VSYNC(1)" : 13,
"PG9:EVENTOUT" : 15,
"PG9:FMC_NCE3" : 12,
"PG9:FMC_NE2" : 12,
"PG9:USART6_RX" : 8,
"PH0:EVENTOUT" : 15,
"PH10:DCMI_D1" : 13,
"PH10:EVENTOUT" : 15,
"PH10:FMC_D18" : 12,
"PH10:LCD_R4" : 14,
"PH10:TIM5_CH1" : 2,
"PH11:DCMI_D2" : 13,
"PH11:EVENTOUT" : 15,
"PH11:FMC_D19" : 12,
"PH11:LCD_R5" : 14,
"PH11:TIM5_CH2" : 2,
"PH12:DCMI_D3" : 13,
"PH12:EVENTOUT" : 15,
"PH12:FMC_D20" : 12,
"PH12:LCD_R6" : 14,
"PH12:TIM5_CH3" : 2,
"PH13:CAN1_TX" : 9,
"PH13:EVENTOUT" : 15,
"PH13:FMC_D21" : 12,
"PH13:LCD_G2" : 14,
"PH13:TIM8_CH1N" : 3,
"PH14:DCMI_D4" : 13,
"PH14:EVENTOUT" : 15,
"PH14:FMC_D22" : 12,
"PH14:LCD_G3" : 14,
"PH14:TIM8_CH2N" : 3,
"PH15:DCMI_D11" : 13,
"PH15:EVENTOUT" : 15,
"PH15:FMC_D23" : 12,
"PH15:LCD_G4" : 14,
"PH15:TIM8_CH3N" : 3,
"PH1:EVENTOUT" : 15,
"PH2:ETH_MII_CRS" : 11,
"PH2:EVENTOUT" : 15,
"PH2:FMC_SDCKE0" : 12,
"PH2:LCD_R0" : 14,
"PH3:ETH_MII_COL" : 11,
"PH3:EVENTOUT" : 15,
"PH3:FMC_SDNE0" : 12,
"PH3:LCD_R1" : 14,
"PH4:EVENTOUT" : 15,
"PH4:I2C2_SCL" : 4,
"PH4:OTG_HS_ULPI_NXT" : 10,
"PH5:EVENTOUT" : 15,
"PH5:FMC_SDNWE" : 12,
"PH5:I2C2_SDA" : 4,
"PH6:DCMI_D8" : 13,
"PH6:FMC_SDNE1" : 12,
"PH6:I2C2_SMBA" : 4,
"PH6:TIM12_CH1" : 9,
"PH7:DCMI_D9" : 13,
"PH7:ETH_MII_RXD3" : 11,
"PH7:FMC_SDCKE1" : 12,
"PH7:I2C3_SCL" : 4,
"PH8:DCMI_HSYNC" : 13,
"PH8:EVENTOUT" : 15,
"PH8:FMC_D16" : 12,
"PH8:I2C3_SDA" : 4,
"PH8:LCD_R2" : 14,
"PH9:DCMI_D0" : 13,
"PH9:EVENTOUT" : 15,
"PH9:FMC_D17" : 12,
"PH9:I2C3_SMBA" : 4,
"PH9:LCD_R3" : 14,
"PH9:TIM12_CH2" : 9,
}
ADC1_map = {
# format is PIN : ADC1_CHAN
# extracted from tabula-addfunc-F427.csv
"PA0" : 0,
"PA1" : 1,
"PA2" : 2,
"PA3" : 3,
"PA4" : 4,
"PA5" : 5,
"PA6" : 6,
"PA7" : 7,
"PB0" : 8,
"PB1" : 9,
"PC0" : 10,
"PC1" : 11,
"PC2" : 12,
"PC3" : 13,
"PC4" : 14,
"PC5" : 15,
}