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

LCD display management. More...

#include "lcd.h"
#include <stddef.h>
#include <stdint.h>
#include "nextion.h"
#include "pages/race.h"
#include "pages/calibration.h"
#include "pages/faults.h"

Functions

void updatePage ()
 Updates LCD display page.
 
void LCD_init (uint32_t baud_rate)
 
void advancePage ()
 Advances to the next selectable page.
 
void backPage ()
 Moves to the previous selectable page.
 
void moveUp ()
 
void moveDown ()
 
void selectItem ()
 
void updateTelemetryPages ()
 Updates current telemetry page by calling its handler if available.
 

Variables

volatile page_t curr_page = PAGE_PREFLIGHT
 
volatile page_t prev_page = PAGE_PREFLIGHT
 
const page_handler_t page_handlers [NUM_PAGES]
 

Detailed Description

LCD display management.

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

Function Documentation

◆ updatePage()

void updatePage ( )

Updates LCD display page.

Key behaviors:

  • Maintains display of error pages when active

Variable Documentation

◆ page_handlers

const page_handler_t page_handlers[NUM_PAGES]
Initial value:
= {
[PAGE_RACE] = {
.update = nullptr,
.move_up = nullptr,
.move_down = nullptr,
.select = nullptr,
.telemetry = race_telemetry_update,
.string = RACE_STRING
},
[PAGE_FAULTS] = {
.update = faults_update,
.move_up = faults_move_up,
.move_down = faults_move_down,
.select = faults_select,
.telemetry = faults_telemetry_update,
.string = FAULT_STRING
},
[PAGE_CALIBRATION] = {
.update = nullptr,
.move_up = nullptr,
.move_down = nullptr,
.select = nullptr,
.string = CALIBRATION_STRING
}
}
void calibration_telemetry_update()
Updates the LCD display with current pedal telemetry data when on CALIBRATION page.
Definition calibration.c:23
void race_telemetry_update()
Updates telemetry data on the race dashboard LCD display.
Definition race.c:153