Skip to content

Commit 710a7f3

Browse files
committed
nicla-system: Add more documentation.
1 parent a0b13de commit 710a7f3

File tree

2 files changed

+21
-8
lines changed

2 files changed

+21
-8
lines changed

libraries/Nicla_System/src/Nicla_System.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ BQ25120A nicla::_pmic;
1414
rtos::Mutex nicla::_i2c_mutex;
1515
bool nicla::started = false;
1616
uint8_t nicla::_fastChargeRegisterData = 0;
17+
18+
/// Enabled is the default value also represented in the TS Control Register (Bit 7 = 1).
1719
bool nicla::_ntcEnabled = true;
1820

1921
void nicla::pingI2C() {

libraries/Nicla_System/src/Nicla_System.h

Lines changed: 19 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
#include <mbed.h>
99
#include <I2C.h>
1010

11+
// Deprecated. Whether or not to use a write operation by default
12+
// can now be controlled with the default paramter of pingI2C().
1113
#define USE_FASTCHG_TO_KICK_WATCHDOG 1
1214

1315
enum class OperatingStatus {
@@ -38,6 +40,15 @@ enum class BatteryTemperature {
3840
class nicla {
3941

4042
public:
43+
44+
/**
45+
* @brief Initializes the Nicla Sense ME board.
46+
*
47+
* @param mountedOnMkr Defines whether the board is mounted as a shield on a MKR board or not.
48+
* This is used to drive the pin high that connects to the reset pin
49+
* of the MKR board to prevent it from resetting.
50+
* @return true if the board is initialized successfully.
51+
*/
4152
static bool begin(bool mountedOnMkr = false);
4253

4354
/**
@@ -81,9 +92,9 @@ class nicla {
8192
* A safe default charging current value that works for most common LiPo batteries is 0.5C, which means charging at a rate equal to half of the battery's capacity.
8293
* For example, a 200mAh battery could be charged at 100mA (0.1A).
8394
* This charging rate is generally safe for most LiPo batteries and provides a good balance between charging speed and battery longevity.
84-
* @note Make sure to call setBatteryNTCEnabled(false) if your battery does not have an NTC thermistor.
85-
* Otherwise the charging will be disabled due to the NTC thermistor not being connected.
95+
* @note If your battery doesn't have an NTC thermistor, the charging speed will be limited to ~35mA.
8696
* @return true If the fast charging is enabled successfully. False, otherwise.
97+
* @see disableCharging()
8798
*/
8899
static bool enableCharging(uint16_t mA = 20);
89100

@@ -159,13 +170,13 @@ class nicla {
159170
static BatteryChargeLevel getBatteryChargeLevel();
160171

161172
/**
162-
* @brief Get the Battery Temperature. The following values are possible:
163-
* "Normal", "Extreme", "Cool", "Warm".
173+
* @brief Get the Battery Temperature using the negative temperature coefficient (NTC) thermistor.
174+
* The following values are possible: "Normal", "Extreme", "Cool", "Warm".
164175
* When the battery is cool, the charging current is reduced by half.
165176
* When the battery is warm, the charging current is reduced by 140 mV.
166177
* When the battery is unter an extreme temperature (hot or cold), the charging is suspended.
167-
* @note If the battery doesn't have a negative temperature coefficient (NTC) thermistor, the temperature is always "Normal".
168-
* This is not determined automatically and needs to be set using the setBatteryNTCEnabled() function.
178+
* @note If the battery isn't configured to have a NTC, the temperature is reported as "Normal".
179+
* The presence of the NTC is not determined automatically and needs to be set using the setBatteryNTCEnabled() function.
169180
* @see setBatteryNTCEnabled()
170181
* @return BatteryTemperature The battery temperature represented by one of the following constants:
171182
* BatteryTemperature::Normal, BatteryTemperature::Extreme, BatteryTemperature::Cool, BatteryTemperature::Warm
@@ -188,12 +199,12 @@ class nicla {
188199

189200
/**
190201
* @brief Get the current operating status of the PMIC.
191-
* @note If it doesn't report 'Charging' even though you enabled charging with enableCharging(),
192-
* you may need to disable the NTC thermistor with setBatteryNTCEnabled(false) in case your battery doesn't have one.
202+
* @note If it doesn't report 'Charging' even though you enabled charging with enableCharging(), the battery might be full.
193203
* @return OperatingStatus One of the following: Ready, Charging, ChargingComplete, Error.
194204
*/
195205
static OperatingStatus getOperatingStatus();
196206

207+
/// Provides access to the IS31FL3194 LED driver that drives the RGB LED.
197208
static RGBled leds;
198209
static BQ25120A _pmic;
199210

0 commit comments

Comments
 (0)