Battery charger peripheral driver. More...
Data Structures | |
struct | npmx_charger_t |
Data structure of the CHARGER driver instance. More... | |
Enumerations | |
enum | npmx_charger_task_t { NPMX_CHARGER_TASK_RELEASE , NPMX_CHARGER_TASK_CLEAR_ERROR , NPMX_CHARGER_TASK_CLEAR_TIMERS , NPMX_CHARGER_TASK_COUNT } |
Charger tasks. More... | |
enum | npmx_charger_module_mask_t { NPMX_CHARGER_MODULE_CHARGER_MASK = (1U << 0U) , NPMX_CHARGER_MODULE_FULL_COOL_MASK = (1U << 1U) , NPMX_CHARGER_MODULE_RECHARGE_MASK = (1U << 2U) , NPMX_CHARGER_MODULE_NTC_LIMITS_MASK = (1U << 3U) } |
Charger modules to be enabled and disabled. More... | |
enum | npmx_charger_voltage_t { NPMX_CHARGER_VOLTAGE_3V50 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_3V50 , NPMX_CHARGER_VOLTAGE_3V55 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_3V55 , NPMX_CHARGER_VOLTAGE_3V60 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_3V60 , NPMX_CHARGER_VOLTAGE_3V65 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_3V65 , NPMX_CHARGER_VOLTAGE_4V00 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V00 , NPMX_CHARGER_VOLTAGE_4V05 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V05 , NPMX_CHARGER_VOLTAGE_4V10 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V10 , NPMX_CHARGER_VOLTAGE_4V15 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V15 , NPMX_CHARGER_VOLTAGE_4V20 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V20 , NPMX_CHARGER_VOLTAGE_4V25 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V25 , NPMX_CHARGER_VOLTAGE_4V30 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V30 , NPMX_CHARGER_VOLTAGE_4V35 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V35 , NPMX_CHARGER_VOLTAGE_4V40 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V40 , NPMX_CHARGER_VOLTAGE_4V45 = BCHARGER_BCHGVTERMR_BCHGVTERMREDUCED_4V45 , NPMX_CHARGER_VOLTAGE_COUNT , NPMX_CHARGER_VOLTAGE_DEFAULT = NPMX_CHARGER_VOLTAGE_3V60 , NPMX_CHARGER_VOLTAGE_MAX = NPMX_CHARGER_VOLTAGE_4V45 , NPMX_CHARGER_VOLTAGE_INVALID = NPMX_INVALID_ENUM_VALUE } |
Battery charger termination voltage Normal and Warm. More... | |
enum | npmx_charger_status_mask_t { NPMX_CHARGER_STATUS_BATTERY_DETECTED_MASK = BCHARGER_BCHGCHARGESTATUS_BATTERYDETECTED_Msk , NPMX_CHARGER_STATUS_COMPLETED_MASK = BCHARGER_BCHGCHARGESTATUS_COMPLETED_Msk , NPMX_CHARGER_STATUS_TRICKLE_CHARGE_MASK = BCHARGER_BCHGCHARGESTATUS_TRICKLECHARGE_Msk , NPMX_CHARGER_STATUS_CONSTANT_CURRENT_MASK = BCHARGER_BCHGCHARGESTATUS_CONSTANTCURRENT_Msk , NPMX_CHARGER_STATUS_CONSTANT_VOLTAGE_MASK = BCHARGER_BCHGCHARGESTATUS_CONSTANTVOLTAGE_Msk , NPMX_CHARGER_STATUS_RECHARGE_MASK = BCHARGER_BCHGCHARGESTATUS_RECHARGE_Msk , NPMX_CHARGER_STATUS_DIE_TEMP_HIGH_MASK = BCHARGER_BCHGCHARGESTATUS_DIETEMPHIGHCHGPAUSED_Msk , NPMX_CHARGER_STATUS_SUPPLEMENT_ACTIVE_MASK = BCHARGER_BCHGCHARGESTATUS_SUPPLEMENTACTIVE_Msk } |
Battery charger status. More... | |
enum | npmx_charger_trickle_t { NPMX_CHARGER_TRICKLE_2V9 = BCHARGER_BCHGVTRICKLESEL_BCHGVTRICKLESEL_2V9 , NPMX_CHARGER_TRICKLE_2V5 = BCHARGER_BCHGVTRICKLESEL_BCHGVTRICKLESEL_2V5 , NPMX_CHARGER_TRICKLE_COUNT , NPMX_CHARGER_TRICKLE_DEFAULT = NPMX_CHARGER_TRICKLE_2V9 , NPMX_CHARGER_TRICKLE_MAX = NPMX_CHARGER_TRICKLE_2V9 , NPMX_CHARGER_TRICKLE_INVALID = NPMX_INVALID_ENUM_VALUE } |
Battery charger trickle level select. More... | |
enum | npmx_charger_iterm_t { NPMX_CHARGER_ITERM_10 = BCHARGER_BCHGITERMSEL_BCHGITERMSEL_SEL10 , NPMX_CHARGER_ITERM_20 = BCHARGER_BCHGITERMSEL_BCHGITERMSEL_SEL20 , NPMX_CHARGER_ITERM_COUNT , NPMX_CHARGER_ITERM_DEFAULT = NPMX_CHARGER_ITERM_10 , NPMX_CHARGER_ITERM_MAX = NPMX_CHARGER_ITERM_20 , NPMX_CHARGER_ITERM_INVALID = NPMX_INVALID_ENUM_VALUE } |
Battery charger termination current select. More... | |
enum | npmx_charger_ntc_status_mask_t { NPMX_CHARGER_NTC_STATUS_COLD_MASK = BCHARGER_NTCSTATUS_NTCCOLD_Msk , NPMX_CHARGER_NTC_STATUS_COOL_MASK = BCHARGER_NTCSTATUS_NTCCOOL_Msk , NPMX_CHARGER_NTC_STATUS_WARM_MASK = BCHARGER_NTCSTATUS_NTCWARM_Msk , NPMX_CHARGER_NTC_STATUS_HOT_MASK = BCHARGER_NTCSTATUS_NTCHOT_Msk } |
NTC comparator status fields. More... | |
Functions | |
npmx_charger_t * | npmx_charger_get (npmx_instance_t *p_pmic, uint8_t idx) |
Function for returning CHARGER instance based on index. | |
npmx_charger_voltage_t | npmx_charger_voltage_convert (uint32_t millivolts) |
Function for converting millivolts to npmx_charger_voltage_t enumeration. | |
bool | npmx_charger_voltage_convert_to_mv (npmx_charger_voltage_t enum_value, uint32_t *p_val) |
Function for converting npmx_charger_voltage_t enumeration to millivolts. | |
npmx_charger_trickle_t | npmx_charger_trickle_convert (uint32_t millivolts) |
Function for converting millivolts to npmx_charger_trickle_t enumeration. | |
bool | npmx_charger_trickle_convert_to_mv (npmx_charger_trickle_t enum_value, uint32_t *p_val) |
Function for converting npmx_charger_trickle_t enumeration to millivolts. | |
npmx_charger_iterm_t | npmx_charger_iterm_convert (uint32_t percent) |
Function for converting percentage value of charging current to npmx_charger_iterm_t enumeration. | |
bool | npmx_charger_iterm_convert_to_pct (npmx_charger_iterm_t enum_value, uint32_t *p_val) |
Function for converting percentage value of charging current to npmx_charger_iterm_t enumeration. | |
npmx_error_t | npmx_charger_task_trigger (npmx_charger_t const *p_instance, npmx_charger_task_t task) |
Function for activating the specified charger task. | |
npmx_error_t | npmx_charger_module_enable_set (npmx_charger_t const *p_instance, uint32_t module_mask) |
Function for enabling specified charger modules. | |
npmx_error_t | npmx_charger_module_disable_set (npmx_charger_t const *p_instance, uint32_t module_mask) |
Function for disabling specified charger modules. | |
npmx_error_t | npmx_charger_module_get (npmx_charger_t const *p_instance, uint32_t *p_modules_mask) |
Function for checking which charger modules are enabled. | |
npmx_error_t | npmx_charger_charging_current_set (npmx_charger_t *p_instance, uint16_t current) |
Function for setting charger current of nPM device. Default value after reset is 32 mA. | |
npmx_error_t | npmx_charger_charging_current_get (npmx_charger_t *p_instance, uint16_t *p_current) |
Function for reading charger current from nPM device. Default value after reset is 32 mA. | |
npmx_error_t | npmx_charger_discharging_current_set (npmx_charger_t *p_instance, uint16_t current) |
Function for setting maximum discharging current of nPM device. Default value after reset is 1000 mA. | |
npmx_error_t | npmx_charger_discharging_current_get (npmx_charger_t *p_instance, uint16_t *p_current) |
Function for reading maximum discharging current of nPM device. Default value after reset is 1000 mA. | |
npmx_error_t | npmx_charger_termination_normal_voltage_set (npmx_charger_t const *p_instance, npmx_charger_voltage_t voltage) |
Function for setting the normal termination battery voltage. | |
npmx_error_t | npmx_charger_termination_normal_voltage_get (npmx_charger_t const *p_instance, npmx_charger_voltage_t *p_voltage) |
Function for reading the normal termination battery voltage. | |
npmx_error_t | npmx_charger_termination_warm_voltage_set (npmx_charger_t const *p_instance, npmx_charger_voltage_t voltage) |
Function for setting the warm termination battery voltage. | |
npmx_error_t | npmx_charger_termination_warm_voltage_get (npmx_charger_t const *p_instance, npmx_charger_voltage_t *p_voltage) |
Function for reading the warm termination battery voltage. | |
npmx_error_t | npmx_charger_trickle_voltage_set (npmx_charger_t const *p_instance, npmx_charger_trickle_t trickle) |
Function for setting the trickle voltage. Trickle charging is performed when VBAT < V_TRICKLE_FAST. | |
npmx_error_t | npmx_charger_trickle_voltage_get (npmx_charger_t const *p_instance, npmx_charger_trickle_t *p_trickle) |
Function for reading the trickle voltage. | |
npmx_error_t | npmx_charger_termination_current_set (npmx_charger_t const *p_instance, npmx_charger_iterm_t iterm) |
Function for setting the termination current ITERM. Trickle charging current I_TRICKLE is 10% or 20% of I_CHG (charging current). | |
npmx_error_t | npmx_charger_termination_current_get (npmx_charger_t const *p_instance, npmx_charger_iterm_t *p_iterm) |
Function for reading the termination current ITERM. | |
npmx_error_t | npmx_charger_cold_resistance_set (npmx_charger_t const *p_instance, uint32_t resistance) |
Function for setting the NTC cold resistance threshold. | |
npmx_error_t | npmx_charger_cold_resistance_get (npmx_charger_t const *p_instance, uint32_t *p_resistance) |
Function for reading the NTC cold resistance threshold. | |
npmx_error_t | npmx_charger_cool_resistance_set (npmx_charger_t const *p_instance, uint32_t resistance) |
Function for setting the NTC cool resistance threshold. | |
npmx_error_t | npmx_charger_cool_resistance_get (npmx_charger_t const *p_instance, uint32_t *p_resistance) |
Function for reading the NTC cool resistance threshold. | |
npmx_error_t | npmx_charger_warm_resistance_set (npmx_charger_t const *p_instance, uint32_t resistance) |
Function for setting the NTC warm resistance threshold. | |
npmx_error_t | npmx_charger_warm_resistance_get (npmx_charger_t const *p_instance, uint32_t *p_resistance) |
Function for reading the NTC warm resistance threshold. | |
npmx_error_t | npmx_charger_hot_resistance_set (npmx_charger_t const *p_instance, uint32_t resistance) |
Function for setting the NTC hot resistance threshold. | |
npmx_error_t | npmx_charger_hot_resistance_get (npmx_charger_t const *p_instance, uint32_t *p_resistance) |
Function for reading the NTC hot resistance threshold. | |
npmx_error_t | npmx_charger_cold_temperature_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting the NTC cold temperature threshold. | |
npmx_error_t | npmx_charger_cold_temperature_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading the NTC cold temperature threshold. | |
npmx_error_t | npmx_charger_cool_temperature_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting the NTC cool temperature threshold. | |
npmx_error_t | npmx_charger_cool_temperature_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading the NTC cool temperature threshold. | |
npmx_error_t | npmx_charger_warm_temperature_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting the NTC warm temperature threshold. | |
npmx_error_t | npmx_charger_warm_temperature_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading the NTC warm temperature threshold. | |
npmx_error_t | npmx_charger_hot_temperature_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting the NTC hot temperature threshold. | |
npmx_error_t | npmx_charger_hot_temperature_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading the NTC hot temperature threshold. | |
npmx_error_t | npmx_charger_die_temp_stop_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting die temperature value when charging needs to be stopped. | |
npmx_error_t | npmx_charger_die_temp_stop_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading die temperature value when charging needs to be stopped. | |
npmx_error_t | npmx_charger_die_temp_resume_set (npmx_charger_t const *p_instance, int16_t temperature) |
Function for setting die temperature value when charging needs to be resumed. | |
npmx_error_t | npmx_charger_die_temp_resume_get (npmx_charger_t const *p_instance, int16_t *p_temperature) |
Function for reading die temperature value when charging needs to be resumed. | |
npmx_error_t | npmx_charger_ntc_status_get (npmx_charger_t const *p_instance, uint8_t *p_ntc_status) |
Function for reading the status of a NTC comparator. | |
npmx_error_t | npmx_charger_die_temp_status_get (npmx_charger_t const *p_instance, bool *p_die_temp_status) |
Function for reading the status of a die temp comparator. | |
npmx_error_t | npmx_charger_current_limiter_get (npmx_charger_t const *p_instance, bool *p_current_lim_status) |
Function for reading the status of a current charger limiter. | |
npmx_error_t | npmx_charger_status_get (npmx_charger_t const *p_instance, uint8_t *p_status_mask) |
Function for reading the charger status register. | |
npmx_error_t | npmx_charger_errors_check (npmx_charger_t const *p_instance) |
Function for checking charger errors and running registered callbacks. | |
npmx_error_t | npmx_charger_warm_disable_set (npmx_charger_t const *p_instance, bool disable) |
Function for setting a specific charger configuration: disable charging if battery is warm. | |
npmx_error_t | npmx_charger_warm_disable_get (npmx_charger_t const *p_instance, bool *p_disable) |
Function for reading a specific charger configuration: disable charging if battery is warm. | |
Battery charger peripheral driver.
enum npmx_charger_iterm_t |
Battery charger termination current select.
Charger modules to be enabled and disabled.
Battery charger status.
enum npmx_charger_task_t |
Battery charger trickle level select.
Battery charger termination voltage Normal and Warm.
npmx_error_t npmx_charger_charging_current_get | ( | npmx_charger_t * | p_instance, |
uint16_t * | p_current ) |
Function for reading charger current from nPM device. Default value after reset is 32 mA.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_current | Pointer to the current variable. Charger current in milliamperes in a range from 32 to 800 with a step of 2. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_charging_current_set | ( | npmx_charger_t * | p_instance, |
uint16_t | current ) |
Function for setting charger current of nPM device. Default value after reset is 32 mA.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | current | Charger current in milliamperes in a range from 32 to 800 with a step of 2. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_INVALID_PARAM | Current out of range. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cold_resistance_get | ( | npmx_charger_t const * | p_instance, |
uint32_t * | p_resistance ) |
Function for reading the NTC cold resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_resistance | Pointer to the resistance variable in Ohms. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cold_resistance_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | resistance ) |
Function for setting the NTC cold resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | resistance | Resistance threshold in Ohms, value should be greater than 0. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cold_temperature_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading the NTC cold temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable in degrees Celsius. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cold_temperature_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting the NTC cold temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature threshold in degrees Celsius. The value should be in the range between -20 and 60 degrees. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cool_resistance_get | ( | npmx_charger_t const * | p_instance, |
uint32_t * | p_resistance ) |
Function for reading the NTC cool resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_resistance | Pointer to the resistance variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cool_resistance_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | resistance ) |
Function for setting the NTC cool resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | resistance | Resistance threshold in Ohms, value should be greater than 0. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cool_temperature_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading the NTC cool temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable in degrees Celsius. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_cool_temperature_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting the NTC cool temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature threshold in degrees Celsius. The value should be in the range between -20 and 60 degrees. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_current_limiter_get | ( | npmx_charger_t const * | p_instance, |
bool * | p_current_lim_status ) |
Function for reading the status of a current charger limiter.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_current_lim_status | Pointer to the current charger limiter status indicator. True if limiter is active. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_die_temp_resume_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading die temperature value when charging needs to be resumed.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_die_temp_resume_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting die temperature value when charging needs to be resumed.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature in *C at which die resume threshold event happens. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_die_temp_status_get | ( | npmx_charger_t const * | p_instance, |
bool * | p_die_temp_status ) |
Function for reading the status of a die temp comparator.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_die_temp_status | Pointer to the die temperature status variable. True for high die temperature. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_die_temp_stop_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading die temperature value when charging needs to be stopped.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_die_temp_stop_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting die temperature value when charging needs to be stopped.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature in *C at which die stop threshold event happens. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_discharging_current_get | ( | npmx_charger_t * | p_instance, |
uint16_t * | p_current ) |
Function for reading maximum discharging current of nPM device. Default value after reset is 1000 mA.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_current | Pointer to the current variable. Maximum discharging current in milliamperes from in a range from 270 to 1340 with a step of 2. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_discharging_current_set | ( | npmx_charger_t * | p_instance, |
uint16_t | current ) |
Function for setting maximum discharging current of nPM device. Default value after reset is 1000 mA.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | current | Maximum discharging current in milliamperes in a range from 270 to 1340 with a step of 2. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_INVALID_PARAM | Current out of range. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_errors_check | ( | npmx_charger_t const * | p_instance | ) |
Function for checking charger errors and running registered callbacks.
[in] | p_instance | Pointer to the CHARGER instance. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_charger_t * npmx_charger_get | ( | npmx_instance_t * | p_pmic, |
uint8_t | idx ) |
Function for returning CHARGER instance based on index.
[in] | p_pmic | Pointer to the PMIC instance. |
[in] | idx | Index of the CHARGER instance. |
npmx_error_t npmx_charger_hot_resistance_get | ( | npmx_charger_t const * | p_instance, |
uint32_t * | p_resistance ) |
Function for reading the NTC hot resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_resistance | Pointer to the resistance variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_hot_resistance_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | resistance ) |
Function for setting the NTC hot resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | resistance | Resistance threshold in Ohms, value should be greater than 0. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_hot_temperature_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading the NTC hot temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable in degrees Celsius. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_hot_temperature_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting the NTC hot temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature threshold in degrees Celsius. The value should be in the range between -20 and 60 degrees. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_charger_iterm_t npmx_charger_iterm_convert | ( | uint32_t | percent | ) |
Function for converting percentage value of charging current to npmx_charger_iterm_t enumeration.
[in] | percent | Termination current, as a percent of charging current, to be converted into npmx_charger_iterm_t enumeration. |
bool npmx_charger_iterm_convert_to_pct | ( | npmx_charger_iterm_t | enum_value, |
uint32_t * | p_val ) |
Function for converting percentage value of charging current to npmx_charger_iterm_t enumeration.
[in] | enum_value | Termination current defined as npmx_charger_iterm_t enumeration to be converted into a percent of charging current. |
[out] | p_val | Pointer to the variable that stores the conversion result. |
true | Conversion is valid. |
false | Conversion is invalid - an invalid argument was passed to the function. |
npmx_error_t npmx_charger_module_disable_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | module_mask ) |
Function for disabling specified charger modules.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | module_mask | Mask of modules to be disabled, variable composed of values from npmx_charger_module_mask_t. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_module_enable_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | module_mask ) |
Function for enabling specified charger modules.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | module_mask | Mask of modules to be enabled, variable composed of values from npmx_charger_module_mask_t. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_module_get | ( | npmx_charger_t const * | p_instance, |
uint32_t * | p_modules_mask ) |
Function for checking which charger modules are enabled.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_modules_mask | Pointer to modules status variable composed of values from npmx_charger_module_mask_t. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_ntc_status_get | ( | npmx_charger_t const * | p_instance, |
uint8_t * | p_ntc_status ) |
Function for reading the status of a NTC comparator.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_ntc_status | Pointer to the NTC comparator status mask composed of values from npmx_charger_ntc_status_mask_t. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_status_get | ( | npmx_charger_t const * | p_instance, |
uint8_t * | p_status_mask ) |
Function for reading the charger status register.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_status_mask | Pointer to the charger status mask composed of values from npmx_charger_status_mask_t. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_task_trigger | ( | npmx_charger_t const * | p_instance, |
npmx_charger_task_t | task ) |
Function for activating the specified charger task.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | task | Task to be activated. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_current_get | ( | npmx_charger_t const * | p_instance, |
npmx_charger_iterm_t * | p_iterm ) |
Function for reading the termination current ITERM.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_iterm | Pointer to the iterm variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_current_set | ( | npmx_charger_t const * | p_instance, |
npmx_charger_iterm_t | iterm ) |
Function for setting the termination current ITERM. Trickle charging current I_TRICKLE is 10% or 20% of I_CHG (charging current).
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | iterm | Trickle charging percent value: 10% or 20%. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_normal_voltage_get | ( | npmx_charger_t const * | p_instance, |
npmx_charger_voltage_t * | p_voltage ) |
Function for reading the normal termination battery voltage.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_voltage | Pointer to the charger voltage variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_normal_voltage_set | ( | npmx_charger_t const * | p_instance, |
npmx_charger_voltage_t | voltage ) |
Function for setting the normal termination battery voltage.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | voltage | Voltage, in ranges 3.5-3.65 V or 4.0-4.45 V in 50 mV steps. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_warm_voltage_get | ( | npmx_charger_t const * | p_instance, |
npmx_charger_voltage_t * | p_voltage ) |
Function for reading the warm termination battery voltage.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_voltage | Pointer to the voltage variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_termination_warm_voltage_set | ( | npmx_charger_t const * | p_instance, |
npmx_charger_voltage_t | voltage ) |
Function for setting the warm termination battery voltage.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | voltage | Voltage, in ranges 3.5-3.65 V or 4.0-4.45 V in 50 mV steps. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_charger_trickle_t npmx_charger_trickle_convert | ( | uint32_t | millivolts | ) |
Function for converting millivolts to npmx_charger_trickle_t enumeration.
[in] | millivolts | Voltage in millivolts to be converted into npmx_charger_trickle_t enumeration. |
bool npmx_charger_trickle_convert_to_mv | ( | npmx_charger_trickle_t | enum_value, |
uint32_t * | p_val ) |
Function for converting npmx_charger_trickle_t enumeration to millivolts.
[in] | enum_value | Voltage defined as npmx_charger_trickle_t enumeration to be converted into millivolts. |
[out] | p_val | Pointer to the variable that stores the conversion result. |
true | Conversion is valid. |
false | Conversion is invalid - an invalid argument was passed to the function. |
npmx_error_t npmx_charger_trickle_voltage_get | ( | npmx_charger_t const * | p_instance, |
npmx_charger_trickle_t * | p_trickle ) |
Function for reading the trickle voltage.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_trickle | Pointer to the trickle variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_trickle_voltage_set | ( | npmx_charger_t const * | p_instance, |
npmx_charger_trickle_t | trickle ) |
Function for setting the trickle voltage. Trickle charging is performed when VBAT < V_TRICKLE_FAST.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | trickle | Trickle voltage value. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_charger_voltage_t npmx_charger_voltage_convert | ( | uint32_t | millivolts | ) |
Function for converting millivolts to npmx_charger_voltage_t enumeration.
[in] | millivolts | Voltage in millivolts to be converted into npmx_charger_voltage_t enumeration. |
bool npmx_charger_voltage_convert_to_mv | ( | npmx_charger_voltage_t | enum_value, |
uint32_t * | p_val ) |
Function for converting npmx_charger_voltage_t enumeration to millivolts.
[in] | enum_value | Voltage defined as npmx_charger_voltage_t enumeration to be converted into millivolts. |
[out] | p_val | Pointer to the variable that stores the conversion result. |
true | Conversion is valid. |
false | Conversion is invalid - an invalid argument was passed to the function. |
npmx_error_t npmx_charger_warm_disable_get | ( | npmx_charger_t const * | p_instance, |
bool * | p_disable ) |
Function for reading a specific charger configuration: disable charging if battery is warm.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_disable | Pointer to the temperature variable. True when charger disables charging if battery is warm. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_warm_disable_set | ( | npmx_charger_t const * | p_instance, |
bool | disable ) |
Function for setting a specific charger configuration: disable charging if battery is warm.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | disable | True for disabling the charging when battery is warm. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_warm_resistance_get | ( | npmx_charger_t const * | p_instance, |
uint32_t * | p_resistance ) |
Function for reading the NTC warm resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_resistance | Pointer to the resistance variable. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_warm_resistance_set | ( | npmx_charger_t const * | p_instance, |
uint32_t | resistance ) |
Function for setting the NTC warm resistance threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | resistance | Resistance threshold in Ohms, value should be greater than 0. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_warm_temperature_get | ( | npmx_charger_t const * | p_instance, |
int16_t * | p_temperature ) |
Function for reading the NTC warm temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[out] | p_temperature | Pointer to the temperature variable in degrees Celsius. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |
npmx_error_t npmx_charger_warm_temperature_set | ( | npmx_charger_t const * | p_instance, |
int16_t | temperature ) |
Function for setting the NTC warm temperature threshold.
[in] | p_instance | Pointer to the CHARGER instance. |
[in] | temperature | Temperature threshold in degrees Celsius. The value should be in the range between -20 and 60 degrees. |
NPMX_SUCCESS | Operation performed successfully. |
NPMX_ERROR_IO | Error using IO bus line. |