Skip to content

Commit

Permalink
Attempt 2: Fixing
Browse files Browse the repository at this point in the history
  • Loading branch information
rouing committed Jan 9, 2025
1 parent 3fd047d commit 682217a
Show file tree
Hide file tree
Showing 13 changed files with 897 additions and 1,054 deletions.
32 changes: 16 additions & 16 deletions boards/lilygo-t-embed-cc1101/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ IRAM_ATTR void checkPosition();
#if defined(T_EMBED_1101)
// Power handler for battery detection
#include <Wire.h>
#include <PMIC/PMIC.h>
#include <pmic/pmic.h>
#include <esp32-hal-dac.h>
HAL::PMIC::THIS PMIC;
PMIC pmic;
#elif defined(T_EMBED)
#include <driver/adc.h>
#include <esp_adc_cal.h>
Expand Down Expand Up @@ -48,21 +48,21 @@ void _setup_gpio() {
digitalWrite(PIN_POWER_ON, HIGH); // Power on CC1101 and LED
bool pmu_ret = false;
Wire.begin(GROVE_SDA, GROVE_SCL);
pmu_ret = PMIC.init(Wire, GROVE_SDA, GROVE_SCL, BQ25896_SLAVE_ADDRESS);
pmu_ret = pmic.init(Wire, GROVE_SDA, GROVE_SCL, BQ25896_SLAVE_ADDRESS);
if(pmu_ret) {
PMIC.setSysPowerDownVoltage(3300);
PMIC.setInputCurrentLimit(3250);
Serial.printf("getInputCurrentLimit: %d mA\n",PMIC.getInputCurrentLimit());
PMIC.disableCurrentLimitPin();
PMIC.setChargeTargetVoltage(4208);
PMIC.setPrechargeCurr(64);
PMIC.setChargerConstantCurr(832);
PMIC.getChargerConstantCurr();
Serial.printf("getChargerConstantCurr: %d mA\n",PMIC.getChargerConstantCurr());
PMIC.enableMeasure();
PMIC.enableCharge();
PMIC.enableOTG();
PMIC.disableOTG();
pmic.setSysPowerDownVoltage(3300);
pmic.setInputCurrentLimit(3250);
Serial.printf("getInputCurrentLimit: %d mA\n",pmic.getInputCurrentLimit());
pmic.disableCurrentLimitPin();
pmic.setChargeTargetVoltage(4208);
pmic.setPrechargeCurr(64);
pmic.setChargerConstantCurr(832);
pmic.getChargerConstantCurr();
Serial.printf("getChargerConstantCurr: %d mA\n",pmic.getChargerConstantCurr());
pmic.enableMeasure(HAL::PMIC::MeasureMode::CONTINUOUS);
pmic.enableCharge();
pmic.enableOTG();
pmic.disableOTG();
}
#else
pinMode(BAT_PIN,INPUT); // Battery value
Expand Down
8 changes: 0 additions & 8 deletions lib/HAL/PMIC/DRIVER/AXP192.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace HAL
{
namespace PMIC
{
typedef AXP192 THIS;
class AXP192 : public Type1<class AXP192>
{
friend class Base<Type1<AXP192>, AXP192>;
Expand All @@ -18,13 +17,6 @@ namespace HAL
myADDR = addr;
}

AXP192(uint8_t addr, iic_fptr_t readRegCallback, iic_fptr_t writeRegCallback)
{
thisReadRegCallback = readRegCallback;
thisWriteRegCallback = writeRegCallback;
myADDR = addr;
}

AXP192()
{
myWire = &Wire;
Expand Down
8 changes: 0 additions & 8 deletions lib/HAL/PMIC/DRIVER/AXP202.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace HAL
{
namespace PMIC
{
typedef class AXP202 THIS;
class AXP202 : public Type1<class AXP202>
{
friend class Base<Type1<AXP202>, AXP202>;
Expand Down Expand Up @@ -35,13 +34,6 @@ namespace HAL
this->myADDR = addr;
}

AXP202(uint8_t addr, iic_fptr_t readRegCallback, iic_fptr_t writeRegCallback)
{
this->thisReadRegCallback = readRegCallback;
this->thisWriteRegCallback = writeRegCallback;
this->myADDR = addr;
}

AXP202()
{
this->myWire = &Wire;
Expand Down
8 changes: 0 additions & 8 deletions lib/HAL/PMIC/DRIVER/AXP2101.tpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ namespace HAL
{
namespace PMIC
{
typedef class AXP2101 THIS;
class AXP2101 : public Type1<class AXP2101>
{
friend class Base<Type1<AXP2101>, AXP2101>;
Expand All @@ -18,13 +17,6 @@ namespace HAL
myADDR = addr;
}

AXP2101(uint8_t addr, iic_fptr_t readRegCallback, iic_fptr_t writeRegCallback)
{
thisReadRegCallback = readRegCallback;
thisWriteRegCallback = writeRegCallback;
myADDR = addr;
}

AXP2101()
{
myWire = &Wire;
Expand Down
Loading

0 comments on commit 682217a

Please sign in to comment.