feat(drivers/dps310): accept DPS368 product ID

The Infineon DPS310 and DPS368 are register-compatible; only their
product-ID register value differs (DPS310 = 0x10, DPS368 = 0x11).
Recognise both in the init check so the same driver instance can be
used for either part on boards that fit a DPS368.

Signed-off-by: Julian Oes <julian@oes.ch>
This commit is contained in:
Julian Oes committed 2026-09-11 15:10:50 +12:00
1 parent 5313fe3bc7
commit e20d0e0956
2 files changed
+9 -3

No files matched your search

+5 -2
View File
@@ -67,8 +67,11 @@ DPS310::~DPS310()
int
DPS310::init()
{
if (RegisterRead(Register::ID) != Infineon_DPS310::REV_AND_PROD_ID) {
PX4_ERR("Product_ID mismatch");
const uint8_t prod_id = RegisterRead(Register::ID);
if (prod_id != Infineon_DPS310::REV_AND_PROD_ID_DPS310 &&
prod_id != Infineon_DPS310::REV_AND_PROD_ID_DPS368) {
PX4_ERR("Product_ID mismatch (got 0x%02x)", prod_id);
return PX4_ERROR;
}
@@ -46,7 +46,10 @@ static constexpr uint8_t Bit7 = (1 << 7);
namespace Infineon_DPS310
{
static constexpr uint8_t REV_AND_PROD_ID = 0x10;
// Product ID register value: 0x10 for DPS310, 0x11 for DPS368
// (the two parts are register-compatible; the same driver handles both)
static constexpr uint8_t REV_AND_PROD_ID_DPS310 = 0x10;
static constexpr uint8_t REV_AND_PROD_ID_DPS368 = 0x11;
enum class
Register : uint8_t {