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 // PB4 34 #define BUZZER_PWM_HZ 3800 // freq for passive buzzer 35 #define HAL_BUZZER_ON 1 36 #define HAL_BUZZER_OFF 0 38 #define BOARD_NR_USARTS 5 39 #define BOARD_USART1_TX_PIN 23 40 #define BOARD_USART1_RX_PIN 24 41 #define BOARD_USART3_TX_PIN 0 42 #define BOARD_USART3_RX_PIN 100 43 #define BOARD_USART6_TX_PIN 12 44 #define BOARD_USART6_RX_PIN 13 46 #define BOARD_USART4_RX_PIN 48 47 #define BOARD_USART4_TX_PIN 47 49 #define BOARD_DSM_USART (_USART1) 51 #define BOARD_NR_SPI 3 52 #define BOARD_SPI1_SCK_PIN 52 53 #define BOARD_SPI1_MISO_PIN 53 54 #define BOARD_SPI1_MOSI_PIN 54 55 #define BOARD_SPI2_SCK_PIN 3 // PB13 56 #define BOARD_SPI2_MISO_PIN 4 // PB14 57 #define BOARD_SPI2_MOSI_PIN 5 // PB15 58 #define BOARD_SPI3_MOSI_PIN 18 59 #define BOARD_SPI3_MISO_PIN 17 60 #define BOARD_SPI3_SCK_PIN 16 64 #define BOARD_USB_SENSE 11 // PC5 68 #define BOARD_SOFT_SCL 47 // PA0 - UART4_TX 69 #define BOARD_SOFT_SDA 48 // PA1 - UART4_RX 76 # define BOARD_BLUE_LED_PIN 36 // BLUE 77 # define BOARD_GREEN_LED_PIN 105 // NC - PC0 pin 8 79 # define HAL_GPIO_A_LED_PIN BOARD_BLUE_LED_PIN 80 # define HAL_GPIO_B_LED_PIN BOARD_GREEN_LED_PIN 82 # define HAL_GPIO_LED_ON LOW 83 # define HAL_GPIO_LED_OFF HIGH 85 #define BOARD_NR_GPIO_PINS 109 97 #define BOARD_I2C_BUS_EXT 2 // external I2C 98 #define BOARD_I2C_BUS_SLOW 2 // slow down bus with this number 100 #define BOARD_I2C1_DISABLE // lots of drivers tries to scan all buses, spoiling device setup 101 #define BOARD_I2C2_DISABLE 104 #define HAL_BARO_MS5611_I2C_BUS BOARD_I2C_BUS_EXT 105 #define HAL_BARO_MS5611_I2C_ADDR (0x77) 107 #define HAL_BARO_BMP280_BUS BOARD_I2C_BUS_EXT 108 #define HAL_BARO_BMP280_I2C_ADDR (0x76) 110 #define HAL_BARO_BMP085_BUS BOARD_I2C_BUS_EXT 111 #define HAL_BARO_BMP085_I2C_ADDR (0x77) 114 #define BOARD_COMPASS_DEFAULT HAL_COMPASS_HMC5843 115 #define BOARD_COMPASS_HMC5843_I2C_ADDR 0x1E 116 #define BOARD_COMPASS_HMC5843_ROTATION ROTATION_NONE 118 #define HAL_COMPASS_HMC5843_I2C_BUS BOARD_I2C_BUS_EXT 119 #define HAL_COMPASS_HMC5843_I2C_ADDR BOARD_COMPASS_HMC5843_I2C_ADDR 120 #define HAL_COMPASS_HMC5843_ROTATION BOARD_COMPASS_HMC5843_ROTATION 123 #define BOARD_INS_DEFAULT HAL_INS_MPU60XX_SPI 124 #define BOARD_INS_ROTATION ROTATION_NONE 125 #define BOARD_INS_MPU60x0_NAME "mpu6000" 126 #define BOARD_MPU6000_CS_PIN 51 // PA4 127 #define BOARD_MPU6000_DRDY_PIN 10 // PC4 129 #define BOARD_STORAGE_SIZE 8192 // 4096 // EEPROM size 131 #define BOARD_SDCARD_NAME "sdcard" 132 #define BOARD_SDCARD_CS_PIN 2 // PB12 135 #define BOARD_HAS_SDIO 136 #define HAL_BOARD_LOG_DIRECTORY "0:/APM/LOGS" 137 #define HAL_BOARD_TERRAIN_DIRECTORY "0:/APM/TERRAIN" 139 #define USB_MASSSTORAGE 141 #define BOARD_OSD_NAME "osd" 142 #define BOARD_OSD_CS_PIN 103 // PA15 143 #define BOARD_OSD_VSYNC_PIN 9 // PC3, Frequency input 147 #define BOARD_OWN_NAME "CL_Racing" 149 # define BOARD_PUSHBUTTON_PIN 254 150 # define BOARD_USB_MUX_PIN -1 151 # define BOARD_BATTERY_VOLT_PIN 8 // Battery voltage on A0 (PC2) D8 152 # define BOARD_BATTERY_CURR_PIN 7 // Battery current on A1 (PC1) D7 153 # define BOARD_SONAR_SOURCE_ANALOG_PIN 254 155 # define HAL_BATT_VOLT_PIN 8 // ChibiOS compatible defines 156 # define HAL_BATT_CURR_PIN 7 157 # define HAL_BATT_VOLT_SCALE 10.1 158 # define HAL_BATT_CURR_SCALE 17 161 #define BOARD_USB_DMINUS 108 163 #define BOARD_SBUS_UART 1 // can use some UART as hardware inverted input 164 #define BOARD_SBUS_INVERTER 6 // PC0 166 #define USE_SERIAL_4WAY_BLHELI_INTERFACE 168 #define BOARD_UARTS_LAYOUT 7 173 #define SERVO_PIN_1 46 // PB0 174 #define SERVO_PIN_2 45 // PB1 175 #define SERVO_PIN_3 50 // PA3 176 #define SERVO_PIN_4 49 // PA2 178 #define SERVO_PIN_5 105 // PB4 - buzzer 181 #define MOTOR_LAYOUT_DEFAULT 3 // Cleanflight 183 #define HAL_CONSOLE USB_Driver // console on USB 184 #define HAL_CONSOLE_PORT 0 201 #define BOARD_HAL_VARINFO \ 202 AP_GROUPINFO("USB_STORAGE", 30, AP_Param_Helper, _usb_storage, 0), \ 203 AP_GROUPINFO("SD_REFORMAT", 31, AP_Param_Helper, _sd_format, 0), 207 #define BOARD_HAL_PARAMS \ 208 AP_Int8 _usb_storage; \