File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
libraries/Nicla_System/src Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -25,10 +25,37 @@ class BQ25120A
25
25
public:
26
26
BQ25120A () {};
27
27
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
+ */
28
34
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
+ */
29
42
uint8_t getFaultsRegister ();
30
43
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
+ */
31
50
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
+ */
32
59
uint8_t readByte (uint8_t address, uint8_t subAddress);
33
60
34
61
private:
Original file line number Diff line number Diff line change @@ -172,7 +172,14 @@ class nicla {
172
172
* This ensures that the fast charge settings as specified via enableCharge() are applied again the register got wiped.
173
173
*/
174
174
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
+ **/
175
180
static uint8_t _fastChargeRegisterData;
181
+
182
+ // / Mutex to prevent concurrent access to the I2C interface.
176
183
static rtos::Mutex _i2c_mutex;
177
184
};
178
185
You can’t perform that action at this time.
0 commit comments