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

Race page implementation. More...

#include "race.h"
#include "common/nextion/nextion.h"
#include "can_library/generated/DASHBOARD.h"
#include "pedals.h"
#include "common/utils/max.h"
#include "colors.h"
Include dependency graph for race.c:

Functions

static void update_car_state_telemetry ()
 
static void update_motor_telemetry ()
 
static void update_igbt_telemetry ()
 
static void update_pack_telemetry ()
 
static void update_speed_telemetry ()
 
static void update_pedal_telemetry ()
 
static void update_tv_bar (char *obj_name, int16_t torque_req)
 
static void update_tv_telemetry ()
 
void race_telemetry_update ()
 Updates telemetry data on the race dashboard LCD display.
 

Variables

static constexpr float WHEEL_RADIUS_IN = 8.0f
 
static constexpr float GEAR_RATIO = 12.51f
 
static constexpr float WHEEL_CIRCUMFERENCE_IN = 2.0f * 3.14159f * WHEEL_RADIUS_IN
 
static constexpr float OUTPUT_REV_PER_MOTOR_REV = 1.0f / GEAR_RATIO
 
static constexpr float INCHES_PER_MOTOR_REV = WHEEL_CIRCUMFERENCE_IN * OUTPUT_REV_PER_MOTOR_REV
 
static constexpr float MINUTES_PER_HOUR = 60.0f
 
static constexpr float INCHES_PER_MILE = 63360.0f
 
static constexpr float RPM_TO_MPH = INCHES_PER_MOTOR_REV * MINUTES_PER_HOUR / INCHES_PER_MILE
 

Detailed Description

Race page implementation.

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

Function Documentation

◆ race_telemetry_update()

void race_telemetry_update ( )

Updates telemetry data on the race dashboard LCD display.

Only updates on race page. Displays 'S' for stale values.

Here is the call graph for this function:

◆ update_car_state_telemetry()

static void update_car_state_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_igbt_telemetry()

static void update_igbt_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_motor_telemetry()

static void update_motor_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pack_telemetry()

static void update_pack_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_pedal_telemetry()

static void update_pedal_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_speed_telemetry()

static void update_speed_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_tv_bar()

static void update_tv_bar ( char * obj_name,
int16_t torque_req )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_tv_telemetry()

static void update_tv_telemetry ( )
inlinestatic
Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ GEAR_RATIO

float GEAR_RATIO = 12.51f
staticconstexpr

◆ INCHES_PER_MILE

float INCHES_PER_MILE = 63360.0f
staticconstexpr

◆ INCHES_PER_MOTOR_REV

float INCHES_PER_MOTOR_REV = WHEEL_CIRCUMFERENCE_IN * OUTPUT_REV_PER_MOTOR_REV
staticconstexpr

◆ MINUTES_PER_HOUR

float MINUTES_PER_HOUR = 60.0f
staticconstexpr

◆ OUTPUT_REV_PER_MOTOR_REV

float OUTPUT_REV_PER_MOTOR_REV = 1.0f / GEAR_RATIO
staticconstexpr

◆ RPM_TO_MPH

float RPM_TO_MPH = INCHES_PER_MOTOR_REV * MINUTES_PER_HOUR / INCHES_PER_MILE
staticconstexpr

◆ WHEEL_CIRCUMFERENCE_IN

float WHEEL_CIRCUMFERENCE_IN = 2.0f * 3.14159f * WHEEL_RADIUS_IN
staticconstexpr

◆ WHEEL_RADIUS_IN

float WHEEL_RADIUS_IN = 8.0f
staticconstexpr