Midnight Sun Firmware
Loading...
Searching...
No Matches
DRIVE_STATE_MANAGER

Controls drive state for neutral, drive, and reverse. More...

Enumerations

enum  DriveState {
  DRIVE_STATE_INVALID = 0 , DRIVE_STATE_NEUTRAL , DRIVE_STATE_DRIVE , DRIVE_STATE_REVERSE ,
  VEHICLE_NEUTRAL , VEHICLE_DRIVE , VEHICLE_REVERSE , VEHICLE_CRUISE ,
  VEHICLE_BRAKE
}
 Drive states representing the current output. More...
 
enum  DriveStateRequest { DRIVE_STATE_REQUEST_NONE = 0 , DRIVE_STATE_REQUEST_D , DRIVE_STATE_REQUEST_N , DRIVE_STATE_REQUEST_R }
 Requests made to control the drive state. More...
 

Functions

void drive_state_manager_init (void)
 Initialize the drive state manager.
 
void drive_state_manager_request (DriveStateRequest req)
 Make a request to change the drive state. More...
 
void drive_state_manager_update (void)
 Update the drive state based on the current request.
 
DriveState drive_state_manager_get_state (void)
 Get the current state of the drive controller. More...
 

Detailed Description

Controls drive state for neutral, drive, and reverse.

Enumeration Type Documentation

◆ DriveState

enum DriveState

Drive states representing the current output.

Enumerator
DRIVE_STATE_INVALID 

Wrong State

DRIVE_STATE_NEUTRAL 

Car Not Actively Moving in Neutral

DRIVE_STATE_DRIVE 

Car Drive Forward

DRIVE_STATE_REVERSE 

Car Drive Reverse

VEHICLE_NEUTRAL 

Neutral state

VEHICLE_DRIVE 

Drive state

VEHICLE_REVERSE 

Reverse state

VEHICLE_CRUISE 

Cruise Control state

VEHICLE_BRAKE 

Brake state

◆ DriveStateRequest

Requests made to control the drive state.

Enumerator
DRIVE_STATE_REQUEST_NONE 

No Request

DRIVE_STATE_REQUEST_D 

Request to switch to drive

DRIVE_STATE_REQUEST_N 

Request to switch to neutral

DRIVE_STATE_REQUEST_R 

Request to switch to reverse

Function Documentation

◆ drive_state_manager_get_state()

DriveState drive_state_manager_get_state ( void  )

Get the current state of the drive controller.

Returns
Current drive state

◆ drive_state_manager_request()

void drive_state_manager_request ( DriveStateRequest  req)

Make a request to change the drive state.

Parameters
reqThe requested drive state