HAL_ChibiOS: add more pins for revo-mini port

This commit is contained in:
Andrew Tridgell 2018-02-04 18:17:30 +11:00
parent e91144cc8e
commit 077aa24c6d
1 changed files with 55 additions and 12 deletions

View File

@ -14,6 +14,9 @@ APJ_BOARD_ID 70
OSCILLATOR_HZ 8000000 OSCILLATOR_HZ 8000000
STM32_PLLM_VALUE 8 STM32_PLLM_VALUE 8
define STM32_ST_USE_TIMER 5
HRT_TIMER 6
FLASH_SIZE_KB 1024 FLASH_SIZE_KB 1024
# board voltage # board voltage
@ -33,22 +36,52 @@ USB_STRING_SERIAL "100"
I2C_ORDER I2C1 I2C_ORDER I2C1
# order of UARTs (and USB) # order of UARTs (and USB)
UART_ORDER OTG1 USART1 UART_ORDER OTG1 USART6 USART1 USART3
# PB10 USART3_TX USART3
# we need to add support for N channels for RCIN
# PB14 TIM8_CH2 TIM8 RCIN PULLUP LOW DMA_CH0 # PB14 TIM8_CH2 TIM8 RCIN PULLUP LOW DMA_CH0
# analog pins
PC3 VDD_5V_SENS ADC1 PC3 VDD_5V_SENS ADC1
PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1) PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
PC1 BATT_CURRENT_SENS ADC1 SCALE(1) PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
PC5 USB_SENSE ADC1
PC0 SBUS_INVERT OUTPUT LOW
# LEDs
PB5 LED_BLUE OUTPUT LOW GPIO(0)
PB6 LED_YELLOW OUTPUT LOW GPIO(1) # optional
PB4 LED_RED OUTPUT LOW GPIO(2)
# GPS port
PC6 USART6_TX USART6
PC7 USART6_RX USART6
# this is a very strange workaround for a USB problem. Needs investigating
define GCS_SETUP_UART_FIRST 2
# flexi port, telem2 (can also be I2C2)
PB10 USART3_TX USART3
PB11 USART3_RX USART3
# alternative config
# PB10 I2C2_SCL I2C2
# PB11 I2C2_SDA I2C2
# spi bus for IMU # spi bus for IMU
PA5 SPI1_SCK SPI1 PA5 SPI1_SCK SPI1
PA6 SPI1_MISO SPI1 PA6 SPI1_MISO SPI1
PA7 SPI1_MOSI SPI1 PA7 SPI1_MOSI SPI1
# spi bus for dataflash
PC10 SPI3_SCK SPI3
PC11 SPI3_MISO SPI3
PC12 SPI3_MOSI SPI3
# IRQ for MPU6000
PC4 EXTI_MPU6000 INPUT
PA9 USART1_TX USART1 PA9 USART1_TX USART1
PA10 USART1_RX USART1 PA10 USART1_RX USART1
@ -58,15 +91,25 @@ PA12 OTG_FS_DP OTG1
PA13 JTMS-SWDIO SWD PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD PA14 JTCK-SWCLK SWD
# only one I2C bus in normal config
PB8 I2C1_SCL I2C1 PB8 I2C1_SCL I2C1
PB9 I2C1_SDA I2C1 PB9 I2C1_SDA I2C1
# SPI chip selects
PA4 MPU_CS CS PA4 MPU_CS CS
PB3 FLASH_CS CS
PC6 TIM8_CH1 TIM8 PWM(1) # PWM out pins
PC7 TIM8_CH2 TIM8 PWM(2) PB0 TIM3_CH3 TIM3 PWM(1)
PC8 TIM8_CH3 TIM8 PWM(3) PB1 TIM3_CH4 TIM3 PWM(2)
PC9 TIM8_CH4 TIM8 PWM(4) PA3 TIM2_CH4 TIM2 PWM(3)
PA2 TIM2_CH3 TIM2 PWM(4)
PA1 TIM2_CH2 TIM2 PWM(5)
PA0 TIM2_CH1 TIM2 PWM(6)
PC8 TIM8_CH3 TIM2 PWM(7)
PC9 TIM8_CH4 TIM2 PWM(8)
PB7 DRDY_HMC5883 INPUT PULLUP
define HAL_STORAGE_SIZE 8192 define HAL_STORAGE_SIZE 8192
define STORAGE_FLASH_PAGE 1 define STORAGE_FLASH_PAGE 1
@ -79,14 +122,14 @@ FLASH_RESERVE_START_KB 64
define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI
define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843 define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
define HAL_COMPASS_HMC5843_I2C_BUS 1 define HAL_COMPASS_HMC5843_I2C_BUS 0
define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E
define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_270
define HAL_BARO_DEFAULT HAL_BARO_MS5611_I2C define HAL_BARO_DEFAULT HAL_BARO_MS5611_I2C
define HAL_BARO_MS5611_I2C_BUS 0 define HAL_BARO_MS5611_I2C_BUS 0
define HAL_BARO_MS5611_I2C_ADDR 0x77 define HAL_BARO_MS5611_I2C_ADDR 0x77
# SPI devices # SPI devices
SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ
SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 1*MHZ 8*MHZ
define OPTFLOW DISABLED