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
17/* Intra-component Headers */
18
28typedef enum {
34
38typedef enum {
45
49typedef enum {
54
59
65
70
76
81
86
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:232
DriveStateRequest
Requests made to control the drive state.
Definition: drive_state_manager.h:38
StatusCode drive_state_manager_update(void)
Update the drive state based on the current request.
Definition: drive_state_manager.c:170
RegenState
Regen braking state.
Definition: drive_state_manager.h:49
DriveState
Drive states representing the current output.
Definition: drive_state_manager.h:28
StatusCode drive_state_manager_request(DriveStateRequest req)
Make a request to change the drive state.
Definition: drive_state_manager.c:161
StatusCode drive_state_manager_init(void)
Initialize the drive state manager.
Definition: drive_state_manager.c:151
DriveState drive_state_manager_get_state(void)
Get the current state of the drive controller.
Definition: drive_state_manager.c:228
StatusCode drive_state_manager_toggle_regen()
Toggle regen state for drive state manager.
Definition: drive_state_manager.c:252
@ DRIVE_STATE_REQUEST_NONE
Definition: drive_state_manager.h:39
@ NUM_DRIVE_STATE_REQUESTS
Definition: drive_state_manager.h:43
@ DRIVE_STATE_REQUEST_N
Definition: drive_state_manager.h:41
@ DRIVE_STATE_REQUEST_R
Definition: drive_state_manager.h:42
@ DRIVE_STATE_REQUEST_D
Definition: drive_state_manager.h:40
@ REGEN_STATE_ENABLED
Definition: drive_state_manager.h:51
@ REGEN_STATE_DISABLED
Definition: drive_state_manager.h:50
@ INVALID_REGEN_STATE
Definition: drive_state_manager.h:52
@ DRIVE_STATE_DRIVE
Definition: drive_state_manager.h:31
@ DRIVE_STATE_INVALID
Definition: drive_state_manager.h:29
@ DRIVE_STATE_NEUTRAL
Definition: drive_state_manager.h:30
@ DRIVE_STATE_REVERSE
Definition: drive_state_manager.h:32