Added STM32 platform for debugging and development

This commit is contained in:
Emanuele Trabattoni
2025-06-27 18:55:20 +02:00
parent 01db0e543f
commit 3d2d44c0bb
9 changed files with 171 additions and 94 deletions

View File

@@ -13,7 +13,7 @@ namespace drivers
{
if (m_i2c.write(m_address, reg, {val}))
return true;
log_e("Unable to write register: reg[%d], val[%d] ", reg, val);
LOG_ERROR("Unable to write register: reg[%d], val[%d] ", reg, val);
return false;
}
@@ -25,7 +25,7 @@ namespace drivers
val = data.back();
return true;
}
log_e("Unable to read register: reg[%d]");
LOG_ERROR("Unable to read register: reg[%d]");
return false;
}
@@ -34,9 +34,9 @@ namespace drivers
uint8_t currState(0);
uint8_t newState(0);
if (ch < EXIO_PIN1 || ch > EXIO_PIN8)
if (ch < OUT_PIN1 || ch > OUT_PIN8)
{
log_e("Invalid write to output channel: [%d]", ch);
LOG_ERROR("Invalid write to output channel: [%d]", ch);
return false;
}
if (!readPort(currState))
@@ -52,16 +52,16 @@ namespace drivers
{
if (writeRegister(TCA9554_OUTPUT_REG, state))
return true;
log_e("Unable to write IO port: state[%02x]", state);
LOG_ERROR("Unable to write IO port: state[%02x]", state);
return false;
}
const bool TCA9554PWR::readOut(const uint8_t ch)
{
uint8_t currState(0);
if (ch < EXIO_PIN1 || ch > EXIO_PIN8)
if (ch < OUT_PIN1 || ch > OUT_PIN8)
{
log_e("Invalid read to output channel: [%d]", ch);
LOG_ERROR("Invalid read to output channel: [%d]", ch);
return false;
}
if (!readPort(currState))
@@ -73,7 +73,7 @@ namespace drivers
{
if (readRegister(TCA9554_INPUT_REG, state))
return true;
log_e("Unable to read IO port: state[%02x]", state);
LOG_ERROR("Unable to read IO port: state[%02x]", state);
return false;
}