Gear Indication
This module provides a set of functionalities for managing the gear system, including determining the current gear state and handling gear mode transitions. It supports various gear modes such as Manual Transmission (MT), Automatic Transmission (AT), Automated Manual Transmission (AMT), and Dual-Clutch Transmission (DCT).
Configuration Parameters
All API functions have the first argument as the module ID.
Name |
Description |
Range |
---|---|---|
enable |
Enables gear functionality. |
0 (disabled) or 1 (enabled) |
transmission_type |
Gear mode selection (e.g., MT, AT, AMT, DCT). |
1 (MT), 2 (AT), 3 (AMT), 4 (DCT) |
APIs
The Gear module provides the following APIs to initialize, process, and update gear state:
Function |
Description |
---|---|
rs_am_gear_init |
Initializes the gear system with default configuration values and registers with the dispatcher. |
rs_am_gear_process |
Processes the gear system by checking gear conditions and updating the display based on the current gear. |
Error Codes
Each API for the gear module returns success or failure codes. For detailed information on the error codes, please refer to the following section:
See also
:doc:/error_codes
Gear Module Header Details
The header file for the gear module, rs_am_gear_indication.h, defines the required structures and APIs for initialization and processing.
Typedefs
-
typedef struct tag_gear_config rs_gear_config_t
Includes.
Configuration structure for the gear module
-
typedef struct tag_gear_runtime rs_gear_runtime_t
Runtime structure for the gear module.
-
typedef struct tag_gear_output rs_gear_output_t
Output structure for the gear module.
-
typedef struct tag_rs_am_gear rs_am_gear_t
Full gear module structure that integrates config, runtime, and output.
Functions
-
rs_ret_val_t rs_am_gear_init(rs_am_gear_t *ptr_gear)
Initializes the gear module.
Registers the gear module with the dispatcher and sets initial states.
- Parameters:
ptr_gear – [in] Pointer to the gear structure.
- Returns:
Returns success on successful initialization.
-
rs_ret_val_t rs_am_gear_process(rs_am_gear_t *ptr_gear)
Processes gear state and updates output.
Consumes dispatcher messages, checks conditions, and updates display.
- Parameters:
ptr_gear – [in] Pointer to the gear structure.
- Returns:
Returns success after processing the gear state.
-
struct tag_gear_config
- #include <rs_am_gear_indication.h>
Includes.
Configuration structure for the gear module
-
struct tag_gear_runtime
- #include <rs_am_gear_indication.h>
Runtime structure for the gear module.
-
struct tag_gear_output
- #include <rs_am_gear_indication.h>
Output structure for the gear module.
-
struct tag_rs_am_gear
- #include <rs_am_gear_indication.h>
Full gear module structure that integrates config, runtime, and output.
Public Members
-
rs_gear_config_t config
Configuration of the gear module.
-
rs_gear_runtime_t runtime
Runtime status of the gear module.
-
rs_gear_output_t output
Output information from the gear module.
-
rs_gear_config_t config