From 40200654afc35844522ce753897442aa46a31560 Mon Sep 17 00:00:00 2001 From: mateksys Date: Tue, 6 Jul 2021 17:18:57 +0800 Subject: [PATCH] AP_HAL_ChibiOS: add MatekF765-SE hwdef as a variant of MatekF765-Wing --- .../hwdef/MatekF765-SE/defaults.parm | 6 ++++ .../hwdef/MatekF765-SE/hwdef-bl.dat | 1 + .../hwdef/MatekF765-SE/hwdef.dat | 28 +++++++++++++++++++ .../hwdef/MatekF765-Wing/hwdef.dat | 4 +++ 4 files changed, 39 insertions(+) create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/defaults.parm create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef-bl.dat create mode 100644 libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef.dat diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/defaults.parm b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/defaults.parm new file mode 100644 index 0000000000..9c5571e0be --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/defaults.parm @@ -0,0 +1,6 @@ +SERVO9_FUNCTION 120 +NTF_LED_TYPES 487 +NTF_LED_BRIGHT 2 +NTF_LED_LEN 8 +CAN_D1_PROTOCOL 1 +CAN_P1_DRIVER 1 diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef-bl.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef-bl.dat new file mode 100644 index 0000000000..5b10f0cd8f --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef-bl.dat @@ -0,0 +1 @@ +include ../MatekF765-Wing/hwdef-bl.dat diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef.dat new file mode 100644 index 0000000000..a20ee9eae9 --- /dev/null +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-SE/hwdef.dat @@ -0,0 +1,28 @@ +include ../MatekF765-Wing/hwdef.dat + +undef SERIAL_ORDER +undef UART4 UART4_TX UART4_RX +undef PD0 PD1 + +SERIAL_ORDER OTG1 UART7 USART1 USART2 USART3 UART8 EMPTY USART6 UART5 + +# CAN bus +PD0 CAN1_RX CAN1 +PD1 CAN1_TX CAN1 +PD3 GPIO_CAN1_SILENT OUTPUT PUSHPULL SPEED_LOW LOW GPIO(70) + +# voltage and current sensing scale +undef HAL_BATT_VOLT_SCALE +define HAL_BATT_VOLT_SCALE 21 + +undef HAL_BATT_CURR_SCALE +define HAL_BATT_CURR_SCALE 66.7 + +# undef ICM20602 & MPU6000, Add ICM42688 to SPI4, one IMU only +undef IMU mpu6000 icm20602 +SPIDEV icm42688 SPI4 DEVID1 SPARE_CS MODE3 2*MHZ 8*MHZ +IMU Invensensev3 SPI:icm42688 ROTATION_YAW_180 + + +undef HAL_I2C_INTERNAL_MASK +define HAL_I2C_INTERNAL_MASK 0 \ No newline at end of file diff --git a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat index 7ea0336bc4..d99c95de47 100644 --- a/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat +++ b/libraries/AP_HAL_ChibiOS/hwdef/MatekF765-Wing/hwdef.dat @@ -77,11 +77,15 @@ PC0 PRESSURE_SENS ADC1 SCALE(2) define HAL_DEFAULT_AIRSPEED_PIN 10 # define default battery setup +define HAL_BATT_MONITOR_DEFAULT 4 define HAL_BATT_VOLT_PIN 12 define HAL_BATT_CURR_PIN 13 define HAL_BATT_VOLT_SCALE 11 define HAL_BATT_CURR_SCALE 40 +define HAL_BATT2_VOLT_PIN 4 +define HAL_BATT2_CURR_PIN 15 + # analog RSSI PC1 RSSI_ADC ADC1 define BOARD_RSSI_ANA_PIN 11