Midnight Sun Firmware
Loading...
Searching...
No Matches
drive_state_manager.h
1#pragma once
2
3/************************************************************************************************
4 * @file drive_state_manager.h
5 *
6 * @brief Header file for drive state manager
7 *
8 * @date 2025-07-22
9 * @author Midnight Sun Team #24 - MSXVI
10 ************************************************************************************************/
11
12/* Standard library Headers */
13#include <stdbool.h>
14
15/* Inter-component Headers */
16#include "global_enums.h"
17
18/* Intra-component Headers */
19
29typedef enum {
36
40typedef enum {
45
50
56
61
67
72
77
VehicleDriveState
Vehicle drive states.
Definition: global_enums.h:32
StatusCode
StatusCodes for various errors.
Definition: status.h:27
StatusCode drive_state_manager_enter_regen_state(RegenState new_regen_state)
Enter regen state for drive state manager.
Definition: drive_state_manager.c:245
DriveStateRequest
Requests made to control the drive state.
Definition: drive_state_manager.h:29
StatusCode drive_state_manager_update(void)
Update the drive state based on the current request.
Definition: drive_state_manager.c:178
RegenState
Regen braking state.
Definition: drive_state_manager.h:40
StatusCode drive_state_manager_init(SteeringStorage *storage)
Initialize the drive state manager.
Definition: drive_state_manager.c:154
VehicleDriveState drive_state_manager_get_state(void)
Get the current state of the drive controller.
Definition: drive_state_manager.c:241
StatusCode drive_state_manager_request(DriveStateRequest req)
Make a request to change the drive state.
Definition: drive_state_manager.c:169
StatusCode drive_state_manager_toggle_regen()
Toggle regen state for drive state manager.
Definition: drive_state_manager.c:265
@ DRIVE_STATE_REQUEST_NONE
Definition: drive_state_manager.h:30
@ NUM_DRIVE_STATE_REQUESTS
Definition: drive_state_manager.h:34
@ DRIVE_STATE_REQUEST_N
Definition: drive_state_manager.h:32
@ DRIVE_STATE_REQUEST_R
Definition: drive_state_manager.h:33
@ DRIVE_STATE_REQUEST_D
Definition: drive_state_manager.h:31
@ REGEN_STATE_ENABLED
Definition: drive_state_manager.h:42
@ REGEN_STATE_DISABLED
Definition: drive_state_manager.h:41
@ INVALID_REGEN_STATE
Definition: drive_state_manager.h:43
Steering storage.
Definition: steering.h:103