M5Unified
m5::IP5306_Class Class Reference

#include <IP5306_Class.hpp>

Inheritance diagram for m5::IP5306_Class:
Collaboration diagram for m5::IP5306_Class:

Public Member Functions

 IP5306_Class (std::uint8_t i2c_addr=DEFAULT_ADDRESS, std::uint32_t freq=400000, I2C_Class *i2c=&In_I2C)
 
bool begin (void)
 
std::int8_t getBatteryLevel (void)
 
void setBatteryCharge (bool enable)
 
void setChargeCurrent (std::uint16_t max_mA)
 
void setChargeVoltage (std::uint16_t max_mV)
 
bool isCharging (void)
 Get whether the battery is currently charging or not. More...
 
bool setPowerBoostKeepOn (bool en)
 Set whether or not to continue supplying power even at low loads. More...
 
- Public Member Functions inherited from m5::I2C_Device
 I2C_Device (std::uint8_t i2c_addr, std::uint32_t freq, I2C_Class *i2c=&In_I2C)
 
void setPort (I2C_Class *i2c)
 
bool writeRegister8 (std::uint8_t reg, std::uint8_t data) const
 
std::uint8_t readRegister8 (std::uint8_t reg) const
 
bool writeRegister8Array (const std::uint8_t *reg_data_array, std::size_t length) const
 
bool writeRegister (std::uint8_t reg, const std::uint8_t *data, std::size_t length) const
 
bool readRegister (std::uint8_t reg, std::uint8_t *result, std::size_t length) const
 
bool bitOn (std::uint8_t reg, std::uint8_t bit) const
 
bool bitOff (std::uint8_t reg, std::uint8_t bit) const
 
bool isEnabled (void) const
 

Static Public Attributes

static constexpr std::uint8_t DEFAULT_ADDRESS = 0x75
 

Additional Inherited Members

- Protected Attributes inherited from m5::I2C_Device
I2C_Class_i2c
 
std::uint32_t _freq
 
std::uint8_t _addr
 
bool _init
 

Detailed Description

Definition at line 11 of file IP5306_Class.hpp.

Constructor & Destructor Documentation

◆ IP5306_Class()

m5::IP5306_Class::IP5306_Class ( std::uint8_t  i2c_addr = DEFAULT_ADDRESS,
std::uint32_t  freq = 400000,
I2C_Class i2c = &In_I2C 
)
inline

Definition at line 17 of file IP5306_Class.hpp.

Member Function Documentation

◆ begin()

bool m5::IP5306_Class::begin ( void  )

Definition at line 30 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ getBatteryLevel()

std::int8_t m5::IP5306_Class::getBatteryLevel ( void  )

Get the remaining battery power.

Returns
0-100 level

Definition at line 45 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ isCharging()

bool m5::IP5306_Class::isCharging ( void  )

Get whether the battery is currently charging or not.

Definition at line 106 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setBatteryCharge()

void m5::IP5306_Class::setBatteryCharge ( bool  enable)

set battery charge enable.

Parameters
enabletrue=enable / false=disable

Definition at line 60 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChargeCurrent()

void m5::IP5306_Class::setChargeCurrent ( std::uint16_t  max_mA)

set battery charge current

Parameters
max_mAmilli ampere. (150 - 3150).

Definition at line 71 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setChargeVoltage()

void m5::IP5306_Class::setChargeVoltage ( std::uint16_t  max_mV)

set battery charge voltage

Parameters
max_mVmilli volt. (4200 - 4400).

4300mV

4350mV

4400mV

Definition at line 83 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ setPowerBoostKeepOn()

bool m5::IP5306_Class::setPowerBoostKeepOn ( bool  en)

Set whether or not to continue supplying power even at low loads.

Definition at line 112 of file IP5306_Class.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ DEFAULT_ADDRESS

constexpr std::uint8_t m5::IP5306_Class::DEFAULT_ADDRESS = 0x75
staticconstexpr

Definition at line 15 of file IP5306_Class.hpp.


The documentation for this class was generated from the following files: