Skip to content

Commit 03cbd92

Browse files
committed
nicla-system: Add documentation.
1 parent edaf109 commit 03cbd92

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

libraries/Nicla_System/src/BQ25120A.h

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,37 @@ class BQ25120A
2525
public:
2626
BQ25120A() {};
2727

28+
/**
29+
* @brief Gets the data from the status register.
30+
* @see Section 9.6.1 of the datasheet.
31+
*
32+
* @return uint8_t The data from the status register.
33+
*/
2834
uint8_t getStatusRegister();
35+
36+
/**
37+
* @brief Gets the data from the faults register.
38+
* @see Section 9.6.2 of the datasheet.
39+
*
40+
* @return uint8_t The data from the faults register.
41+
*/
2942
uint8_t getFaultsRegister();
3043

44+
/**
45+
* @brief Writes a byte to the BQ25120A over I2C.
46+
* @param address The I2C address of the BQ25120A.
47+
* @param subAddress The memory location of the register to write to.
48+
* @param data The data to write to the register.
49+
*/
3150
void writeByte(uint8_t address, uint8_t subAddress, uint8_t data);
51+
52+
/**
53+
* @brief Reads a byte from the BQ25120A over I2C.
54+
*
55+
* @param address The I2C address of the BQ25120A.
56+
* @param subAddress The memory location of the register to read from.
57+
* @return uint8_t The data read from the register.
58+
*/
3259
uint8_t readByte(uint8_t address, uint8_t subAddress);
3360

3461
private:

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -172,7 +172,14 @@ class nicla {
172172
* This ensures that the fast charge settings as specified via enableCharge() are applied again the register got wiped.
173173
*/
174174
static void synchronizeFastChargeSettings();
175+
176+
/**
177+
* A cached version of the fast charge settings for the PMIC.
178+
* This is used to reapply the settings if the register got wiped.
179+
**/
175180
static uint8_t _fastChargeRegisterData;
181+
182+
/// Mutex to prevent concurrent access to the I2C interface.
176183
static rtos::Mutex _i2c_mutex;
177184
};
178185

0 commit comments

Comments
 (0)