Skip to content

Commit

Permalink
update & add HEATER pinmap
Browse files Browse the repository at this point in the history
  • Loading branch information
jfbblue0922 authored and jfbblue0922 committed Jul 1, 2024
1 parent dd347c1 commit 1e051ea
Showing 1 changed file with 64 additions and 61 deletions.
125 changes: 64 additions & 61 deletions libraries/AP_HAL_ChibiOS/hwdef/JFB-X/hwdef.dat
Original file line number Diff line number Diff line change
Expand Up @@ -53,14 +53,14 @@ STDOUT_BAUDRATE 921600
DEFAULTGPIO OUTPUT LOW PULLDOWN

# USB OTG1 SERIAL0
PA11 OTG_FS_DM OTG1
PA12 OTG_FS_DP OTG1
PA11 OTG_FS_DM OTG1 SPEED_VERYLOW
PA12 OTG_FS_DP OTG1 SPEED_VERYLOW
# default the 2nd interface to MAVLink2
define HAL_OTG2_PROTOCOL SerialProtocol_MAVLink2

# pins for SWD debugging
PA13 JTMS-SWDIO SWD
PA14 JTCK-SWCLK SWD
PA13 JTMS-SWDIO SWD SPEED_VERYLOW
PA14 JTCK-SWCLK SWD SPEED_VERYLOW

# telem1
PE8 UART7_TX UART7 SPEED_VERYLOW
Expand Down Expand Up @@ -101,8 +101,8 @@ PD8 USART3_TX USART3 SPEED_VERYLOW NODMA
PD9 USART3_RX USART3 SPEED_VERYLOW NODMA

# ADC
PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1) # ADC1_16
PA4 BATT_CURRENT_SENS ADC1 SCALE(1) # ADC1_18
PA0 BATT_VOLTAGE_SENS ADC1 SCALE(1) # ADC1_16
PA4 BATT_CURRENT_SENS ADC1 SCALE(1) # ADC1_18
PF5 BATT2_VOLTAGE_SENS ADC3 SCALE(1) # ADC3_4
PF12 BATT2_CURRENT_SENS ADC1 SCALE(1) # ADC1_6

Expand All @@ -120,11 +120,11 @@ define HAL_BATT2_CURR_PIN 6
PH4 VDD_5V_SENS ADC3 SCALE(2) # ADC3_15
define ANALOG_VCC_5V_PIN 15
define HAL_HAVE_BOARD_VOLTAGE 1
PA9 VBUS_RESERVED INPUT
PA9 VBUS_RESERVED INPUT

# JFB110 has SERVORAIL ADC
PF11 SCALED_V3V3 ADC1 SCALE(2) # ADC1_2
PH3 FMU_SERVORAIL_VCC_SENS ADC3 SCALE(2) # ADC3_14
PF11 SCALED_V3V3 ADC1 SCALE(2) # ADC1_2
PH3 FMU_SERVORAIL_VCC_SENS ADC3 SCALE(2) # ADC3_14

PC0 RSSI_IN ADC1 SCALE(1) # ADC1_10
define RSSI_ANA_PIN 10
Expand All @@ -136,12 +136,12 @@ PC3 ADC1_3V3 ADC1 SCALE(1) # ADC1_13
# a pin that enables peripheral power on this board. It starts in the
# off state, then is pulled low to enable peripherals in
# peripheral_power_enable()
PG10 nVDD_5V_HIPOWER_EN OUTPUT HIGH
PG4 nVDD_5V_PERIPH_EN OUTPUT HIGH
PJ1 VDD_3V3_SENSORS_EN OUTPUT LOW
PJ5 VDD_3V3_SENSORS2_EN OUTPUT LOW
PJ4 VDD_3V3_SENSORS3_EN OUTPUT LOW
PG8 VDD_3V3_SENSORS4_EN OUTPUT LOW
PG10 nVDD_5V_HIPOWER_EN OUTPUT HIGH SPEED_VERYLOW
PG4 nVDD_5V_PERIPH_EN OUTPUT HIGH SPEED_VERYLOW
PJ1 VDD_3V3_SENSORS_EN OUTPUT LOW SPEED_VERYLOW
PJ5 VDD_3V3_SENSORS2_EN OUTPUT LOW SPEED_VERYLOW
PJ4 VDD_3V3_SENSORS3_EN OUTPUT LOW SPEED_VERYLOW
PG8 VDD_3V3_SENSORS4_EN OUTPUT LOW SPEED_VERYLOW
#VDD_3V3_SD_CARD_EN OUTPUT LOW

# controlled manually
Expand All @@ -151,7 +151,7 @@ PK4 GPIO_CAN2_SILENT OUTPUT PUSHPULL LOW
# Control of Spektrum power pin
# no SPEKTRUM_RC pin so this is controlled
# manually
PJ14 SPEKTRUM_PWR OUTPUT HIGH GPIO(69)
PJ14 SPEKTRUM_PWR OUTPUT HIGH GPIO(69) SPEED_VERYLOW
define HAL_GPIO_SPEKTRUM_PWR 69
define HAL_SPEKTRUM_PWR_ENABLED 1

Expand Down Expand Up @@ -202,15 +202,15 @@ PF7 SPI5_SCK SPI5 SPEED_VERYLOW
PH7 SPI5_MISO SPI5 SPEED_VERYLOW
PJ10 SPI5_MOSI SPI5 SPEED_VERYLOW
PE2 EXT_SPI5_CS1 CS SPEED_VERYLOW
PD11 EXT_SPI5_CS2 CS
PD11 EXT_SPI5_CS2 CS SPEED_VERYLOW

# IMU Device Ready Signal Input
PA15 DRDY1_IIM42652_1 INPUT
PF2 DRDY2_IIM42652_1 INPUT
PK3 DRDY1_IIM42652_2 INPUT
PK7 DRDY2_IIM42652_2 INPUT

PI15 SCHA63T_RESET OUTPUT LOW
PI15 SCHA63T_RESET OUTPUT LOW SPEED_VERYLOW

# SPI devices
SPIDEV scha63t_g SPI1 DEVID1 SCHA63T_G_CS MODE0 10*MHZ 10*MHZ
Expand Down Expand Up @@ -240,24 +240,24 @@ define HAL_DEFAULT_INS_FAST_SAMPLE 7
# PWM output pins
# we need to disable DMA on the last 2 FMU channels
# as timer 12 doesn't have a TIMn_UP DMA option
PE9 TIM1_CH1 TIM1 PWM(1) GPIO(50) SPEED_VERYLOW
PJ11 TIM1_CH2 TIM1 PWM(2) GPIO(51) SPEED_VERYLOW
PA10 TIM1_CH3 TIM1 PWM(3) GPIO(52) SPEED_VERYLOW
PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53) SPEED_VERYLOW
PC6 TIM3_CH1 TIM3 PWM(5) GPIO(54) SPEED_VERYLOW
PC7 TIM3_CH2 TIM3 PWM(6) GPIO(55) SPEED_VERYLOW
PB0 TIM3_CH3 TIM3 PWM(7) GPIO(56) SPEED_VERYLOW
PB1 TIM3_CH4 TIM3 PWM(8) GPIO(57) SPEED_VERYLOW
PD12 TIM4_CH1 TIM4 PWM(9) GPIO(58) SPEED_VERYLOW
PD13 TIM4_CH2 TIM4 PWM(10) GPIO(59) SPEED_VERYLOW
PD14 TIM4_CH3 TIM4 PWM(11) GPIO(60) SPEED_VERYLOW
PE9 TIM1_CH1 TIM1 PWM(1) GPIO(50) SPEED_VERYLOW
PJ11 TIM1_CH2 TIM1 PWM(2) GPIO(51) SPEED_VERYLOW
PA10 TIM1_CH3 TIM1 PWM(3) GPIO(52) SPEED_VERYLOW
PE14 TIM1_CH4 TIM1 PWM(4) GPIO(53) SPEED_VERYLOW
PC6 TIM3_CH1 TIM3 PWM(5) GPIO(54) SPEED_VERYLOW
PC7 TIM3_CH2 TIM3 PWM(6) GPIO(55) SPEED_VERYLOW
PB0 TIM3_CH3 TIM3 PWM(7) GPIO(56) SPEED_VERYLOW
PB1 TIM3_CH4 TIM3 PWM(8) GPIO(57) SPEED_VERYLOW
PD12 TIM4_CH1 TIM4 PWM(9) GPIO(58) SPEED_VERYLOW
PD13 TIM4_CH2 TIM4 PWM(10) GPIO(59) SPEED_VERYLOW
PD14 TIM4_CH3 TIM4 PWM(11) GPIO(60) SPEED_VERYLOW
PD15 TIM4_CH4 TIM4 PWM(12) GPIO(61) SPEED_VERYLOW
PI5 TIM8_CH1 TIM8 PWM(13) GPIO(62) SPEED_VERYLOW
PI6 TIM8_CH2 TIM8 PWM(14) GPIO(63) SPEED_VERYLOW
PI6 TIM8_CH2 TIM8 PWM(14) GPIO(63) SPEED_VERYLOW
PI7 TIM8_CH3 TIM8 PWM(15) GPIO(64) SPEED_VERYLOW
PI2 TIM8_CH4 TIM8 PWM(16) GPIO(65) SPEED_VERYLOW
PK2 PWM_OE OUTPUT HIGH
PJ12 PWM_OE2 OUTPUT HIGH
PK2 PWM_OE OUTPUT HIGH SPEED_VERYLOW
PJ12 PWM_OE2 OUTPUT HIGH SPEED_VERYLOW

# GPIOs
PE11 FMU_CAP1 INPUT GPIO(66)
Expand All @@ -271,20 +271,20 @@ PB13 CAN2_TX CAN2 SPEED_VERYLOW

# I2C buses
# I2C1, GPS+MAG
PB8 I2C1_SCL I2C1
PB9 I2C1_SDA I2C1
PB8 I2C1_SCL I2C1 SPEED_VERYLOW
PB9 I2C1_SDA I2C1 SPEED_VERYLOW

# I2C2, GPS2+MAG
PF1 I2C2_SCL I2C2
PF0 I2C2_SDA I2C2
PF1 I2C2_SCL I2C2 SPEED_VERYLOW
PF0 I2C2_SDA I2C2 SPEED_VERYLOW

# I2C3, IST8310 Internal
PA8 I2C3_SCL I2C3 SPEED_VERYLOW
PH8 I2C3_SDA I2C3 SPEED_VERYLOW

# I2C4 external
PF14 I2C4_SCL I2C4
PF15 I2C4_SDA I2C4
PF14 I2C4_SCL I2C4 SPEED_VERYLOW
PF15 I2C4_SDA I2C4 SPEED_VERYLOW

# order of I2C buses
I2C_ORDER I2C3 I2C1 I2C2 I2C4
Expand All @@ -303,7 +303,7 @@ COMPASS IST8310 I2C:ALL_INTERNAL:0x0E false ROTATION_YAW_270
COMPASS IST8310 I2C:ALL_EXTERNAL:0x0E true ROTATION_ROLL_180_YAW_90

# armed indication
PB10 nARMED OUTPUT HIGH # TP8
PB10 nARMED OUTPUT HIGH SPEED_VERYLOW # TP8

# microSD support
PD6 SDMMC2_CK SDMMC2 SPEED_VERYLOW
Expand All @@ -316,7 +316,7 @@ define FATFS_HAL_DEVICE SDCD2
PC13 SD_CARD_EN INPUT

# safety
PD10 LED_SAFETY OUTPUT
PD10 LED_SAFETY OUTPUT SPEED_VERYLOW
PJ13 SAFETY_IN INPUT PULLDOWN

# LEDs
Expand Down Expand Up @@ -359,18 +359,18 @@ define EXT_WDOG_INTERVAL_MS 50


# Ethernet
PA1 ETH_RMII_REF_CLK ETH1
PA2 ETH_MDIO ETH1
PA7 ETH_RMII_CRS_DV ETH1
PC1 ETH_MDC ETH1
PC4 ETH_RMII_RXD0 ETH1
PC5 ETH_RMII_RXD1 ETH1
PG11 ETH_RMII_TX_EN ETH1
PG13 ETH_RMII_TXD0 ETH1
PG12 ETH_RMII_TXD1 ETH1
#PJ0 EXT_ETH_POWER_EN ETH1

PJ0 Ethernet_PWR_EN OUTPUT HIGH # disable power on ethernet
PA1 ETH_RMII_REF_CLK ETH1 SPEED_VERYLOW
PA2 ETH_MDIO ETH1 SPEED_VERYLOW
PA7 ETH_RMII_CRS_DV ETH1 SPEED_VERYLOW
PC1 ETH_MDC ETH1 SPEED_VERYLOW
PC4 ETH_RMII_RXD0 ETH1 SPEED_VERYLOW
PC5 ETH_RMII_RXD1 ETH1 SPEED_VERYLOW
PG11 ETH_RMII_TX_EN ETH1 SPEED_VERYLOW
PG13 ETH_RMII_TXD0 ETH1 SPEED_VERYLOW
PG12 ETH_RMII_TXD1 ETH1 SPEED_VERYLOW
#PJ0 EXT_ETH_POWER_EN ETH1

PJ0 Ethernet_PWR_EN OUTPUT HIGH SPEED_VERYLOW # disable power on ethernet

define BOARD_PHY_ID MII_LAN8742A_ID
define BOARD_PHY_RMII
Expand All @@ -382,16 +382,19 @@ define HAL_HAVE_IMU_HEATER 1
define HAL_IMU_TEMP_DEFAULT 45
define HAL_IMUHEAT_P_DEFAULT 50
define HAL_IMUHEAT_I_DEFAULT 0.07
define HAL_IMU_TEMP_MARGIN_LOW_DEFAULT 5
define HAL_IMU_TEMP_MARGIN_LOW_DEFAULT 5

PI13 HEATER_OC OUTPUT LOW GPIO(80)
PI14 HEATER_EN OUTPUT LOW GPIO(81)
define HAL_HEATER_GPIO_PIN 81
PI12 IMU_TEMP_CTL OUTPUT LOW GPIO(80) SPEED_VERYLOW
PI13 5V_HEATER_OC INPUT LOW GPIO(81)
PI14 5V_HEATER_EN OUTPUT LOW GPIO(82) SPEED_VERYLOW
define HAL_IMUHEAT_CTL_GPIO_PIN 80
define HAL_HEATER_OC_GPIO_PIN 81
define HAL_HEATER_ENGPIO_PIN 82

# compensate for magnetic field generated by the heater on CUAV-6X RM3100
define HAL_HEATER_MAG_OFFSET_RM3100 AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_I2C,0,0x20,0x11),Vector3f(-19,37,-24)
# compensate for magnetic field generated by the heater on JFB-x IST8310
define HAL_HEATER_MAG_OFFSET_IST8310_1 AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_I2C,0,0x20,0x11),Vector3f(0,0,0)

# compensate for magnetic field generated by the heater on Holybro6X BMM150
define HAL_HEATER_MAG_OFFSET_BMM150 AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_I2C,0,0x10,0x05),Vector3f(12,-38,23)
# compensate for magnetic field generated by the heater on JFB-X IST8310
define HAL_HEATER_MAG_OFFSET_IST8310_2 AP_HAL::Device::make_bus_id(AP_HAL::Device::BUS_TYPE_I2C,0,0x10,0x05),Vector3f(0,0,0)

define HAL_HEATER_MAG_OFFSET {HAL_HEATER_MAG_OFFSET_RM3100, HAL_HEATER_MAG_OFFSET_BMM150}
define HAL_HEATER_MAG_OFFSET {HAL_HEATER_MAG_OFFSET_IST8310_1, HAL_HEATER_MAG_OFFSET_IST8310_2}

0 comments on commit 1e051ea

Please sign in to comment.