Skip to content

Commit f222072

Browse files
committed
Nicla_System: add enterShipMode()
1 parent 799c97a commit f222072

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,17 @@ bool nicla::disableLDO()
8585
return true;
8686
}
8787

88+
bool nicla::enterShipMode()
89+
{
90+
// STATUS reg:
91+
// | B7 | B6 | B5 | B4 | B3 | B2 | B1 | B0 |
92+
// | RO | RO | EN_SHIPMODE | RO | RO | RO | RO | RO |
93+
94+
uint8_t status_reg = _pmic.getStatus();
95+
status_reg |= 0x20;
96+
_pmic.writeByte(BQ25120A_ADDRESS, BQ25120A_STATUS, status_reg);
97+
}
98+
8899
uint8_t nicla::readLDOreg()
89100
{
90101
uint8_t ldo_reg = _pmic.readByte(BQ25120A_ADDRESS, BQ25120A_LDO_CTRL);

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ class nicla {
1515
static bool enable3V3LDO();
1616
static bool enable1V8LDO();
1717
static bool disableLDO();
18+
static bool enterShipMode();
1819

1920
static RGBled leds;
2021
static BQ25120A _pmic;

0 commit comments

Comments
 (0)