Skip to content

Commit

Permalink
airspeed sensors: set I2C default clock to 400kHz
Browse files Browse the repository at this point in the history
MS4525DO and SDP3X sensors I2C default speed adjusted
100kHz -> 400kHz. Polarfire does not support 100kHz I2C
clock frequency.

Related sensor start workaround removed from airframes
4420, 4421 and 4430. Sensors are started in rc.sensors
when parameters SENS_EN_MS4525DO and SENS_EN_SDP3X are
defined.

Signed-off-by: Tero Salminen <[email protected]>
  • Loading branch information
t-salminen committed May 28, 2024
1 parent f184c8f commit 32bcbdf
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 6 deletions.
4 changes: 3 additions & 1 deletion ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,10 @@ param set-default PWM_AUX_FUNC4 101
param set-default PWM_MAIN_REV 2
param set-default PWM_AUX_REV 2

# Enable airspeed sensor
param set-default SENS_EN_SDP3X 1

# Airspeed parameters
sdp3x start -X -f 400
param set-default ASPD_DO_CHECKS 15
param set-default FW_AIRSPD_MAX 22.0
param set-default FW_AIRSPD_MIN 14.0
Expand Down
1 change: 0 additions & 1 deletion ROMFS/px4fmu_common/init.d/airframes/4421_ssrc_skywalker
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ param set-default PWM_MAIN_FUNC2 202
param set-default PWM_MAIN_FUNC4 101

# Airspeed parameters
ms4525do start -X -f 500
param set-default SENS_EN_MS4525DO 1
param set-default ASPD_DO_CHECKS 15
param set-default FW_AIRSPD_MAX 25.0
Expand Down
4 changes: 2 additions & 2 deletions ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ param set-default PWM_AUX_FUNC5 205
param set-default PWM_AUX_FUNC6 105

# Start airspeed sensor driver
ms4525do start -X -f 500
sdp3x start -X -f 500
param set-default SENS_EN_MS4525DO 1
param set-default SENS_EN_SDP3X 1

# Airspeed parameters
param set-default ASPD_DO_CHECKS 7
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/differential_pressure/ms4525do/MS4525DO.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
#include <uORB/PublicationMulti.hpp>
#include <uORB/topics/differential_pressure.h>

static constexpr uint32_t I2C_SPEED = 100 * 1000; // 100 kHz I2C serial interface
static constexpr uint32_t I2C_SPEED = 400 * 1000; // 400 kHz I2C serial interface
static constexpr uint8_t I2C_ADDRESS_DEFAULT = 0x28;

/* Register address */
Expand Down
2 changes: 1 addition & 1 deletion src/drivers/differential_pressure/sdp3x/SDP3X.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
#define I2C_ADDRESS_2_SDP3X 0x22
#define I2C_ADDRESS_3_SDP3X 0x23

static constexpr uint32_t I2C_SPEED = 100 * 1000; // 100 kHz I2C serial interface
static constexpr uint32_t I2C_SPEED = 400 * 1000; // 400 kHz I2C serial interface

#define SDP3X_SCALE_TEMPERATURE 200.0f
#define SDP3X_RESET_ADDR 0x00
Expand Down

0 comments on commit 32bcbdf

Please sign in to comment.