SparkFun_smol_Power_Board_Arduino_Library
Public Member Functions | List of all members
smolPowerLiPo Class Reference

#include <SparkFun_smol_Power_Board.h>

Inheritance diagram for smolPowerLiPo:
sfeSmolPowerBoard

Public Member Functions

 smolPowerLiPo ()
 Create an object to communicate with the SparkFun smôl Power Board LiPo.
 
bool begin (byte deviceAddress=SFE_SMOL_POWER_DEFAULT_I2C_ADDRESS, TwoWire &wirePort=Wire)
 
float getBatteryVoltage ()
 
- Public Member Functions inherited from sfeSmolPowerBoard
bool isConnected ()
 Class to communicate with the SparkFun smôl Power Boards. More...
 
bool setI2CAddress (byte address)
 Change the smôl Power Board AAA's I2C address. You will need to call .begin again using the new address to re-establish communication with the Power Board. More...
 
byte getI2CAddress ()
 Just for fun, read back the Power Board's I2C address. This proves that I2C communication is possible and that the Power Board has the correct address stored in eeprom. More...
 
byte getResetReason ()
 Read the reason for the ATtiny's most recent reset. More...
 
float getTemperature ()
 Read the ATtiny's internal temperature.
TO DO: Add temperature calibration / correction functionality. More...
 
float measureVCC ()
 Measure the ATtiny43U's VCC by reading the 1.1V internal reference via the ADC. More...
 
bool setADCVoltageReference (sfe_power_board_ADC_ref_e ref)
 Set the ATtiny43U's ADC voltage reference to VCC or the internal 1.1V reference. More...
 
sfe_power_board_ADC_ref_e getADCVoltageReference ()
 Get the ATtiny43U's ADC voltage reference: VCC or the internal 1.1V reference. More...
 
bool setWatchdogTimerPrescaler (sfe_power_board_WDT_prescale_e prescaler)
 Set the ATtiny43U's Watchdog Timer prescaler to set the WDT interrupt rate. More...
 
sfe_power_board_WDT_prescale_e getWatchdogTimerPrescaler ()
 Get the ATtiny43U's Watchdog Timer prescaler setting. More...
 
bool setPowerdownDurationWDTInts (uint16_t duration)
 Set the Power Board Power-down duration in Watchdog Timer interrupts. More...
 
bool getPowerDownDurationWDTInts (uint16_t *duration)
 Get the Power Board Power-down duration in Watchdog Timer interrupts. More...
 
bool powerDownNow ()
 Power down the system now. The smôl bus power will be disabled. The ATtiny43U will wake up and turn the power back on after SFE_SMOL_POWER_REGISTER_POWERDOWN_DURATION WDT interrupts. More...
 
byte getFirmwareVersion ()
 Get the Power Board firmware version. More...
 
byte computeCRC8 (byte data[], byte len)
 Given an array of bytes, this calculates the CRC8 for those bytes. From: http://www.sunshine2k.de/articles/coding/crc/understanding_crc.html Tested with: http://www.sunshine2k.de/coding/javascript/crc/crc_js.html x^8+x^5+x^4+1 = 0x31. More...
 

Additional Inherited Members

- Public Attributes inherited from sfeSmolPowerBoard
SMOL_POWER_BOARD_IO smolPowerBoard_io
 

Detailed Description

Communication interface for the SparkFun smôl Power Board LiPo

Member Function Documentation

◆ getBatteryVoltage()

float smolPowerLiPo::getBatteryVoltage ( )

This function reads the battery voltage from the MAX_17048 fuel gauge.


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