Go to the documentation of this file. 1 #ifndef _BOARD_STM32V1F4_H_ 2 #define _BOARD_STM32V1F4_H_ 8 #define __CM4_REV 0x0001 9 #define __MPU_PRESENT 1 10 #define __NVIC_PRIO_BITS 4 11 #define __Vendor_SysTickConfig 0 12 #define __FPU_PRESENT 1 14 #define HSE_VALUE (8000000) 16 #define CYCLES_PER_MICROSECOND (SystemCoreClock / 1000000) 17 #define SYSTICK_RELOAD_VAL (CYCLES_PER_MICROSECOND*1000-1) 21 #define STM32_PCLK1 (CYCLES_PER_MICROSECOND*1000000/4) 22 #define STM32_PCLK2 (CYCLES_PER_MICROSECOND*1000000/2) 24 #define BOARD_BUTTON_PIN 254 33 #define BOARD_BUZZER_PIN 105 34 #define HAL_BUZZER_ON 1 35 #define HAL_BUZZER_OFF 0 37 #define BOARD_NR_USARTS 5 38 #define BOARD_USART1_TX_PIN 23 39 #define BOARD_USART1_RX_PIN 24 40 #define BOARD_USART3_TX_PIN 0 41 #define BOARD_USART3_RX_PIN 100 42 #define BOARD_USART6_TX_PIN 12 43 #define BOARD_USART6_RX_PIN 13 45 #define BOARD_USART4_RX_PIN 48 46 #define BOARD_USART4_TX_PIN 47 52 #define BOARD_DSM_USART (_USART1) 54 #define BOARD_NR_SPI 3 55 #define BOARD_SPI1_SCK_PIN 52 56 #define BOARD_SPI1_MISO_PIN 53 57 #define BOARD_SPI1_MOSI_PIN 54 58 #define BOARD_SPI2_SCK_PIN 3 // PB13 59 #define BOARD_SPI2_MISO_PIN 4 // PB14 60 #define BOARD_SPI2_MOSI_PIN 5 // PB15 61 #define BOARD_SPI3_MOSI_PIN 18 62 #define BOARD_SPI3_MISO_PIN 17 63 #define BOARD_SPI3_SCK_PIN 16 67 #define BOARD_MPU6000_CS_PIN 51 68 #define BOARD_MPU6000_DRDY_PIN 10 // PC4 73 #define BOARD_USB_SENSE 11 // PC5 77 #define BOARD_SOFT_SCL 14 78 #define BOARD_SOFT_SDA 15 85 # define BOARD_BLUE_LED_PIN 36 // BLUE 86 # define BOARD_GREEN_LED_PIN 6 // NC - PC0 pin 8 88 # define HAL_GPIO_A_LED_PIN BOARD_BLUE_LED_PIN 89 # define HAL_GPIO_B_LED_PIN BOARD_GREEN_LED_PIN 91 # define HAL_GPIO_LED_ON LOW 92 # define HAL_GPIO_LED_OFF HIGH 95 #define BOARD_NR_GPIO_PINS 109 103 #define I2C2_SDA PB11 104 #define I2C2_SCL PB10 108 #define BOARD_I2C_BUS_EXT 1 // external I2C 109 #define BOARD_I2C_BUS_SLOW 1 // slow down bus with this number 111 #define BOARD_I2C1_DISABLE // lots of drivers tries to scan all buses, spoiling device setup 113 #define BOARD_BARO_DEFAULT HAL_BARO_BMP280_SPI 114 #define HAL_BARO_BMP280_NAME "bmp280" 115 #define BOARD_BMP280_CS_PIN 104 117 #define HAL_BARO_MS5611_I2C_BUS BOARD_I2C_BUS_EXT 118 #define HAL_BARO_MS5611_I2C_ADDR (0x77) 120 #define BOARD_COMPASS_DEFAULT HAL_COMPASS_HMC5843 121 #define BOARD_COMPASS_HMC5843_I2C_ADDR 0x1E 122 #define BOARD_COMPASS_HMC5843_ROTATION ROTATION_NONE 124 #define HAL_COMPASS_HMC5843_I2C_BUS BOARD_I2C_BUS_EXT 125 #define HAL_COMPASS_HMC5843_I2C_ADDR BOARD_COMPASS_HMC5843_I2C_ADDR 126 #define HAL_COMPASS_HMC5843_ROTATION BOARD_COMPASS_HMC5843_ROTATION 129 #define BOARD_INS_DEFAULT HAL_INS_MPU60XX_SPI 130 #define BOARD_INS_ROTATION ROTATION_YAW_180 131 #define BOARD_INS_MPU60x0_NAME "mpu6000" 133 #define BOARD_STORAGE_SIZE 8192 // 4096 // EEPROM size 136 #define BOARD_SDCARD_NAME "sdcard" 137 #define BOARD_SDCARD_CS_PIN 2 138 #define BOARD_SDCARD_DET_PIN 38 // PB7 140 #define BOARD_HAS_SDIO 141 #define HAL_BOARD_LOG_DIRECTORY "0:/APM/LOGS" 142 #define HAL_BOARD_TERRAIN_DIRECTORY "0:/APM/TERRAIN" 144 #define USB_MASSSTORAGE 146 #define BOARD_OSD_NAME "osd" 147 #define BOARD_OSD_CS_PIN 103 148 #define BOARD_OSD_VSYNC_PIN 9 // PC3, Frequency input 149 #define BOARD_OSD_RESET_PIN 6 // PC0, NC 152 #define BOARD_OWN_NAME "AirbotV2" 154 # define BOARD_PUSHBUTTON_PIN 254 155 # define BOARD_USB_MUX_PIN -1 156 # define BOARD_BATTERY_VOLT_PIN 8 // Battery voltage on A0 (PC2) D8 157 # define BOARD_BATTERY_CURR_PIN 7 // Battery current on A1 (PC1) D7 158 # define BOARD_SONAR_SOURCE_ANALOG_PIN 254 160 # define HAL_BATT_VOLT_PIN 8 // ChibiOS compatible defines 161 # define HAL_BATT_CURR_PIN 8 162 # define HAL_BATT_VOLT_SCALE 10.1 163 # define HAL_BATT_CURR_SCALE 17 166 #define BOARD_USB_DMINUS 108 168 #define BOARD_SBUS_UART 1 // can use some UART as hardware inverted input 170 #define USE_SERIAL_4WAY_BLHELI_INTERFACE 172 #define BOARD_UARTS_LAYOUT 3 177 #define SERVO_PIN_1 46 // PB0 178 #define SERVO_PIN_2 45 // PB1 179 #define SERVO_PIN_3 50 // PA3 180 #define SERVO_PIN_4 49 // PA2 181 #define SERVO_PIN_5 48 // PA1 182 #define SERVO_PIN_6 22 // PA8 184 #define MOTOR_LAYOUT_DEFAULT 0 187 #define HAL_CONSOLE USB_Driver // console on USB 188 #define HAL_CONSOLE_PORT 0 190 #define HAL_CONSOLE uart1Driver // console on radio 191 #define HAL_CONSOLE_PORT 1 212 #define BOARD_HAL_VARINFO \ 213 AP_GROUPINFO("USB_STORAGE", 30, AP_Param_Helper, _usb_storage, 0), \ 214 AP_GROUPINFO("SD_REFORMAT", 31, AP_Param_Helper, _sd_format, 0), 218 #define BOARD_HAL_PARAMS \ 219 AP_Int8 _usb_storage; \