ow-dash-cube/Core/Inc/dashboard.h
2025-09-15 15:43:15 +02:00

58 lines
1.6 KiB
C
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#ifndef __DASHBOARD_H
#define __DASHBOARD_H
#include "LCD_driver.h"
#define COLOR_PRIMARY 0xfdaa
#define COLOR_SECONDARY 0x667f
#define COLOR_SUCCESS 0x3766
#define COLOR_ERROR 0xf226
#define COLOR_FG 0xFFFF
#define COLOR_BG 0x0000
#define COLOR_OFF 0x0000
void run_dashboard_loop();
void init();
void update_values();
void update_values_setup();
void update_adc();
void draw_init();
// Displays the battery voltage and percent, with the trip and life distances
// Input voltage from COMM_GET_VALUES, scale 10
// battery percent (level) from COMM_GET_VALUES_SETUP, scale 100
// trip distance from COMM_GET_VALUES_SETUP, scale 100
// life distance (odometer) from COMM_GET_VALUES_SETUP
void draw_battery(int16_t voltage, int32_t percent, int32_t trip_dist, uint32_t life_dist);
// Displays the power bars at the top
// Duty from COMM_GET_VALUES, scale 1000
void draw_power_bars(int16_t duty);
// Displays the huge speed counter with avg and max values.
// Speed from COMM_GET_VALUES_SETUP, scale 1000
void draw_speed(int32_t speed);
// Displays Current, Duty, Watts
// Current from COMM_GET_VALUES, scale 100
// Duty from COMM_GET_VALUES, scale 1000
// Input voltage from COMM_GET_VALUES, scale 10
void draw_power(int32_t amps, int16_t duty, int16_t voltage);
// Displays the two ADS voltages
//2 voltages from COMM_GET_DECODED_ADC, scale 1 000 000
void draw_adc(int32_t adc1, int32_t adc2);
// Displays the controller and motor temperatures
// 2 temperatures from COMM_GET_VALUES_SETUP, scale 10
void draw_temps(int16_t temp_fet, int16_t temp_motor);
#endif