Skip to content

Commit

Permalink
Merge pull request #24 from cristidragomir97/master
Browse files Browse the repository at this point in the history
Added modifications to make this library compatible with the Arduino_PowerManagement library
  • Loading branch information
cristidragomir97 authored Feb 26, 2024
2 parents 31a691b + 052a2bd commit 6dbb8ed
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/PF1550.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,10 @@ void PF1550::configCharger(IFastCharge const i_fast_charge,
_control.setInputCurrentLimit (i_input_current_limit);
}

PF1550_Control * PF1550::getControlPointer(){
return &this -> _control;
}

/******************************************************************************
EXTERN DEFINITION
******************************************************************************/
Expand Down
2 changes: 2 additions & 0 deletions src/PF1550.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,8 @@ class PF1550
/* Actual PMIC event ISR handler with access to member variables */
inline void onPMICEvent() { _control.onPMICEvent(); }

PF1550_Control * getControlPointer();


private:
PF1550_Control _control;
Expand Down
5 changes: 5 additions & 0 deletions src/PF1550/PF1550_Control.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,11 @@ void PF1550_Control::setBit(Register const reg, uint8_t const bit_pos)
_io.setBit(reg, bit_pos);
}

void PF1550_Control::clrBit(Register const reg, uint8_t const bit_pos)
{
_io.clrBit(reg, bit_pos);
}

void PF1550_Control::writeReg(Register const reg_addr, uint8_t const val)
{
if (_debug) {
Expand Down
1 change: 1 addition & 0 deletions src/PF1550/PF1550_Control.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ class PF1550_Control
void debug(Stream& stream);

void setBit (Register const reg, uint8_t const bit_pos);
void clrBit(Register const reg, uint8_t const bit_pos);
void writeReg(Register const reg_addr, uint8_t const val);
void readReg (Register const reg_addr, uint8_t * data);

Expand Down

0 comments on commit 6dbb8ed

Please sign in to comment.