Midnight Sun Firmware
Loading...
Searching...
No Matches
front_controller_state_manager.h
1#pragma once
2
3/***********************************************************************************************
4 * @file front_controller_state_manager.h
5 *
6 * @brief Front Controller state machine manager header file
7 *
8 * @date 2025-09-14
9 * @author Midnight Sun Team #24 - MSXVI
10 ***********************************************************************************************/
11
12/* Standard library Headers */
13#include <stdbool.h>
14#include <stdint.h>
15
16/* Inter-component Headers */
17#include "global_enums.h"
18#include "status.h"
19
20/* Intra-component Headers */
21#include "front_controller.h"
22
29typedef enum {
30 FRONT_CONTROLLER_EVENT_NONE = 0,
31 FRONT_CONTROLLER_EVENT_IDLE_REQUEST,
32 FRONT_CONTROLLER_EVENT_REGEN_REQUEST,
33 FRONT_CONTROLLER_EVENT_BRAKE_REQUEST,
34 FRONT_CONTROLLER_EVENT_DRIVE_REQUEST,
35 FRONT_CONTROLLER_EVENT_REVERSE_REQUEST,
36 FRONT_CONTROLLER_EVENT_FAULT,
37 FRONT_CONTROLLER_EVENT_RESET
38} FrontControllerEvent;
39
47
54StatusCode front_controller_state_manager_step(FrontControllerEvent event);
55
61
StatusCode front_controller_state_manager_step(FrontControllerEvent event)
Advance the state machine based on inputs/events.
Definition: front_controller_state_manager.c:107
VehicleDriveState front_controller_state_manager_get_state(void)
Get current state.
Definition: front_controller_state_manager.c:197
StatusCode front_controller_update_state_manager_medium_cycle()
Update the state/set load switches based on information recieved from CAN (medium cycle).
Definition: front_controller_state_manager.c:201
StatusCode front_controller_state_manager_init(FrontControllerStorage *storage)
Initialize the state machine.
Definition: front_controller_state_manager.c:95
VehicleDriveState
Vehicle drive states.
Definition: global_enums.h:32
StatusCode
StatusCodes for various errors.
Definition: status.h:27
Front Controller storage.
Definition: front_controller.h:91