Skip to content

Commit 6ab5b66

Browse files
committed
nicla-system: Add documentation to LDO functions.
1 parent ad89fb1 commit 6ab5b66

File tree

2 files changed

+22
-1
lines changed

2 files changed

+22
-1
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,7 @@ bool nicla::enable1V8LDO()
8484
bool nicla::disableLDO()
8585
{
8686
uint8_t ldo_reg = _pmic.getLDOControlRegister();
87-
ldo_reg &= 0x7F;
87+
ldo_reg &= 0x7F; // Zeroes the EN_LS_LDO bit to turn it off
8888
_pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_LDO_CTRL, ldo_reg);
8989
return _pmic.getLDOControlRegister() == ldo_reg;
9090
}

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,29 @@ class nicla {
3939

4040
public:
4141
static bool begin(bool mountedOnMkr = false);
42+
43+
/**
44+
* @brief Enables the 3.3V LDO voltage regulator.
45+
*
46+
* @return true if the LDO is enabled successfully.
47+
* This is done by verifying that the register was written correctly.
48+
*/
4249
static bool enable3V3LDO();
50+
51+
/**
52+
* @brief Enables the 1.8V LDO voltage regulator.
53+
*
54+
* @return true if the LDO is enabled successfully.
55+
* This is done by verifying that the register was written correctly.
56+
*/
4357
static bool enable1V8LDO();
58+
59+
/**
60+
* @brief Disables the LDO voltage regulator.
61+
*
62+
* @return true if the LDO is disabled successfully.
63+
* This is done by verifying that the register was written correctly.
64+
*/
4465
static bool disableLDO();
4566

4667
/**

0 commit comments

Comments
 (0)