diff --git a/mbed-os b/mbed-os index 699437e..031d274 160000 --- a/mbed-os +++ b/mbed-os @@ -1 +1 @@ -Subproject commit 699437ecf9bcebad4d5364436c0f0ccfb0efd00a +Subproject commit 031d274c62cc71b4c5a24fd66d3a9e164bb07f1c diff --git a/src/ChemIDMeasurer.cpp b/src/ChemIDMeasurer.cpp index 68fb003..dfd771f 100644 --- a/src/ChemIDMeasurer.cpp +++ b/src/ChemIDMeasurer.cpp @@ -8,19 +8,16 @@ #include "pins.h" ChemIDMeasurer::ChemIDMeasurer(): -soc(p9, p10, 100000), -acpPin(p22), -chgPin(p23), -progPin(p15), -shdnPin(p21) +i2c(BQ34_I2C_SDA, BQ34_I2C_SCL), +soc(i2c, 100000), +chgPin(ACTIVATE_CHARGER_PIN), +shdnPin(CHARGE_STATUS_PIN) { //Initially keep charger in shdn shdnPin.write(1); - // Disable MCU pullup resistors as they are enough to screw with the signal value. + // Disable MCU pullup resistors chgPin.mode(PinMode::PullNone); - acpPin.mode(PinMode::PullNone); - progPin.mode(PinMode::PullNone); } void ChemIDMeasurer::activateCharger() diff --git a/src/ChemIDMeasurer.h b/src/ChemIDMeasurer.h index 7913e73..ab85614 100644 --- a/src/ChemIDMeasurer.h +++ b/src/ChemIDMeasurer.h @@ -9,12 +9,11 @@ class ChemIDMeasurer { + I2C i2c; BQ34Z100 soc; // charger control pins - DigitalIn acpPin; DigitalIn chgPin; - DigitalIn progPin; DigitalOut shdnPin; Timer totalTimer; diff --git a/src/SOCTestSuite.cpp b/src/SOCTestSuite.cpp index 1e565d7..665a5bf 100644 --- a/src/SOCTestSuite.cpp +++ b/src/SOCTestSuite.cpp @@ -6,7 +6,7 @@ #include -I2C i2c(I2C_SDA, I2C_SCL); +I2C i2c(BQ34_I2C_SDA, BQ34_I2C_SCL); BQ34Z100 soc(i2c, 100000); DigitalIn chgPin(CHARGE_STATUS_PIN); diff --git a/src/pins.h b/src/pins.h index 2c7c8e8..dc7e039 100644 --- a/src/pins.h +++ b/src/pins.h @@ -2,8 +2,8 @@ #define BQ34Z100G1_UTILS_PINS_H // Change these pin names to match how the BQ34 is connected on your processor -#define I2C_SDA PB_9 -#define I2C_SCL PB_8 +#define BQ34_I2C_SDA PB_9 +#define BQ34_I2C_SCL PB_8 // Pin which activates the charger. Used for the Chem ID Measurer and some other tests #define ACTIVATE_CHARGER_PIN PF_1