M5Unified
m5::AXP192_Class Class Reference

#include <AXP192_Class.hpp>

Inheritance diagram for m5::AXP192_Class:
Collaboration diagram for m5::AXP192_Class:

Public Member Functions

 AXP192_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...
 
void setDCDC1 (int voltage)
 
void setDCDC2 (int voltage)
 
void setDCDC3 (int voltage)
 
void setLDO0 (int voltage)
 
void setLDO2 (int voltage)
 
void setLDO3 (int voltage)
 
void setGPIO (uint8_t gpio_num, bool state)
 
void setGPIO0 (bool state)
 
void setGPIO1 (bool state)
 
void setGPIO2 (bool state)
 
void setGPIO3 (bool state)
 
void setGPIO4 (bool state)
 
void powerOff (void)
 
void setAdcState (bool enable)
 
void setAdcRate (std::uint8_t rate)
 
void setEXTEN (bool enable)
 
void setBACKUP (bool enable)
 
bool isACIN (void)
 
bool isVBUS (void)
 
bool getBatState (void)
 
bool getEXTEN (void)
 
float getBatteryVoltage (void)
 
float getBatteryDischargeCurrent (void)
 
float getBatteryChargeCurrent (void)
 
float getBatteryPower (void)
 
float getACINVoltage (void)
 
float getACINCurrent (void)
 
float getVBUSVoltage (void)
 
float getVBUSCurrent (void)
 
float getAPSVoltage (void)
 
float getInternalTemperature (void)
 
std::uint8_t getPekPress (void)
 
float getACINVolatge (void)
 
- 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 = 0x34
 

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 AXP192_Class.hpp.

Constructor & Destructor Documentation

◆ AXP192_Class()

m5::AXP192_Class::AXP192_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 AXP192_Class.hpp.

Member Function Documentation

◆ begin()

bool m5::AXP192_Class::begin ( void  )

Definition at line 24 of file AXP192_Class.cpp.

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

◆ getACINCurrent()

float m5::AXP192_Class::getACINCurrent ( void  )

Definition at line 287 of file AXP192_Class.cpp.

◆ getACINVolatge()

float m5::AXP192_Class::getACINVolatge ( void  )
inline

Definition at line 92 of file AXP192_Class.hpp.

Here is the call graph for this function:

◆ getACINVoltage()

float m5::AXP192_Class::getACINVoltage ( void  )

Definition at line 282 of file AXP192_Class.cpp.

Here is the caller graph for this function:

◆ getAPSVoltage()

float m5::AXP192_Class::getAPSVoltage ( void  )

Definition at line 327 of file AXP192_Class.cpp.

◆ getBatState()

bool m5::AXP192_Class::getBatState ( void  )

Definition at line 270 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ getBatteryChargeCurrent()

float m5::AXP192_Class::getBatteryChargeCurrent ( void  )

Definition at line 317 of file AXP192_Class.cpp.

Here is the caller graph for this function:

◆ getBatteryDischargeCurrent()

float m5::AXP192_Class::getBatteryDischargeCurrent ( void  )

Definition at line 322 of file AXP192_Class.cpp.

Here is the caller graph for this function:

◆ getBatteryLevel()

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

Get the remaining battery power.

Returns
0-100 level

Definition at line 191 of file AXP192_Class.cpp.

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

◆ getBatteryPower()

float m5::AXP192_Class::getBatteryPower ( void  )

Definition at line 307 of file AXP192_Class.cpp.

◆ getBatteryVoltage()

float m5::AXP192_Class::getBatteryVoltage ( void  )

Definition at line 312 of file AXP192_Class.cpp.

Here is the caller graph for this function:

◆ getEXTEN()

bool m5::AXP192_Class::getEXTEN ( void  )

Definition at line 242 of file AXP192_Class.cpp.

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

◆ getInternalTemperature()

float m5::AXP192_Class::getInternalTemperature ( void  )

Definition at line 302 of file AXP192_Class.cpp.

◆ getPekPress()

std::uint8_t m5::AXP192_Class::getPekPress ( void  )

Definition at line 275 of file AXP192_Class.cpp.

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

◆ getVBUSCurrent()

float m5::AXP192_Class::getVBUSCurrent ( void  )

Definition at line 297 of file AXP192_Class.cpp.

Here is the caller graph for this function:

◆ getVBUSVoltage()

float m5::AXP192_Class::getVBUSVoltage ( void  )

Definition at line 292 of file AXP192_Class.cpp.

◆ isACIN()

bool m5::AXP192_Class::isACIN ( void  )

Definition at line 261 of file AXP192_Class.cpp.

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

◆ isCharging()

bool m5::AXP192_Class::isCharging ( void  )

Get whether the battery is currently charging or not.

Definition at line 207 of file AXP192_Class.cpp.

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

◆ isVBUS()

bool m5::AXP192_Class::isVBUS ( void  )

Definition at line 265 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ powerOff()

void m5::AXP192_Class::powerOff ( void  )

Definition at line 212 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ setAdcRate()

void m5::AXP192_Class::setAdcRate ( std::uint8_t  rate)

Definition at line 222 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ setAdcState()

void m5::AXP192_Class::setAdcState ( bool  enable)

Definition at line 217 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ setBACKUP()

void m5::AXP192_Class::setBACKUP ( bool  enable)

Definition at line 247 of file AXP192_Class.cpp.

Here is the call graph for this function:

◆ setBatteryCharge()

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

set battery charge enable.

Parameters
enabletrue=enable / false=disable

Definition at line 146 of file AXP192_Class.cpp.

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

◆ setChargeCurrent()

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

set battery charge current

Parameters
max_mAmilli ampere. (100 - 1320).

Definition at line 155 of file AXP192_Class.cpp.

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

◆ setChargeVoltage()

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

set battery charge voltage

Parameters
max_mVmilli volt. (4100 - 4360).

4150mV

4200mV

4360mV

Definition at line 171 of file AXP192_Class.cpp.

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

◆ setDCDC1()

void m5::AXP192_Class::setDCDC1 ( int  voltage)
inline

Definition at line 42 of file AXP192_Class.hpp.

◆ setDCDC2()

void m5::AXP192_Class::setDCDC2 ( int  voltage)
inline

Definition at line 43 of file AXP192_Class.hpp.

◆ setDCDC3()

void m5::AXP192_Class::setDCDC3 ( int  voltage)
inline

Definition at line 44 of file AXP192_Class.hpp.

Here is the caller graph for this function:

◆ setEXTEN()

void m5::AXP192_Class::setEXTEN ( bool  enable)

Definition at line 228 of file AXP192_Class.cpp.

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

◆ setGPIO()

void m5::AXP192_Class::setGPIO ( uint8_t  gpio_num,
bool  state 
)
inline

Definition at line 58 of file AXP192_Class.hpp.

Here is the caller graph for this function:

◆ setGPIO0()

void m5::AXP192_Class::setGPIO0 ( bool  state)
inline

Definition at line 59 of file AXP192_Class.hpp.

◆ setGPIO1()

void m5::AXP192_Class::setGPIO1 ( bool  state)
inline

Definition at line 60 of file AXP192_Class.hpp.

◆ setGPIO2()

void m5::AXP192_Class::setGPIO2 ( bool  state)
inline

Definition at line 61 of file AXP192_Class.hpp.

Here is the caller graph for this function:

◆ setGPIO3()

void m5::AXP192_Class::setGPIO3 ( bool  state)
inline

Definition at line 62 of file AXP192_Class.hpp.

◆ setGPIO4()

void m5::AXP192_Class::setGPIO4 ( bool  state)
inline

Definition at line 63 of file AXP192_Class.hpp.

◆ setLDO0()

void m5::AXP192_Class::setLDO0 ( int  voltage)
inline

set LDOio0 voltage

Parameters
voltagemilli volt. (0 - 3300).

Definition at line 48 of file AXP192_Class.hpp.

◆ setLDO2()

void m5::AXP192_Class::setLDO2 ( int  voltage)
inline

set LDO2 voltage

Parameters
voltagemilli volt. (0 - 3300).

Definition at line 52 of file AXP192_Class.hpp.

Here is the caller graph for this function:

◆ setLDO3()

void m5::AXP192_Class::setLDO3 ( int  voltage)
inline

set LDO3 voltage

Parameters
voltagemilli volt. (0 - 3300).

Definition at line 56 of file AXP192_Class.hpp.

Here is the caller graph for this function:

Member Data Documentation

◆ DEFAULT_ADDRESS

constexpr std::uint8_t m5::AXP192_Class::DEFAULT_ADDRESS = 0x34
staticconstexpr

Definition at line 15 of file AXP192_Class.hpp.


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