Fuel Gauge

This module provides a set of functionalities for managing the Fuel Gauge system, including initialization, bar state updates, low fuel warnings, and configuration management to ensure accurate representation of fuel levels.

Configuration Parameters

All API functions have the first argument as the module ID.

Configuration

Name

Description

Range

enable

Enables Fuel Gauge functionality.

0 (disabled) or 1 (enabled)

fuel_capacity

Total fuel tank capacity (in liters).

1 to 48 liters

reserve_fuel_value

Reserve fuel level threshold (in percentage).

0 to 100%

max_bar_count

Maximum number of bars for fuel display.

1 to 7

bar_thresholds

ON/OFF thresholds for each bar in the fuel gauge.

Array of thresholds (configurable values).

APIs

The Fuel Gauge module provides the following APIs to initialize, process, and update the fuel gauge data:

API Functions

Function

Description

rs_am_fuelgauge_init

Initializes the fuel gauge system with default configuration values.

rs_am_fuelgauge_process

Processes the fuel gauge system by updating the bar states and checking for warnings.

Error Codes

Each API for the fuel gauge module returns success or failure codes. For detailed information on the error codes, please refer to the following section:

See also

:doc:/error_codes

Fuel Gauge Module Header Details

The header file for fuel gauge modules, rs_am_fuel_gauge.h, defines the required structures and APIs for initialization and processing.

Warning

doxygenfile: Cannot find file “rs_am_fuel_gauge.h