|
Zephyr API Documentation 4.5.99
A Scalable Open Source RTOS
|
HY4245 fuel gauge specific properties. More...
Data Structures | |
| struct | hy4245_data_flash_block |
| Data flash block for HY4245_FUEL_GAUGE_DATA_FLASH_BLOCK. More... | |
Macros | |
| #define | HY4245_DATA_FLASH_BLOCK_SIZE 32U |
| Size of one data flash block in bytes. | |
| #define | HY4245_CONFIG_IMAGE_ELEMENT_SIZE (2U + HY4245_DATA_FLASH_BLOCK_SIZE) |
| Size of one configuration image element in bytes: subclass id, block id followed by one data flash block. | |
ControlStatus() bits, HY4245_FUEL_GAUGE_CONTROL_STATUS | |
| #define | HY4245_CONTROL_STATUS_VOK BIT(1) |
| Battery voltage is high enough for data flash updates. | |
| #define | HY4245_CONTROL_STATUS_SLEEP BIT(4) |
| Device is in SLEEP mode. | |
| #define | HY4245_CONTROL_STATUS_FULLSLEEP BIT(5) |
| FULLSLEEP mode requested. | |
| #define | HY4245_CONTROL_STATUS_HIBERNATE BIT(6) |
| HIBERNATE mode requested. | |
| #define | HY4245_CONTROL_STATUS_SHUTDOWN BIT(7) |
| Shutdown feature of the SE pin enabled. | |
| #define | HY4245_CONTROL_STATUS_1WR BIT(8) |
| 1-Wire interface active | |
| #define | HY4245_CONTROL_STATUS_BCA BIT(10) |
| Board offset calibration routine (calibration mode) active. | |
| #define | HY4245_CONTROL_STATUS_CCA BIT(11) |
| Coulomb counter offset calibration routine active. | |
| #define | HY4245_CONTROL_STATUS_CSV BIT(12) |
| Data or instruction flash checksum generated. | |
| #define | HY4245_CONTROL_STATUS_SS BIT(13) |
| Device is sealed. | |
| #define | HY4245_CONTROL_STATUS_FAS BIT(14) |
| Full access is sealed. | |
| #define | HY4245_CONTROL_STATUS_SE BIT(15) |
| SE pin is active. | |
Flags() bits, HY4245_FUEL_GAUGE_FLAGS | |
| #define | HY4245_FLAGS_DSG BIT(0) |
| Discharging. | |
| #define | HY4245_FLAGS_SOCF BIT(1) |
| Capacity depleted, RemainingCapacity() below the SOCF threshold. | |
| #define | HY4245_FLAGS_SOC1 BIT(2) |
| Capacity low, RemainingCapacity() below the SOC1 threshold. | |
| #define | HY4245_FLAGS_BAT_DET BIT(3) |
| Battery inserted. | |
| #define | HY4245_FLAGS_LRND BIT(4) |
| Capacity learned since the last ClearLearned(). | |
| #define | HY4245_FLAGS_QSTART BIT(5) |
| QuickStart() in progress. | |
| #define | HY4245_FLAGS_EODCTAKEN BIT(6) |
| End of discharge compensation in progress. | |
| #define | HY4245_FLAGS_OCVTAKEN BIT(7) |
| Open circuit voltage measurement taken. | |
| #define | HY4245_FLAGS_CHG BIT(8) |
| Charging. | |
| #define | HY4245_FLAGS_FC BIT(9) |
| Fully charged. | |
| #define | HY4245_FLAGS_CHGSUSP BIT(10) |
| Charge suspended because of the temperature. | |
| #define | HY4245_FLAGS_XCHG BIT(11) |
| Charge inhibited because of the temperature. | |
| #define | HY4245_FLAGS_DOT BIT(14) |
| Discharge over temperature. | |
| #define | HY4245_FLAGS_COT BIT(15) |
| Charge over temperature. | |
SafetyStatus() bits, HY4245_FUEL_GAUGE_SAFETY_STATUS | |
| #define | HY4245_SAFETY_STATUS_OV BIT(6) |
| Over voltage. | |
| #define | HY4245_SAFETY_STATUS_UV BIT(7) |
| Under voltage. | |
| #define | HY4245_SAFETY_STATUS_COC BIT(12) |
| Charge over current. | |
| #define | HY4245_SAFETY_STATUS_DOC BIT(13) |
| Discharge over current. | |
| #define | HY4245_SAFETY_STATUS_COT BIT(14) |
| Charge over temperature. | |
| #define | HY4245_SAFETY_STATUS_DOT BIT(15) |
| Discharge over temperature. | |
OperationCfgA() bits, HY4245_FUEL_GAUGE_OPERATION_CONFIG_A | |
| #define | HY4245_OPERATION_CONFIG_A_TEMPS BIT(0) |
| Temperature() is measured at the TS input instead of the internal sensor. | |
| #define | HY4245_OPERATION_CONFIG_A_SE_EN BIT(1) |
| SE pin functions enabled. | |
| #define | HY4245_OPERATION_CONFIG_A_SE_POL BIT(3) |
| SE pin is active low. | |
| #define | HY4245_OPERATION_CONFIG_A_RMFCC BIT(4) |
| RelativeStateOfCharge() is held at 99 % until charge termination. | |
| #define | HY4245_OPERATION_CONFIG_A_SLEEP BIT(5) |
| SLEEP mode enabled. | |
| #define | HY4245_OPERATION_CONFIG_A_UPIMP_B BIT(6) |
| Updates when the battery impedance is learned at normal temperature. | |
| #define | HY4245_OPERATION_CONFIG_A_CELL0 BIT(8) |
| Two cells in series. | |
| #define | HY4245_OPERATION_CONFIG_A_SMLSR BIT(10) |
| Higher current measurement resolution for small sense resistors. | |
| #define | HY4245_OPERATION_CONFIG_A_GNDSEL BIT(11) |
| VSS connected to SRP instead of SRN. | |
| #define | HY4245_OPERATION_CONFIG_A_NR BIT(13) |
| Battery is not removable. | |
| #define | HY4245_OPERATION_CONFIG_A_FACDC_EN BIT(14) |
| Design capacity is updated from Qmax() during the first capacity learning. | |
| #define | HY4245_OPERATION_CONFIG_A_UPD_EN BIT(15) |
| Data flash updates by the algorithm in operation enabled. | |
HY4245 fuel gauge specific properties.
| #define HY4245_CONFIG_IMAGE_ELEMENT_SIZE (2U + HY4245_DATA_FLASH_BLOCK_SIZE) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Size of one configuration image element in bytes: subclass id, block id followed by one data flash block.
| #define HY4245_CONTROL_STATUS_1WR BIT(8) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
1-Wire interface active
| #define HY4245_CONTROL_STATUS_BCA BIT(10) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Board offset calibration routine (calibration mode) active.
| #define HY4245_CONTROL_STATUS_CCA BIT(11) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Coulomb counter offset calibration routine active.
| #define HY4245_CONTROL_STATUS_CSV BIT(12) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Data or instruction flash checksum generated.
| #define HY4245_CONTROL_STATUS_FAS BIT(14) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Full access is sealed.
| #define HY4245_CONTROL_STATUS_FULLSLEEP BIT(5) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
FULLSLEEP mode requested.
| #define HY4245_CONTROL_STATUS_HIBERNATE BIT(6) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
HIBERNATE mode requested.
| #define HY4245_CONTROL_STATUS_SE BIT(15) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
SE pin is active.
| #define HY4245_CONTROL_STATUS_SHUTDOWN BIT(7) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Shutdown feature of the SE pin enabled.
| #define HY4245_CONTROL_STATUS_SLEEP BIT(4) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Device is in SLEEP mode.
| #define HY4245_CONTROL_STATUS_SS BIT(13) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Device is sealed.
| #define HY4245_CONTROL_STATUS_VOK BIT(1) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Battery voltage is high enough for data flash updates.
| #define HY4245_DATA_FLASH_BLOCK_SIZE 32U |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Size of one data flash block in bytes.
| #define HY4245_FLAGS_BAT_DET BIT(3) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Battery inserted.
| #define HY4245_FLAGS_CHG BIT(8) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charging.
| #define HY4245_FLAGS_CHGSUSP BIT(10) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charge suspended because of the temperature.
| #define HY4245_FLAGS_COT BIT(15) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charge over temperature.
| #define HY4245_FLAGS_DOT BIT(14) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Discharge over temperature.
| #define HY4245_FLAGS_DSG BIT(0) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Discharging.
| #define HY4245_FLAGS_EODCTAKEN BIT(6) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
End of discharge compensation in progress.
| #define HY4245_FLAGS_FC BIT(9) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Fully charged.
| #define HY4245_FLAGS_LRND BIT(4) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Capacity learned since the last ClearLearned().
| #define HY4245_FLAGS_OCVTAKEN BIT(7) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Open circuit voltage measurement taken.
| #define HY4245_FLAGS_QSTART BIT(5) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
QuickStart() in progress.
| #define HY4245_FLAGS_SOC1 BIT(2) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Capacity low, RemainingCapacity() below the SOC1 threshold.
| #define HY4245_FLAGS_SOCF BIT(1) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Capacity depleted, RemainingCapacity() below the SOCF threshold.
| #define HY4245_FLAGS_XCHG BIT(11) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charge inhibited because of the temperature.
| #define HY4245_OPERATION_CONFIG_A_CELL0 BIT(8) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Two cells in series.
| #define HY4245_OPERATION_CONFIG_A_FACDC_EN BIT(14) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Design capacity is updated from Qmax() during the first capacity learning.
| #define HY4245_OPERATION_CONFIG_A_GNDSEL BIT(11) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
VSS connected to SRP instead of SRN.
| #define HY4245_OPERATION_CONFIG_A_NR BIT(13) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Battery is not removable.
| #define HY4245_OPERATION_CONFIG_A_RMFCC BIT(4) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
RelativeStateOfCharge() is held at 99 % until charge termination.
| #define HY4245_OPERATION_CONFIG_A_SE_EN BIT(1) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
SE pin functions enabled.
| #define HY4245_OPERATION_CONFIG_A_SE_POL BIT(3) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
SE pin is active low.
| #define HY4245_OPERATION_CONFIG_A_SLEEP BIT(5) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
SLEEP mode enabled.
| #define HY4245_OPERATION_CONFIG_A_SMLSR BIT(10) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Higher current measurement resolution for small sense resistors.
| #define HY4245_OPERATION_CONFIG_A_TEMPS BIT(0) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Temperature() is measured at the TS input instead of the internal sensor.
| #define HY4245_OPERATION_CONFIG_A_UPD_EN BIT(15) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Data flash updates by the algorithm in operation enabled.
| #define HY4245_OPERATION_CONFIG_A_UPIMP_B BIT(6) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Updates when the battery impedance is learned at normal temperature.
| #define HY4245_SAFETY_STATUS_COC BIT(12) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charge over current.
| #define HY4245_SAFETY_STATUS_COT BIT(14) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Charge over temperature.
| #define HY4245_SAFETY_STATUS_DOC BIT(13) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Discharge over current.
| #define HY4245_SAFETY_STATUS_DOT BIT(15) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Discharge over temperature.
| #define HY4245_SAFETY_STATUS_OV BIT(6) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Over voltage.
| #define HY4245_SAFETY_STATUS_UV BIT(7) |
#include <zephyr/drivers/fuel_gauge/hy4245.h>
Under voltage.
#include <zephyr/drivers/fuel_gauge/hy4245.h>
HY4245 specific fuel gauge properties.
The value type used with each property is given in the description: custom_bool and custom_uint refer to the members of union fuel_gauge_prop_val.
| Enumerator | |
|---|---|
| HY4245_FUEL_GAUGE_FLASH_UPDATE_ENABLE | Data flash updates by the gauge algorithm (OperationCfgA().UPD_EN). get, set, |
| HY4245_FUEL_GAUGE_CONTROL_STATUS | ControlStatus() register. get, |
| HY4245_FUEL_GAUGE_OPERATION_CONFIG_A | OperationCfgA() register. get, |
| HY4245_FUEL_GAUGE_FLAGS | Flags() register. get, |
| HY4245_FUEL_GAUGE_SAFETY_STATUS | SafetyStatus() register. get, |
| HY4245_FUEL_GAUGE_LIFETIME_OVER_TEMPERATURE_MINS | Accumulated duration of over temperature events (Control() subcommand LifetimeOverTempDuration). get, |
| HY4245_FUEL_GAUGE_DATA_FLASH_CHECKSUM | Data flash checksum (Control() subcommand DFChecksum). get, |
| HY4245_FUEL_GAUGE_DATA_FLASH_VERSION | Data flash version (Control() subcommand DFVersion), the version field of the programmed configuration image. get, |
| HY4245_FUEL_GAUGE_FIRMWARE_VERSION | Firmware (algorithm) version (Control() subcommand Version). get, |
| HY4245_FUEL_GAUGE_CALIBRATION_MODE | Calibration mode (data flash access session). set, get, |
| HY4245_FUEL_GAUGE_RESET | Full reset of the gauge (Control() subcommand Reset). set, |
| HY4245_FUEL_GAUGE_DATA_FLASH_BLOCK | Single data flash block, buffer property with struct hy4245_data_flash_block. Requires calibration mode. set_buffer_prop: writes get_buffer_prop: the caller fills |
| HY4245_FUEL_GAUGE_MANUFACTURER_INFO_A | Manufacturer info block A, buffer property with up to HY4245_DATA_FLASH_BLOCK_SIZE bytes. Requires calibration mode. set_buffer_prop: writes the buffer, padded with zeros to the block size. get_buffer_prop: reads the first |
| HY4245_FUEL_GAUGE_MANUFACTURER_INFO_B | Manufacturer info block B, see HY4245_FUEL_GAUGE_MANUFACTURER_INFO_A. |
| HY4245_FUEL_GAUGE_MANUFACTURER_INFO_C | Manufacturer info block C, see HY4245_FUEL_GAUGE_MANUFACTURER_INFO_A. |
| HY4245_FUEL_GAUGE_CONFIG_IMAGE | Configuration image (battery parameter file), buffer property. Requires calibration mode. set_buffer_prop: programs the image into the data flash. The image is a sequence of HY4245_CONFIG_IMAGE_ELEMENT_SIZE byte elements (subclass, block, 32 data bytes). Elements that hold device specific calibration data or manufacturer info block A are not programmed, device specific bytes inside shared blocks are preserved. The image becomes effective after leaving calibration mode. |
| HY4245_FUEL_GAUGE_CONFIG_IMAGE_VERIFY | Verify the data flash against a configuration image, buffer property. Requires calibration mode. set_buffer_prop: reads back every programmed element of the image and compares it with the data flash. Returns -EILSEQ on the first mismatch. |
| HY4245_FUEL_GAUGE_CLEAR_LEARNED | Clear learned capacity information (Control() subcommand ClearLearned). Clears HY4245_FLAGS_LRND, so the gauge relearns the capacity, e.g. after the battery has been replaced. set, |
| HY4245_FUEL_GAUGE_QUICK_START | QuickStart: re-estimate the capacity information from the open circuit voltage (Control() subcommand QuickStart). The gauge holds the bus for 250 ms, the driver waits accordingly. set, |