Dcdccoulombcounter#
Modules#
sl_hal_dcdc_coulomb_counter_config_t
sl_hal_dcdc_coulomb_counter_calibration_config_t
Enumerations#
DCDC_COULOMB_COUNTER supported energy mode.
DCDC_COULOMB_COUNTER Calibration Load Current Level setting.
Functions#
Initializes DCDC_COULOMB_COUNTER module.
Enables DCDC_COULOMB_COUNTER module.
Disables DCDC_COULOMB_COUNTER module.
Waits for the DCDC_COULOMB_COUNTER to complete START command.
Waits for the DCDC_COULOMB_COUNTER to complete STOP command.
Waits for the DCDC_COULOMB_COUNTER to complete CLR command.
Starts DCDC_COULOMB_COUNTER operation.
Stops the DCDC_COULOMB_COUNTER operation.
Clears the DCDC_COULOMB_COUNTER counters.
Gets the DCDC_COULOMB_COUNTER count for the selected energy mode.
Gets DCDC_COULOMB_COUNTER STATUS register value.
Enables one or more DCDC_COULOMB_COUNTER interrupts.
Disables one or more DCDC_COULOMB_COUNTER interrupts.
Clears one or more pending DCDC_COULOMB_COUNTER interrupts.
Gets pending DCDC_COULOMB_COUNTER interrupt flags.
Gets enabled and pending DCDC_COULOMB_COUNTER interrupt flags.
Sets one or more pending DCDC_COULOMB_COUNTER interrupts from Software.
Initializes the calibration of the DCDC Coulomb Counter.
Starts DCDC_COULOMB_COUNTER calibration sequence.
Stops DCDC_COULOMB_COUNTER calibration sequence.
Enables the Calibration Load.
Disables the Calibration Load.
Sets the Calibration Load level.
Gets the calibration load current from the stored value in DEVINFO as measured during production testing.
Gets the frequency (in Hz) of the CMU Calibration Up-Counter source.
Sets the calibration Halt Flag.
Gets the calibration Halt Flag.
Macros#
Suggested default values for DCDC_COULOMB_COUNTER configuration structure.
Suggested default values for DCDC_COULOMB_COUNTER calibration configuration structure.
Enumeration Documentation#
sl_hal_dcdc_coulomb_counter_emode_t#
sl_hal_dcdc_coulomb_counter_emode_t
DCDC_COULOMB_COUNTER supported energy mode.
Enumerator | |
---|---|
SL_HAL_DCDC_COULOMB_COUNTER_EM0 | EM0/1 energy mode. |
SL_HAL_DCDC_COULOMB_COUNTER_EM2 | EM2/3 energy mode. |
58
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_calibration_load_level_t#
sl_hal_dcdc_coulomb_counter_calibration_load_level_t
DCDC_COULOMB_COUNTER Calibration Load Current Level setting.
Enumerator | |
---|---|
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD0 | Nominal Load 0.25mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD1 | Nominal Load 0.50mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD2 | Nominal Load 1.00mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD3 | Nominal Load 1.50mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD4 | Nominal Load 2.00mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD5 | Nominal Load 4.00mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD6 | Nominal Load 6.00mA. |
SL_HAL_DCDC_COULOMB_COUNTER_CAL_LOAD7 | Nominal Load 8.00mA. |
64
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
Function Documentation#
sl_hal_dcdc_coulomb_counter_init#
void sl_hal_dcdc_coulomb_counter_init (const sl_hal_dcdc_coulomb_counter_config_t * p_config)
Initializes DCDC_COULOMB_COUNTER module.
[in] | p_config | A pointer to the DCDC_COULOMB_COUNTER initialization structure variable. |
119
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_enable#
void sl_hal_dcdc_coulomb_counter_enable (void )
Enables DCDC_COULOMB_COUNTER module.
N/A |
124
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_disable#
void sl_hal_dcdc_coulomb_counter_disable (void )
Disables DCDC_COULOMB_COUNTER module.
N/A |
133
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_wait_start#
void sl_hal_dcdc_coulomb_counter_wait_start (void )
Waits for the DCDC_COULOMB_COUNTER to complete START command.
N/A |
138
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_wait_stop#
void sl_hal_dcdc_coulomb_counter_wait_stop (void )
Waits for the DCDC_COULOMB_COUNTER to complete STOP command.
N/A |
149
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_wait_clear_counters#
void sl_hal_dcdc_coulomb_counter_wait_clear_counters (void )
Waits for the DCDC_COULOMB_COUNTER to complete CLR command.
N/A |
160
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_start#
void sl_hal_dcdc_coulomb_counter_start (void )
Starts DCDC_COULOMB_COUNTER operation.
N/A |
Note
This function will send a start command to the DCDC_COULOMB_COUNTER peripheral. The sl_hal_dcdc_coulomb_counter_wait_start() function can be used to wait for the start command to be executed.
This function requires the DCDC_COULOMB_COUNTER to be enabled.
177
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_stop#
void sl_hal_dcdc_coulomb_counter_stop (void )
Stops the DCDC_COULOMB_COUNTER operation.
N/A |
Note
This function will send a stop command to the DCDC_COULOMB_COUNTER peripheral. The sl_hal_dcdc_coulomb_counter_wait_stop() function can be used to wait for the stop command to be executed.
This function requires the DCDC_COULOMB_COUNTER to be enabled.
192
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_clear_counters#
void sl_hal_dcdc_coulomb_counter_clear_counters (void )
Clears the DCDC_COULOMB_COUNTER counters.
N/A |
Note
This function will send a clear command to the DCDC_COULOMB_COUNTER peripheral. The sl_hal_dcdc_coulomb_counter_wait_clear_counters() function can be used to wait for the clear command to be executed.
This function requires the DCDC_COULOMB_COUNTER to be enabled.
207
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_count#
uint32_t sl_hal_dcdc_coulomb_counter_get_count (sl_hal_dcdc_coulomb_counter_emode_t emode)
Gets the DCDC_COULOMB_COUNTER count for the selected energy mode.
[in] | emode | The energy mode requested will select the appropriate counter. |
Returns
Coulomb Counter Count Value.
220
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_status#
uint32_t sl_hal_dcdc_coulomb_counter_get_status (void )
Gets DCDC_COULOMB_COUNTER STATUS register value.
N/A |
Returns
Current STATUS register value.
227
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_enable_interrupts#
void sl_hal_dcdc_coulomb_counter_enable_interrupts (uint32_t flags)
Enables one or more DCDC_COULOMB_COUNTER interrupts.
[in] | flags | DCDC_COULOMB_COUNTER interrupt sources to enable. Use a set of interrupt flags OR-ed together to set multiple interrupt sources. |
Note
Depending on the use, a pending interrupt may already be set prior to enabling the interrupt. To ignore a pending interrupt, consider using sl_hal_dcdc_coulomb_counter_clear_interrupts() prior to enabling the interrupt.
243
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_disable_interrupts#
void sl_hal_dcdc_coulomb_counter_disable_interrupts (uint32_t flags)
Disables one or more DCDC_COULOMB_COUNTER interrupts.
[in] | flags | DCDC_COULOMB_COUNTER interrupt sources to disable. Use a set of interrupt flags OR-ed together to disable multiple interrupt sources. |
255
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_clear_interrupts#
void sl_hal_dcdc_coulomb_counter_clear_interrupts (uint32_t flags)
Clears one or more pending DCDC_COULOMB_COUNTER interrupts.
[in] | flags | DCDC_COULOMB_COUNTER interrupt sources to clear. Use a set of interrupt flags OR-ed together to clear multiple interrupt sources. |
267
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_interrupts#
uint32_t sl_hal_dcdc_coulomb_counter_get_interrupts (void )
Gets pending DCDC_COULOMB_COUNTER interrupt flags.
N/A |
Note
Event bits are not cleared by using this function.
Returns
Pending DCDC_COULOMB_COUNTER interrupt sources. Returns a set of interrupt flags OR-ed together for multiple interrupt sources.
281
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_enabled_interrupts#
uint32_t sl_hal_dcdc_coulomb_counter_get_enabled_interrupts (void )
Gets enabled and pending DCDC_COULOMB_COUNTER interrupt flags.
N/A |
Useful for handling more interrupt sources in the same interrupt handler.
Note
Interrupt flags are not cleared by using this function.
Returns
Pending and enabled DCDC_COULOMB_COUNTER interrupt sources. The return value is the bitwise AND of
the enabled interrupt sources in DCDC_COULOMB_COUNTER_IEN and
the pending interrupt flags DCDC_COULOMB_COUNTER_IF.
297
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_set_interrupts#
void sl_hal_dcdc_coulomb_counter_set_interrupts (uint32_t flags)
Sets one or more pending DCDC_COULOMB_COUNTER interrupts from Software.
[in] | flags | DCDC_COULOMB_COUNTER interrupt sources to set to pending. Use a set of interrupt flags OR-ed together to set multiple interrupt sources. |
312
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_cal_init#
void sl_hal_dcdc_coulomb_counter_cal_init (sl_hal_dcdc_coulomb_counter_calibration_config_t config)
Initializes the calibration of the DCDC Coulomb Counter.
[in] | config | DCDC_COULOMB_COUNTER calibration configuration structure. |
Note
The charge per pulse is measured using known on-chip calibration loads, a PRS channel, and the CMU RC oscillator calibration circuitry.
325
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_cal_start#
void sl_hal_dcdc_coulomb_counter_cal_start (void )
Starts DCDC_COULOMB_COUNTER calibration sequence.
N/A |
330
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_cal_stop#
void sl_hal_dcdc_coulomb_counter_cal_stop (void )
Stops DCDC_COULOMB_COUNTER calibration sequence.
N/A |
Note
The Calibration Load will be disabled.
337
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_enable_cal_load#
void sl_hal_dcdc_coulomb_counter_enable_cal_load (void )
Enables the Calibration Load.
N/A |
342
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_disable_cal_load#
void sl_hal_dcdc_coulomb_counter_disable_cal_load (void )
Disables the Calibration Load.
N/A |
347
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_set_cal_load_level#
void sl_hal_dcdc_coulomb_counter_set_cal_load_level (sl_hal_dcdc_coulomb_counter_emode_t emode, sl_hal_dcdc_coulomb_counter_calibration_load_level_t load_level)
Sets the Calibration Load level.
[in] | emode | The energy mode requested will adjust the compensation circuit. |
[in] | load_level | The load level to adjust the load current. |
355
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_cal_load_current#
uint16_t sl_hal_dcdc_coulomb_counter_get_cal_load_current (sl_hal_dcdc_coulomb_counter_calibration_load_level_t load_level)
Gets the calibration load current from the stored value in DEVINFO as measured during production testing.
[in] | load_level | The load level requested. |
Returns
The calibration load current.
Note
The returned value can be converted into uA by dividing by 5.
Each calibration load setting is a 16-bit value with each LSB representing 200 nA.
371
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_get_cal_reference_freq#
uint32_t sl_hal_dcdc_coulomb_counter_get_cal_reference_freq (void )
Gets the frequency (in Hz) of the CMU Calibration Up-Counter source.
N/A |
Returns
The frequency (in Hz) of the currently selected CMU Up-Counter clock source.
379
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_set_calhalt#
void sl_hal_dcdc_coulomb_counter_set_calhalt (void )
Sets the calibration Halt Flag.
N/A |
384
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
sl_hal_dcdc_coulomb_counter_calhalt_is_set#
bool sl_hal_dcdc_coulomb_counter_calhalt_is_set (void )
Gets the calibration Halt Flag.
N/A |
Returns
true if Halt Flag is set.
394
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
Macro Definition Documentation#
DCDC_COULOMB_COUNTER_CONFIG_DEFAULT#
#define DCDC_COULOMB_COUNTER_CONFIG_DEFAULTValue:
Suggested default values for DCDC_COULOMB_COUNTER configuration structure.
94
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h
DCDC_COULOMB_COUNTER_CALIBRATION_CONFIG_DEFAULT#
#define DCDC_COULOMB_COUNTER_CALIBRATION_CONFIG_DEFAULTValue:
Suggested default values for DCDC_COULOMB_COUNTER calibration configuration structure.
101
of file platform/peripheral/inc/sl_hal_dcdc_coulomb_counter.h