2018-01-25 17:39:44 -04:00
|
|
|
# hw definition file for processing by chibios_pins.py
|
|
|
|
# for Revo-Mini hardware
|
|
|
|
|
|
|
|
# MCU class and specific type
|
|
|
|
MCU STM32F4xx STM32F405xx
|
|
|
|
|
2018-03-01 02:51:39 -04:00
|
|
|
define CONFIG_HAL_BOARD_SUBTYPE HAL_BOARD_SUBTYPE_CHIBIOS_REVOMINI
|
|
|
|
|
2018-01-25 17:39:44 -04:00
|
|
|
# board ID for firmware load
|
2018-06-16 08:09:31 -03:00
|
|
|
APJ_BOARD_ID 124
|
2018-01-25 17:39:44 -04:00
|
|
|
|
|
|
|
# crystal frequency
|
|
|
|
OSCILLATOR_HZ 8000000
|
|
|
|
STM32_PLLM_VALUE 8
|
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
define STM32_ST_USE_TIMER 5
|
|
|
|
|
2018-01-25 17:39:44 -04:00
|
|
|
FLASH_SIZE_KB 1024
|
|
|
|
|
|
|
|
# board voltage
|
|
|
|
STM32_VDD 330U
|
|
|
|
|
2018-06-23 07:56:05 -03:00
|
|
|
# use USB for stdout, so no STDOUT_SERIAL
|
|
|
|
# STDOUT_SERIAL SD3
|
|
|
|
# STDOUT_BAUDRATE 57600
|
2018-01-25 17:39:44 -04:00
|
|
|
|
|
|
|
# only one I2C bus
|
|
|
|
I2C_ORDER I2C1
|
|
|
|
|
|
|
|
# order of UARTs (and USB)
|
2018-02-11 21:48:56 -04:00
|
|
|
UART_ORDER OTG1 USART3 USART1
|
2018-01-25 17:39:44 -04:00
|
|
|
|
2018-02-11 21:12:00 -04:00
|
|
|
# rcinput is PC6, which is the 3rd "PWM IN" pin (the yellow wire on a
|
|
|
|
# revolution board)
|
2018-03-13 21:28:42 -03:00
|
|
|
PC6 TIM8_CH1 TIM8 RCIN FLOAT LOW
|
2018-01-25 17:39:44 -04:00
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
# analog pins
|
2018-01-25 17:39:44 -04:00
|
|
|
PC3 VDD_5V_SENS ADC1
|
|
|
|
PC2 BATT_VOLTAGE_SENS ADC1 SCALE(1)
|
|
|
|
PC1 BATT_CURRENT_SENS ADC1 SCALE(1)
|
2018-02-11 21:48:56 -04:00
|
|
|
PC5 USB_SENSE ADC1
|
|
|
|
|
|
|
|
# define default battery setup
|
|
|
|
define HAL_BATT_VOLT_PIN 12
|
|
|
|
define HAL_BATT_CURR_PIN 11
|
|
|
|
define HAL_BATT_VOLT_SCALE 10.1
|
|
|
|
define HAL_BATT_CURR_SCALE 17.0
|
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
|
|
|
|
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)
|
|
|
|
|
2018-02-11 21:12:00 -04:00
|
|
|
# GPS port disabled (PC6 used for RCIN)
|
|
|
|
#PC6 USART6_TX USART6
|
|
|
|
#PC7 USART6_RX USART6
|
2018-02-04 03:17:30 -04:00
|
|
|
|
2018-02-11 21:12:00 -04:00
|
|
|
# flexi port, setup as GPS
|
2018-02-04 03:17:30 -04:00
|
|
|
PB10 USART3_TX USART3
|
|
|
|
PB11 USART3_RX USART3
|
|
|
|
|
2018-02-11 20:26:08 -04:00
|
|
|
# main port, for telem1
|
|
|
|
PA9 USART1_TX USART1
|
|
|
|
PA10 USART1_RX USART1
|
2018-02-07 01:23:11 -04:00
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
# alternative config
|
|
|
|
# PB10 I2C2_SCL I2C2
|
|
|
|
# PB11 I2C2_SDA I2C2
|
2018-01-25 17:39:44 -04:00
|
|
|
|
|
|
|
# spi bus for IMU
|
|
|
|
PA5 SPI1_SCK SPI1
|
|
|
|
PA6 SPI1_MISO SPI1
|
|
|
|
PA7 SPI1_MOSI SPI1
|
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
# spi bus for dataflash
|
|
|
|
PC10 SPI3_SCK SPI3
|
|
|
|
PC11 SPI3_MISO SPI3
|
|
|
|
PC12 SPI3_MOSI SPI3
|
|
|
|
|
|
|
|
# IRQ for MPU6000
|
|
|
|
PC4 EXTI_MPU6000 INPUT
|
|
|
|
|
2018-01-25 17:39:44 -04:00
|
|
|
# PA10 IO-debug-console
|
|
|
|
PA11 OTG_FS_DM OTG1
|
|
|
|
PA12 OTG_FS_DP OTG1
|
2018-02-07 01:23:11 -04:00
|
|
|
|
2018-01-25 17:39:44 -04:00
|
|
|
PA13 JTMS-SWDIO SWD
|
|
|
|
PA14 JTCK-SWCLK SWD
|
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
# only one I2C bus in normal config
|
2018-01-25 17:39:44 -04:00
|
|
|
PB8 I2C1_SCL I2C1
|
|
|
|
PB9 I2C1_SDA I2C1
|
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
# SPI chip selects
|
2018-01-25 17:39:44 -04:00
|
|
|
PA4 MPU_CS CS
|
2018-02-04 03:17:30 -04:00
|
|
|
PB3 FLASH_CS CS
|
|
|
|
|
|
|
|
# PWM out pins
|
2018-04-01 03:01:55 -03:00
|
|
|
PB0 TIM3_CH3 TIM3 PWM(1) GPIO(50)
|
|
|
|
PB1 TIM3_CH4 TIM3 PWM(2) GPIO(51)
|
|
|
|
PA3 TIM2_CH4 TIM2 PWM(3) GPIO(52)
|
|
|
|
PA2 TIM2_CH3 TIM2 PWM(4) GPIO(53)
|
|
|
|
PA1 TIM2_CH2 TIM2 PWM(5) GPIO(54)
|
|
|
|
PA0 TIM2_CH1 TIM2 PWM(6) GPIO(55)
|
|
|
|
PC8 TIM8_CH3 TIM2 PWM(7) GPIO(56)
|
|
|
|
PC9 TIM8_CH4 TIM2 PWM(8) GPIO(57)
|
2018-01-25 17:39:44 -04:00
|
|
|
|
2018-02-04 03:17:30 -04:00
|
|
|
PB7 DRDY_HMC5883 INPUT PULLUP
|
2018-01-25 17:39:44 -04:00
|
|
|
|
2018-06-23 05:00:05 -03:00
|
|
|
define HAL_STORAGE_SIZE 15360
|
2018-06-16 08:09:31 -03:00
|
|
|
define STORAGE_FLASH_PAGE 2
|
2018-01-25 17:39:44 -04:00
|
|
|
|
2018-06-16 08:09:31 -03:00
|
|
|
# reserve 32k for bootloader and 32k for flash storage
|
2018-01-25 17:39:44 -04:00
|
|
|
FLASH_RESERVE_START_KB 64
|
|
|
|
|
|
|
|
define HAL_INS_DEFAULT HAL_INS_MPU60XX_SPI
|
2018-04-29 08:12:51 -03:00
|
|
|
define HAL_INS_DEFAULT_ROTATION ROTATION_YAW_180
|
2018-01-25 17:39:44 -04:00
|
|
|
|
|
|
|
define HAL_COMPASS_DEFAULT HAL_COMPASS_HMC5843
|
2018-02-04 03:17:30 -04:00
|
|
|
define HAL_COMPASS_HMC5843_I2C_BUS 0
|
2018-01-25 17:39:44 -04:00
|
|
|
define HAL_COMPASS_HMC5843_I2C_ADDR 0x1E
|
2018-07-05 06:01:40 -03:00
|
|
|
define HAL_COMPASS_HMC5843_ROTATION ROTATION_YAW_270
|
2018-08-01 08:03:34 -03:00
|
|
|
define HAL_COMPASS_AUTO_ROT_DEFAULT 2
|
2018-01-25 17:39:44 -04:00
|
|
|
|
|
|
|
define HAL_BARO_DEFAULT HAL_BARO_MS5611_I2C
|
|
|
|
define HAL_BARO_MS5611_I2C_BUS 0
|
|
|
|
define HAL_BARO_MS5611_I2C_ADDR 0x77
|
|
|
|
|
2018-11-05 04:36:40 -04:00
|
|
|
# also allow for probing of external barometers
|
|
|
|
define HAL_PROBE_EXTERNAL_I2C_BAROS
|
|
|
|
|
2018-01-25 17:39:44 -04:00
|
|
|
# SPI devices
|
2018-02-04 03:17:30 -04:00
|
|
|
SPIDEV mpu6000 SPI1 DEVID1 MPU_CS MODE3 1*MHZ 8*MHZ
|
|
|
|
SPIDEV dataflash SPI3 DEVID1 FLASH_CS MODE3 1*MHZ 8*MHZ
|
2018-02-07 01:23:11 -04:00
|
|
|
|
2018-04-06 22:32:50 -03:00
|
|
|
# 8 PWM available by default
|
|
|
|
define BOARD_PWM_COUNT_DEFAULT 8
|
|
|
|
|