PER Firmware
Loading...
Searching...
No Matches
vcu.c File Reference

VCU page implementation. More...

#include "vcu.h"
#include "can_library/generated/DASHBOARD.h"
#include "common/nextion/nextion.h"
#include "common/utils/clamp.h"
#include "lcd.h"
#include "menu_system.h"
Include dependency graph for vcu.c:

Enumerations

enum  vcu_elements_t {
  VCU_MODE_INDEX = 0 , LATERAL_GAIN_INDEX = 1 , LONG_GAIN_INDEX = 2 , EBB_INDEX = 3 ,
  REGEN_INDEX = 4 , TV_INDEX = 5 , LEFT_WHEEL_INDEX = 6 , RIGHT_WHEEL_INDEX = 7 ,
  NUM_VCU_ELEMENTS
}
 

Functions

static void render_vcu_element (menu_element_t *element)
 
static uint8_t binding_to_element_index (vcu_binding_t binding)
 
void vcu_update (void)
 
void vcu_settings_CALLBACK (void)
 
void vcu_move_up ()
 
void vcu_move_down ()
 
void vcu_select ()
 
void vcu_wheel_adjust (bool is_right_wheel, int8_t delta)
 
void vcu_toggle_regen (void)
 
void send_vcu_driver_request (void)
 

Variables

static char *const VCU_MODE_LABELS []
 
static char *const VCU_BINDING_LABELS []
 
static char *const ON_OFF_LABELS []
 
static menu_element_t vcu_elements [NUM_VCU_ELEMENTS]
 
menu_page_t vcu_page
 

Detailed Description

VCU page implementation.

Author
Irving Wang (irvin.nosp@m.gw@p.nosp@m.urdue.nosp@m..edu)

Enumeration Type Documentation

◆ vcu_elements_t

Enumerator
VCU_MODE_INDEX 
LATERAL_GAIN_INDEX 
LONG_GAIN_INDEX 
EBB_INDEX 
REGEN_INDEX 
TV_INDEX 
LEFT_WHEEL_INDEX 
RIGHT_WHEEL_INDEX 
NUM_VCU_ELEMENTS 

Function Documentation

◆ binding_to_element_index()

static uint8_t binding_to_element_index ( vcu_binding_t binding)
static
Here is the caller graph for this function:

◆ render_vcu_element()

static void render_vcu_element ( menu_element_t * element)
static
Here is the call graph for this function:
Here is the caller graph for this function:

◆ send_vcu_driver_request()

void send_vcu_driver_request ( void )
Here is the caller graph for this function:

◆ vcu_move_down()

void vcu_move_down ( void )
Here is the call graph for this function:

◆ vcu_move_up()

void vcu_move_up ( void )
Here is the call graph for this function:

◆ vcu_select()

void vcu_select ( void )
Here is the call graph for this function:

◆ vcu_settings_CALLBACK()

void vcu_settings_CALLBACK ( void )
Here is the call graph for this function:

◆ vcu_toggle_regen()

void vcu_toggle_regen ( void )
Here is the call graph for this function:
Here is the caller graph for this function:

◆ vcu_update()

void vcu_update ( void )
Here is the call graph for this function:

◆ vcu_wheel_adjust()

void vcu_wheel_adjust ( bool is_right_wheel,
int8_t delta )
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ ON_OFF_LABELS

char* const ON_OFF_LABELS[]
static
Initial value:
= {
[0] = "OFF",
[1] = "ON",
}

◆ VCU_BINDING_LABELS

char* const VCU_BINDING_LABELS[]
static
Initial value:
= {
[VCU_BINDING_LATERAL_GAIN] = "LAT GAIN",
[VCU_BINDING_EBB] = "EBB",
}
@ VCU_BINDING_EBB
Definition vcu.h:28
@ VCU_BINDING_LATERAL_GAIN
Definition vcu.h:26
@ VCU_BINDING_LONGITUDINAL_GAIN
Definition vcu.h:27

◆ vcu_elements

menu_element_t vcu_elements[NUM_VCU_ELEMENTS]
static

◆ VCU_MODE_LABELS

char* const VCU_MODE_LABELS[]
static
Initial value:
= {
[VCU_MODE_ACCEL] = "ACCEL",
[VCU_MODE_SKIDPAD] = "SKIDPAD",
[VCU_MODE_AUTOCROSS] = "AUTOCROSS",
[VCU_MODE_ENDURANCE] = "ENDURANCE",
[VCU_MODE_TUNING] = "TUNING"
}

◆ vcu_page

menu_page_t vcu_page
Initial value:
= {
.elements = vcu_elements,
.num_elements = NUM_VCU_ELEMENTS,
.current_index = 0,
.is_element_selected = false
}
static menu_element_t vcu_elements[NUM_VCU_ELEMENTS]
Definition vcu.c:76
@ NUM_VCU_ELEMENTS
Definition vcu.c:24