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. |
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. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
const sl_hal_dcdc_coulomb_counter_config_t * | [in] | p_config | A pointer to the DCDC_COULOMB_COUNTER initialization structure variable. |
sl_hal_dcdc_coulomb_counter_enable#
void sl_hal_dcdc_coulomb_counter_enable (void )
Enables DCDC_COULOMB_COUNTER module.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_hal_dcdc_coulomb_counter_disable#
void sl_hal_dcdc_coulomb_counter_disable (void )
Disables DCDC_COULOMB_COUNTER module.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_hal_dcdc_coulomb_counter_start#
void sl_hal_dcdc_coulomb_counter_start (void )
Starts DCDC_COULOMB_COUNTER operation.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
sl_hal_dcdc_coulomb_counter_stop#
void sl_hal_dcdc_coulomb_counter_stop (void )
Stops the DCDC_COULOMB_COUNTER operation.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
sl_hal_dcdc_coulomb_counter_clear_counters#
void sl_hal_dcdc_coulomb_counter_clear_counters (void )
Clears the DCDC_COULOMB_COUNTER counters.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_hal_dcdc_coulomb_counter_emode_t | [in] | emode | The energy mode requested will select the appropriate counter. |
Returns
Coulomb Counter Count Value.
sl_hal_dcdc_coulomb_counter_get_status#
uint32_t sl_hal_dcdc_coulomb_counter_get_status (void )
Gets DCDC_COULOMB_COUNTER STATUS register value.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
Current STATUS register value.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | flags | DCDC_COULOMB_COUNTER interrupt sources to disable. Use a set of interrupt flags OR-ed together to disable multiple interrupt sources. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [in] | flags | DCDC_COULOMB_COUNTER interrupt sources to clear. Use a set of interrupt flags OR-ed together to clear multiple interrupt sources. |
sl_hal_dcdc_coulomb_counter_get_interrupts#
uint32_t sl_hal_dcdc_coulomb_counter_get_interrupts (void )
Gets pending DCDC_COULOMB_COUNTER interrupt flags.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | 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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
uint32_t | [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. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_hal_dcdc_coulomb_counter_calibration_config_t | [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.
sl_hal_dcdc_coulomb_counter_cal_start#
void sl_hal_dcdc_coulomb_counter_cal_start (void )
Starts DCDC_COULOMB_COUNTER calibration sequence.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_hal_dcdc_coulomb_counter_cal_stop#
void sl_hal_dcdc_coulomb_counter_cal_stop (void )
Stops DCDC_COULOMB_COUNTER calibration sequence.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Note
The Calibration Load will be disabled.
sl_hal_dcdc_coulomb_counter_enable_cal_load#
void sl_hal_dcdc_coulomb_counter_enable_cal_load (void )
Enables the Calibration Load.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_hal_dcdc_coulomb_counter_disable_cal_load#
void sl_hal_dcdc_coulomb_counter_disable_cal_load (void )
Disables the Calibration Load.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_hal_dcdc_coulomb_counter_emode_t | [in] | emode | The energy mode requested will adjust the compensation circuit. |
sl_hal_dcdc_coulomb_counter_calibration_load_level_t | [in] | load_level | The load level to adjust the load current. |
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
sl_hal_dcdc_coulomb_counter_calibration_load_level_t | [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.
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.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
The frequency (in Hz) of the currently selected CMU Up-Counter clock source.
sl_hal_dcdc_coulomb_counter_set_calhalt#
void sl_hal_dcdc_coulomb_counter_set_calhalt (void )
Sets the calibration Halt Flag.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
sl_hal_dcdc_coulomb_counter_calhalt_is_set#
bool sl_hal_dcdc_coulomb_counter_calhalt_is_set (void )
Gets the calibration Halt Flag.
Type | Direction | Argument Name | Description |
---|---|---|---|
void | N/A |
Returns
true if Halt Flag is set.