This is a library for the MAX17055 Li+ Battery Fuel Gauge.
Dependents: Low_Power_Long_Distance_IR_Vision_Robot MAX17055_EZconfig MAX17055_EZconfig_Sample Low_Power_Long_Distance_IR_Vision_Robot
Fork of max17055 by
Diff: max17055.h
- Revision:
- 2:ff7db397b70f
- Parent:
- 1:a031f0c6a71e
- Child:
- 3:f77a8345b0e3
diff -r a031f0c6a71e -r ff7db397b70f max17055.h --- a/max17055.h Thu Sep 21 22:35:39 2017 +0000 +++ b/max17055.h Sun Sep 24 19:32:14 2017 +0000 @@ -36,6 +36,10 @@ // Include #include "mbed.h" +/* STATUS register bits */ +#define MAX17055_STATUS_BST (1 << 3) +#define MAX17055_STATUS_POR (1 << 1) + /** * @brief Library for the MAX17055\n @@ -246,8 +250,56 @@ ~MAX17055(); + /** + * \brief Write and Verify a MAX17055 register + * \par Details + * This function wites and verifies if the writing process was successful + * + * \param[in] reg_addr - register address + * \param[out] reg_data - the variable that contains the data to write + * to the register address + * + * \retval 1 on success + * -1 if write errors + * -2 if read errors + * -3 if data curruption + * + */ + + + int write_and_verify_reg(Registers_e reg_addr, uint16_t reg_data); + + /** + * \brief Initialise Function for MAX17055 + * \par Details + * This function intitializes the MAX17055 + * + * \retval 1 on success + * -1 if errors exist + */ + + + int init(); + + //////////////////////////////////////////////////////////////////////////////// -//protected: +/** + * \brief Get Internal Temperature Function for MAX17055 + * \par Details + * This function sends a request to access the internal + * of the MAX17055 + * + * \param[out] *temp - pointer? or Reference? to the volue of the temperature + * \retval 1 on success + * 0 on success + * -1 if errors exist + */ + + + int get_temperature(int *temp); + + +protected: /** * @brief Write Register * @details Writes data to max17055 Register @@ -265,23 +317,9 @@ */ int32_t readReg(Registers_e reg_addr, uint16_t &value); - /** - * \brief Write and Verify a MAX17055 register - * \par Details - * This function wites and verifies if the writing process was successful - * - * \param[in] reg_addr - register address - * \param[out] reg_data - the variable that contains the data to write - * to the register address - * - * \retval 1 on success - * -1 if errors exist - */ - - - int write_and_verify_reg(Registers_e reg_addr, uint16_t reg_data); + - + private: