From 1ac803ecd2787f48d5dcdd062a5ceb684ae25c79 Mon Sep 17 00:00:00 2001 From: Cristian Dragomir Date: Tue, 20 Feb 2024 14:33:38 +0200 Subject: [PATCH 1/2] added public retrieval of pointer to PF155_Control --- src/PF1550.cpp | 4 ++++ src/PF1550.h | 2 ++ 2 files changed, 6 insertions(+) diff --git a/src/PF1550.cpp b/src/PF1550.cpp index d94495e..cf2a310 100644 --- a/src/PF1550.cpp +++ b/src/PF1550.cpp @@ -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 ******************************************************************************/ diff --git a/src/PF1550.h b/src/PF1550.h index dfc23bb..038cb29 100644 --- a/src/PF1550.h +++ b/src/PF1550.h @@ -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; From 052a2bdb5231e8ced5b608e91485bc504507484e Mon Sep 17 00:00:00 2001 From: Cristian Dragomir Date: Tue, 20 Feb 2024 14:40:44 +0200 Subject: [PATCH 2/2] added clrBit() along with setBit() in PF1550_Control --- src/PF1550/PF1550_Control.cpp | 5 +++++ src/PF1550/PF1550_Control.h | 1 + 2 files changed, 6 insertions(+) diff --git a/src/PF1550/PF1550_Control.cpp b/src/PF1550/PF1550_Control.cpp index dec157b..4a56f7c 100644 --- a/src/PF1550/PF1550_Control.cpp +++ b/src/PF1550/PF1550_Control.cpp @@ -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) { diff --git a/src/PF1550/PF1550_Control.h b/src/PF1550/PF1550_Control.h index 81a36ae..05b6082 100644 --- a/src/PF1550/PF1550_Control.h +++ b/src/PF1550/PF1550_Control.h @@ -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);