mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 11:33:17 +02:00
Todo subido
This commit is contained in:
parent
f0db3a8aeb
commit
27026caf57
87 changed files with 83292 additions and 17 deletions
68
Pantalla/include/ajustes.hpp
Normal file
68
Pantalla/include/ajustes.hpp
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
#ifndef AJUSTES_HPP
|
||||
#define AJUSTES_HPP
|
||||
|
||||
#include "../include/guardado.hpp"
|
||||
|
||||
void set_data(data *datos);
|
||||
|
||||
int get_rpm();
|
||||
int get_desplazamiento();
|
||||
bool get_modo_oscuro();
|
||||
|
||||
int get_pantalla();
|
||||
int get_rpm_display();
|
||||
int get_diff_rpm();
|
||||
int get_recepcion_datos();
|
||||
|
||||
float get_vbatt_too_high();
|
||||
float get_vbatt_high();
|
||||
float get_vbatt_low();
|
||||
|
||||
int get_water_hot();
|
||||
int get_water_mild();
|
||||
int get_water_cold();
|
||||
|
||||
int get_oil_hot();
|
||||
int get_oil_mild();
|
||||
int get_oil_cold();
|
||||
|
||||
float get_oil_pressure_too_high();
|
||||
float get_oil_pressure_high();
|
||||
float get_oil_pressure_low();
|
||||
|
||||
float get_fuel_pressure_too_high();
|
||||
float get_fuel_pressure_high();
|
||||
float get_fuel_pressure_low();
|
||||
|
||||
void save();
|
||||
void load();
|
||||
|
||||
void update(
|
||||
int rpm_max,
|
||||
int desplazamiento,
|
||||
bool modo_oscuro,
|
||||
int pantalla,
|
||||
int rpm_display,
|
||||
int diff_rpm,
|
||||
int recepcion_datos,
|
||||
float vbatt_too_high,
|
||||
float vbatt_high,
|
||||
float vbatt_low,
|
||||
int water_hot,
|
||||
int water_mild,
|
||||
int water_cold,
|
||||
int oil_hot,
|
||||
int oil_mild,
|
||||
int oil_cold,
|
||||
float oil_pressure_too_high,
|
||||
float oil_pressure_high,
|
||||
float oil_pressure_low,
|
||||
float fuel_pressure_too_high,
|
||||
float fuel_pressure_high,
|
||||
float fuel_pressure_low
|
||||
);
|
||||
|
||||
int modify_value(int value, int modifier);
|
||||
float modify_value(float value, float modifier);
|
||||
|
||||
#endif
|
||||
63
Pantalla/include/can.hpp
Normal file
63
Pantalla/include/can.hpp
Normal file
|
|
@ -0,0 +1,63 @@
|
|||
#ifndef CAN_HPP
|
||||
#define CAN_HPP
|
||||
|
||||
#define RX_PIN 13
|
||||
#define TX_PIN 38
|
||||
#define POLLING_RATE_MS 1000
|
||||
#define TRANSMIT_RATE_MS 1000
|
||||
#define ID_BOTONES 5
|
||||
|
||||
#include "driver/twai.h"
|
||||
#include "common/common_libraries.hpp"
|
||||
#include "data_processor.hpp"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
class CAN {
|
||||
public:
|
||||
CAN(): _mutex(xSemaphoreCreateMutex()), _listen_task_handle(NULL), _iracing_task_handle(NULL), _should_stop_listening(false), _should_stop_iracing(false) {}
|
||||
~CAN();
|
||||
static void listenTask(void *arg);
|
||||
static void iracingTask(void *arg);
|
||||
void start();
|
||||
void listen();
|
||||
void start_listening_task();
|
||||
void stop_listening_task();
|
||||
void start_iracing_task();
|
||||
void stop_iracing_task();
|
||||
void send_frame(twai_message_t message);
|
||||
|
||||
void clear_rx_queue();
|
||||
|
||||
twai_message_t createBoolMessage(bool b0, bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7);
|
||||
twai_message_t mensaje_botonera(uint8_t B1, uint8_t B2, uint8_t B3, uint8_t B4, uint8_t levaizq, uint8_t levader);
|
||||
|
||||
void set_data_proccessor(DataProcessor *data_processor) {
|
||||
_data_processor = data_processor;
|
||||
}
|
||||
|
||||
SemaphoreHandle_t get_mutex() {
|
||||
return _mutex;
|
||||
}
|
||||
|
||||
void listen_id();
|
||||
void listen_id2();
|
||||
void data_update();
|
||||
|
||||
|
||||
private:
|
||||
twai_message_t _rx_message;
|
||||
DataProcessor *_data_processor;
|
||||
SemaphoreHandle_t _mutex;
|
||||
TaskHandle_t _listen_task_handle;
|
||||
TaskHandle_t _iracing_task_handle;
|
||||
volatile bool _should_stop_listening=0;
|
||||
volatile bool _should_stop_iracing=0;
|
||||
uint8_t _serial_protocol=0;
|
||||
uint8_t _serial_index=0;
|
||||
uint8_t _serial_buffer[21]={0};
|
||||
int test = 0;
|
||||
};
|
||||
|
||||
#endif
|
||||
9
Pantalla/include/common/common_libraries.hpp
Normal file
9
Pantalla/include/common/common_libraries.hpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef COMMON_LIBRARIES_HPP
|
||||
#define COMMON_LIBRARIES_HPP
|
||||
|
||||
#include <Arduino.h>
|
||||
#include "time.h"
|
||||
#include <ArduinoJson.h>
|
||||
#include <vector>
|
||||
|
||||
#endif
|
||||
98
Pantalla/include/common/crowpanel_pins.h
Normal file
98
Pantalla/include/common/crowpanel_pins.h
Normal file
|
|
@ -0,0 +1,98 @@
|
|||
#ifndef CROWPANEL_PINS_H
|
||||
#define CROWPANEL_PINS_H
|
||||
|
||||
// =============================================================================
|
||||
// CrowPanel 5.0" ESP32-S3 Pin Definitions
|
||||
// =============================================================================
|
||||
|
||||
|
||||
// Display Interface (RGB Parallel) - Reserved, do not use
|
||||
#define TFT_DE_PIN 40
|
||||
#define TFT_VSYNC_PIN 41
|
||||
#define TFT_HSYNC_PIN 39
|
||||
#define TFT_PCLK_PIN 0
|
||||
// RGB Data pins (R0-R4, G0-G5, B0-B4) - pins 1,3,4,5,6,7,8,9,14,15,16,21,45,46,47,48
|
||||
|
||||
// Touch Interface (I2C) - Reserved, do not use
|
||||
#define TOUCH_SDA_PIN 19 // GT911 I2C SDA
|
||||
#define TOUCH_SCL_PIN 20 // GT911 I2C SCL
|
||||
#define TOUCH_INT_PIN -1 // Touch interrupt (if used)
|
||||
#define TOUCH_RST_PIN -1 // Touch reset (if used)
|
||||
|
||||
// Backlight Control
|
||||
#define TFT_BL_PIN 2 // PWM backlight control
|
||||
|
||||
// Available GPIO pins for external connections
|
||||
// These pins are available on the CrowPanel expansion connectors
|
||||
|
||||
// Primary GPIO expansion (high priority usage)
|
||||
#define GPIO_AVAILABLE_1 1 // Available for LED strip or buttons
|
||||
#define GPIO_AVAILABLE_2 3 // Available for LED strip or buttons
|
||||
#define GPIO_AVAILABLE_3 8 // Available for buttons
|
||||
#define GPIO_AVAILABLE_4 9 // Available for buttons
|
||||
#define GPIO_AVAILABLE_5 10 // Available for buttons
|
||||
// #define GPIO_AVAILABLE_6 11 // Available for
|
||||
#define GPIO_AVAILABLE_7 12 // Available for buttons
|
||||
#define GPIO_AVAILABLE_8 13 // Available for buttons
|
||||
|
||||
// Secondary GPIO expansion (if more pins needed)
|
||||
#define GPIO_AVAILABLE_9 17 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_10 18 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_11 33 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_12 34 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_13 35 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_14 36 // Alternative GPIO
|
||||
#define GPIO_AVAILABLE_15 37 // Alternative GPIO
|
||||
// #define GPIO_AVAILABLE_16 38 // Alternative GPIO
|
||||
|
||||
// Power pins
|
||||
#define POWER_3V3 3.3 // 3.3V supply
|
||||
#define POWER_5V 5.0 // 5V supply
|
||||
#define POWER_GND 0 // Ground
|
||||
|
||||
// =============================================================================
|
||||
// Application-Specific Pin Assignments
|
||||
// =============================================================================
|
||||
|
||||
// LED Strip (WS2812B)
|
||||
#define LED_STRIP_PIN GPIO_AVAILABLE_1 // GPIO 1
|
||||
|
||||
// Wheel Buttons - Main buttons
|
||||
#define WHEEL_B1_PIN GPIO_AVAILABLE_2 // GPIO 3
|
||||
#define WHEEL_B2_PIN GPIO_AVAILABLE_3 // GPIO 8
|
||||
#define WHEEL_B3_PIN GPIO_AVAILABLE_4 // GPIO 9
|
||||
#define WHEEL_B4_PIN GPIO_AVAILABLE_5 // GPIO 10
|
||||
|
||||
// Wheel Button LEDs
|
||||
#define WHEEL_B1_LED_PIN GPIO_AVAILABLE_6 // GPIO 11
|
||||
#define WHEEL_B2_LED_PIN GPIO_AVAILABLE_7 // GPIO 12
|
||||
#define WHEEL_B3_LED_PIN GPIO_AVAILABLE_8 // GPIO 13
|
||||
#define WHEEL_B4_LED_PIN GPIO_AVAILABLE_9 // GPIO 17
|
||||
|
||||
// Paddle Shifters
|
||||
#define PADDLE_LEFT_PIN GPIO_AVAILABLE_10 // GPIO 18
|
||||
#define PADDLE_RIGHT_PIN GPIO_AVAILABLE_11 // GPIO 33
|
||||
|
||||
// Rotary Encoders
|
||||
#define ENCODER1_A_PIN GPIO_AVAILABLE_12 // GPIO 34
|
||||
#define ENCODER1_B_PIN GPIO_AVAILABLE_13 // GPIO 35
|
||||
#define ENCODER1_BTN_PIN GPIO_AVAILABLE_14 // GPIO 36
|
||||
|
||||
#define ENCODER2_A_PIN GPIO_AVAILABLE_15 // GPIO 37
|
||||
#define ENCODER2_B_PIN GPIO_AVAILABLE_16 // GPIO 38
|
||||
#define ENCODER2_BTN_PIN GPIO_AVAILABLE_1 // Reuse if needed
|
||||
|
||||
// =============================================================================
|
||||
// Hardware Validation
|
||||
// =============================================================================
|
||||
|
||||
// Ensure critical pins are not conflicting
|
||||
#if LED_STRIP_PIN == CAN_TX_PIN || LED_STRIP_PIN == CAN_RX_PIN
|
||||
#error "LED Strip pin conflicts with CAN interface"
|
||||
#endif
|
||||
|
||||
#if TOUCH_SDA_PIN == WHEEL_B1_PIN || TOUCH_SCL_PIN == WHEEL_B1_PIN
|
||||
#error "Wheel button pins conflict with touch interface"
|
||||
#endif
|
||||
|
||||
#endif // CROWPANEL_PINS_H
|
||||
36
Pantalla/include/common/display_id.hpp
Normal file
36
Pantalla/include/common/display_id.hpp
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
#ifndef DISPLAY_ID_HPP
|
||||
#define DISPLAY_ID_HPP
|
||||
|
||||
#define DISPLAY_0_ID 0x00
|
||||
#define DISPLAY_1_ID 0x01
|
||||
#define DISPLAY_2_ID 0x02
|
||||
#define DISPLAY_3_ID 0x03
|
||||
#define DISPLAY_4_ID 0x04
|
||||
|
||||
#define RPM_ID 0x51 //RPM
|
||||
#define ECT_IN_ID 0x52 //Temperatura entrada del radiador
|
||||
#define GEAR_ID 0x53 //Marcha
|
||||
#define TPS_ID 0x54 //Posición pedal acelerador
|
||||
#define BPS_ID 0x55 //Presión de freno
|
||||
#define BVOLT_ID 0x56 //Voltaje de batería
|
||||
#define LAMBDA_ID 0x57 //Lambda
|
||||
#define LR_WS_ID 0x58 //Velocidad de rueda LR
|
||||
#define RR_WS_ID 0x59 //Velocidad de rueda RR
|
||||
#define LF_WS_ID 0x60 //Velocidad de rueda LF
|
||||
#define RF_WS_ID 0x61 //Velocidad de rueda RF
|
||||
#define ECT_OUT_ID 0x62 //Temperatura salida del radiador
|
||||
#define IAT_ID 0x63 //IAT
|
||||
#define MAP_ID 0x64 //IAT
|
||||
#define AFR_ID 0x65 //Target Lambda
|
||||
#define CAN1_ID 0x66 //CAN_DIG#1
|
||||
#define CAN2_ID 0x67 //CAN_DIG#2
|
||||
#define CAN3_ID 0x68 //CAN_DIG#3
|
||||
#define CAN4_ID 0x69 //CAN_DIG#4
|
||||
#define CAN5_ID 0x70 //CAN_DIG#5
|
||||
#define CAN6_ID 0x71 //CAN_DIG#6
|
||||
#define TEMP_WARNING 0x72 //Warning de temperatura
|
||||
#define OIL_TEMP_ID 0x73 //Temperatura de aceite
|
||||
#define FUEL_PRESSURE_ID 0x74 //Presión de combustible
|
||||
#define BOTONES_ID 0x40
|
||||
|
||||
#endif
|
||||
9
Pantalla/include/common/telemetry_status.hpp
Normal file
9
Pantalla/include/common/telemetry_status.hpp
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
#ifndef TELEMETRY_STATUS_HPP
|
||||
#define TELEMETRY_STATUS_HPP
|
||||
|
||||
enum class TelemetryStatus {
|
||||
CONNECTED,
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
185
Pantalla/include/crowpanel_controller.hpp
Normal file
185
Pantalla/include/crowpanel_controller.hpp
Normal file
|
|
@ -0,0 +1,185 @@
|
|||
#ifndef CROWPANEL_CONTROLLER_HPP
|
||||
#define CROWPANEL_CONTROLLER_HPP
|
||||
|
||||
#include <lvgl.h>
|
||||
#include <DHT20.h>
|
||||
#include <SPI.h>
|
||||
#include <Wire.h>
|
||||
#include <LovyanGFX.hpp>
|
||||
#include <lgfx/v1/platforms/esp32s3/Panel_RGB.hpp>
|
||||
#include <lgfx/v1/platforms/esp32s3/Bus_RGB.hpp>
|
||||
#include "ui/ui.h"
|
||||
|
||||
#define TFT_BL 2
|
||||
|
||||
extern SemaphoreHandle_t lvgl_mutex;
|
||||
|
||||
class LGFX : public lgfx::LGFX_Device
|
||||
{
|
||||
public:
|
||||
lgfx::Bus_RGB _bus_instance;
|
||||
lgfx::Panel_RGB _panel_instance;
|
||||
lgfx::Light_PWM _light_instance;
|
||||
lgfx::Touch_GT911 _touch_instance;
|
||||
LGFX(void)
|
||||
{
|
||||
{
|
||||
auto cfg = _panel_instance.config();
|
||||
cfg.memory_width = 800;
|
||||
cfg.memory_height = 480;
|
||||
cfg.panel_width = 800;
|
||||
cfg.panel_height = 480;
|
||||
cfg.offset_x = 0;
|
||||
cfg.offset_y = 0;
|
||||
_panel_instance.config(cfg);
|
||||
}
|
||||
|
||||
{
|
||||
auto cfg = _bus_instance.config();
|
||||
cfg.panel = &_panel_instance;
|
||||
|
||||
cfg.pin_d0 = GPIO_NUM_8; // B0
|
||||
cfg.pin_d1 = GPIO_NUM_3; // B1
|
||||
cfg.pin_d2 = GPIO_NUM_46; // B2
|
||||
cfg.pin_d3 = GPIO_NUM_9; // B3
|
||||
cfg.pin_d4 = GPIO_NUM_1; // B4
|
||||
|
||||
cfg.pin_d5 = GPIO_NUM_5; // G0
|
||||
cfg.pin_d6 = GPIO_NUM_6; // G1
|
||||
cfg.pin_d7 = GPIO_NUM_7; // G2
|
||||
cfg.pin_d8 = GPIO_NUM_15; // G3
|
||||
cfg.pin_d9 = GPIO_NUM_16; // G4
|
||||
cfg.pin_d10 = GPIO_NUM_4; // G5
|
||||
|
||||
cfg.pin_d11 = GPIO_NUM_45; // R0
|
||||
cfg.pin_d12 = GPIO_NUM_48; // R1
|
||||
cfg.pin_d13 = GPIO_NUM_47; // R2
|
||||
cfg.pin_d14 = GPIO_NUM_21; // R3
|
||||
cfg.pin_d15 = GPIO_NUM_14; // R4
|
||||
|
||||
cfg.pin_henable = GPIO_NUM_40;
|
||||
cfg.pin_vsync = GPIO_NUM_41;
|
||||
cfg.pin_hsync = GPIO_NUM_39;
|
||||
cfg.pin_pclk = GPIO_NUM_0;
|
||||
cfg.freq_write = 15000000;
|
||||
|
||||
cfg.hsync_polarity = 0;
|
||||
cfg.hsync_front_porch = 8;
|
||||
cfg.hsync_pulse_width = 4;
|
||||
cfg.hsync_back_porch = 43;
|
||||
|
||||
cfg.vsync_polarity = 0;
|
||||
cfg.vsync_front_porch = 8;
|
||||
cfg.vsync_pulse_width = 4;
|
||||
cfg.vsync_back_porch = 12;
|
||||
|
||||
cfg.pclk_active_neg = 1;
|
||||
cfg.de_idle_high = 0;
|
||||
cfg.pclk_idle_high = 0;
|
||||
|
||||
_bus_instance.config(cfg);
|
||||
_panel_instance.setBus(&_bus_instance);
|
||||
}
|
||||
|
||||
{
|
||||
auto cfg = _light_instance.config();
|
||||
cfg.pin_bl = GPIO_NUM_2;
|
||||
_light_instance.config(cfg);
|
||||
_panel_instance.light(&_light_instance);
|
||||
}
|
||||
|
||||
{
|
||||
auto cfg = _touch_instance.config();
|
||||
cfg.x_min = 0;
|
||||
cfg.x_max = 799;
|
||||
cfg.y_min = 0;
|
||||
cfg.y_max = 479;
|
||||
cfg.pin_int = -1;
|
||||
cfg.pin_rst = -1;
|
||||
cfg.bus_shared = true;
|
||||
cfg.offset_rotation = 2;
|
||||
cfg.i2c_port = I2C_NUM_1;
|
||||
cfg.pin_sda = GPIO_NUM_19;
|
||||
cfg.pin_scl = GPIO_NUM_20;
|
||||
cfg.freq = 400000;
|
||||
cfg.i2c_addr = 0x14;
|
||||
_touch_instance.config(cfg);
|
||||
_panel_instance.setTouch(&_touch_instance);
|
||||
}
|
||||
setPanel(&_panel_instance);
|
||||
}
|
||||
};
|
||||
|
||||
class CrowPanelController {
|
||||
public:
|
||||
|
||||
bool encendido_pantalla=false;
|
||||
LGFX lcd;
|
||||
static uint32_t screenWidth;
|
||||
static uint32_t screenHeight;
|
||||
static lv_disp_draw_buf_t draw_buf;
|
||||
static lv_color_t disp_draw_buf[800 * 480 / 10];
|
||||
static lv_disp_drv_t disp_drv;
|
||||
static lv_indev_drv_t indev_drv;
|
||||
|
||||
CrowPanelController();
|
||||
void begin();
|
||||
static void my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p);
|
||||
static void my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data);
|
||||
static void set_value_to_label(lv_obj_t *label, double value);
|
||||
void set_string_to_label(lv_obj_t *label, const char *string);
|
||||
void change_screen();
|
||||
static void iniciar_pantalla(lv_timer_t * timer);
|
||||
void show_label(lv_obj_t *label);
|
||||
void hide_label(lv_obj_t *label);
|
||||
|
||||
// New methods for conditional color management
|
||||
void set_label_color(lv_obj_t *label, uint32_t color);
|
||||
void set_panel_color(lv_obj_t *panel, uint32_t bg_color);
|
||||
void set_conditional_colors();
|
||||
void update_rpm_bar(int rpm);
|
||||
int rpm_to_pixel(int rpm); // Update RPM LED bar based on RPM (8000-12500 range)
|
||||
static void create_rpm_bar(int, int);
|
||||
void inic_barra_rpm();
|
||||
static int set_lineal();
|
||||
|
||||
// Predefined colors for different conditions
|
||||
static const uint32_t COLOR_NORMAL = 0xFFFFFF; // White
|
||||
static const uint32_t COLOR_WARNING = 0xFFFF00; // Yellow
|
||||
static const uint32_t COLOR_CRITICAL = 0xFF0000; // Red
|
||||
static const uint32_t COLOR_GOOD = 0x00FF00; // Green
|
||||
static const uint32_t COLOR_INFO = 0xFF8500; // Orange (current label color)
|
||||
static const uint32_t COLOR_BLUE = 0x0080FF; // Blue
|
||||
static const uint32_t COLOR_PANEL_DEFAULT = 0x2C2C2C; // Dark grey for panel backgrounds
|
||||
|
||||
static const uint32_t COLOR_ROJO=0xFF5454; // Rojo mas oscuro
|
||||
static const uint32_t COLOR_VERDE=0x00CB36; // Verde mas oscuro
|
||||
static const uint32_t COLOR_NEGROP=0x101010; // El color negro de la pantalla negra
|
||||
|
||||
static const uint32_t COLOR_NEGRO_NUEVO=0x232323;
|
||||
static const uint32_t COLOR_ROJO_NUEVO=0x9E3D3D;
|
||||
static const uint32_t COLOR_VERDE_NUEVO=0x458F45;
|
||||
static const uint32_t COLOR_AMARILLO_NUEVO=0xA8A800;
|
||||
static const uint32_t COLOR_AZUL_NUEVO=0x02A6AC;
|
||||
static const uint32_t COLOR_BLANCO_NUEVO=0xd2d2d2;
|
||||
static const uint32_t COLOR_ROJO_BARRA=0xbb1818;
|
||||
static const uint32_t COLOR_FONDO_BARRA_OSCURO=0x3A3A3A;
|
||||
|
||||
static const uint32_t COLOR_AMARILLO_CLARO=0xD7D737;
|
||||
static const uint32_t COLOR_AZUL_CLARO=0x31CBD1;
|
||||
static const uint32_t COLOR_ROJO_CLARO=0xD54A4A;
|
||||
static const uint32_t COLOR_VERDE_CLARO=0x5BB95B;
|
||||
static const uint32_t COLOR_BLANCO_CLARO=0xE9E9E9;
|
||||
static const uint32_t COLOR_FONDO_BARRA_CLARO=0xAAAAAA;
|
||||
|
||||
private:
|
||||
|
||||
bool initialized=false;
|
||||
int new_screen=0;
|
||||
uint32_t last_parpadeo=0;
|
||||
bool last_rpm12300=false;
|
||||
bool parpadeo=false;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
38
Pantalla/include/data_processor.hpp
Normal file
38
Pantalla/include/data_processor.hpp
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
#ifndef DATAPROCESSOR_HPP
|
||||
#define DATAPROCESSOR_HPP
|
||||
|
||||
#include "common/common_libraries.hpp"
|
||||
#include "common/display_id.hpp"
|
||||
#include "led_strip.hpp"
|
||||
#include "crowpanel_controller.hpp"
|
||||
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
|
||||
class DataProcessor {
|
||||
public:
|
||||
DataProcessor() = default;
|
||||
void send_serial(byte type, unsigned int value);
|
||||
void send_serial_frame_0(int rpmh, int rpml, int tpsh, int tpsl, int ecth, int ectl, int gear);
|
||||
void send_serial_frame_1(int lfws, int rfws, int lrws, int rrws, int maph, int mapl, int ect);
|
||||
void send_serial_frame_2(int lambh, int lambl, int lamth, int lamtl, int bvolth, int bvoltl, int iat);
|
||||
void send_serial_frame_3(int oilth, int oiltl, int oilph, int oilpl, int maph, int mapl, int useless);
|
||||
void send_serial_frame_5(int aux1, int aux2, int aux3, int aux4, int aux5, int aux6, int aux7);
|
||||
void send_serial_frame_volante(int neutra, int cpant, int arrancar, int launch, int levaizq, int levader, int aux);
|
||||
void set_led_strip(LedStrip *led_strip){
|
||||
_led_strip = led_strip;
|
||||
}
|
||||
void set_crow_panel_controller(CrowPanelController *crow_panel_controller) {
|
||||
_crow_panel_controller = crow_panel_controller;
|
||||
}
|
||||
static void set_dataprocessor();
|
||||
void update_rpm_leds(int rpm);
|
||||
|
||||
private:
|
||||
LedStrip *_led_strip;
|
||||
CrowPanelController *_crow_panel_controller;
|
||||
int current_display=0;
|
||||
int request_screen=0;
|
||||
};
|
||||
|
||||
#endif
|
||||
83
Pantalla/include/g24_wheel_buttons.hpp
Normal file
83
Pantalla/include/g24_wheel_buttons.hpp
Normal file
|
|
@ -0,0 +1,83 @@
|
|||
#ifndef G24WHEELBUTTONS_HPP
|
||||
#define G24WHEELBUTTONS_HPP
|
||||
|
||||
#include "common/common_libraries.hpp"
|
||||
#include "can.hpp"
|
||||
#include "led_strip.hpp"
|
||||
#include "data_processor.hpp"
|
||||
#include "freertos/FreeRTOS.h"
|
||||
#include "freertos/semphr.h"
|
||||
#include "freertos/task.h"
|
||||
|
||||
#include "common/crowpanel_pins.h"
|
||||
|
||||
#include "can.hpp"
|
||||
|
||||
#define B1_PIN GPIO_NUM_2
|
||||
#define B2_PIN GPIO_NUM_4
|
||||
#define B3_PIN GPIO_NUM_42
|
||||
#define B4_PIN GPIO_NUM_40
|
||||
|
||||
/*
|
||||
#define B1_PIN GPIO_AVAILABLE_2
|
||||
#define B2_PIN GPIO_AVAILABLE_3
|
||||
#define B3_PIN GPIO_AVAILABLE_4
|
||||
#define B4_PIN GPIO_AVAILABLE_5
|
||||
*/
|
||||
#define B1_LED_PIN GPIO_NUM_3
|
||||
#define B2_LED_PIN GPIO_NUM_5
|
||||
#define B3_LED_PIN GPIO_NUM_41
|
||||
#define B4_LED_PIN GPIO_NUM_39
|
||||
|
||||
#define LEVA_IZQ_PIN GPIO_NUM_15
|
||||
#define LEVA_DER_PIN GPIO_NUM_16
|
||||
/*
|
||||
#define LEVA_IZQ_PIN GPIO_AVAILABLE_10
|
||||
#define LEVA_DER_PIN GPIO_AVAILABLE_11
|
||||
*/
|
||||
#define E1_PIN_A GPIO_NUM_11
|
||||
#define E1_PIN_B GPIO_NUM_10
|
||||
#define E2_PIN_A GPIO_NUM_36
|
||||
#define E2_PIN_B GPIO_NUM_35
|
||||
|
||||
#define E1_BUTTON_PIN GPIO_NUM_12
|
||||
#define E2_BUTTON_PIN GPIO_NUM_34
|
||||
|
||||
#define PRESS_TIME 30
|
||||
|
||||
class G24WheelButtons {
|
||||
public:
|
||||
void ejecucion();
|
||||
void begin();
|
||||
static void botonera(void *arg);
|
||||
static void updateTask(void *arg);
|
||||
void set_can(CAN *can){
|
||||
_can = can;
|
||||
}
|
||||
|
||||
private:
|
||||
CAN *_can=nullptr;
|
||||
void estado_boton(gpio_num_t buttonPin, volatile bool &buttonState, volatile bool &laststate, volatile unsigned long &lastPressTime, volatile unsigned long &temporizador);
|
||||
void check_boton();
|
||||
|
||||
static const unsigned long debounceTime = 50; // milliseconds
|
||||
|
||||
struct boton{
|
||||
volatile bool estado=false;
|
||||
volatile bool last_estado=false;
|
||||
volatile unsigned long lastPressTime=0;
|
||||
volatile unsigned long temporizador=0;
|
||||
};
|
||||
|
||||
boton B1;
|
||||
boton B2;
|
||||
boton B3;
|
||||
boton B4;
|
||||
boton levaizq;
|
||||
boton levader;
|
||||
|
||||
bool estado_tarea=false;
|
||||
TaskHandle_t manejador_tarea=nullptr;
|
||||
};
|
||||
|
||||
#endif
|
||||
99
Pantalla/include/guardado.hpp
Normal file
99
Pantalla/include/guardado.hpp
Normal file
|
|
@ -0,0 +1,99 @@
|
|||
#ifndef GUARDADO_HPP
|
||||
#define GUARDADO_HPP
|
||||
|
||||
#define nombre_archivo "/guardado.txt"
|
||||
|
||||
class data{
|
||||
|
||||
public:
|
||||
void load_data();
|
||||
void save_data();
|
||||
|
||||
void update_data(
|
||||
int rpm_maxn,
|
||||
int desplazamienton,
|
||||
bool modo_oscuron,
|
||||
int pantallan,
|
||||
int rpm_displayn,
|
||||
int diff_rpmn,
|
||||
int recepcion_datosn,
|
||||
float vbatt_too_highn,
|
||||
float vbatt_highn,
|
||||
float vbatt_lown,
|
||||
int water_hotn,
|
||||
int water_mildn,
|
||||
int water_coldn,
|
||||
int oil_hotn,
|
||||
int oil_mildn,
|
||||
int oil_coldn,
|
||||
float oil_pressure_too_highn,
|
||||
float oil_pressure_highn,
|
||||
float oil_pressure_lown,
|
||||
float fuel_pressure_too_highn,
|
||||
float fuel_pressure_highn,
|
||||
float fuel_pressure_lown
|
||||
);
|
||||
|
||||
int get_rpm();
|
||||
int get_desplazamiento();
|
||||
bool get_modo_oscuro();
|
||||
|
||||
int get_pantalla();
|
||||
int get_rpm_display();
|
||||
int get_diff_rpm();
|
||||
int get_recepcion_datos();
|
||||
|
||||
float get_vbatt_too_high();
|
||||
float get_vbatt_high();
|
||||
float get_vbatt_low();
|
||||
|
||||
int get_water_hot();
|
||||
int get_water_mild();
|
||||
int get_water_cold();
|
||||
|
||||
int get_oil_hot();
|
||||
int get_oil_mild();
|
||||
int get_oil_cold();
|
||||
|
||||
float get_oil_pressure_too_high();
|
||||
float get_oil_pressure_high();
|
||||
float get_oil_pressure_low();
|
||||
|
||||
float get_fuel_pressure_too_high();
|
||||
float get_fuel_pressure_high();
|
||||
float get_fuel_pressure_low();
|
||||
|
||||
private:
|
||||
int rpm_max=8000;
|
||||
int desplazamiento=0;
|
||||
bool modo_oscuro=true;
|
||||
|
||||
int pantalla=0;
|
||||
int rpm_display=false;
|
||||
int diff_rpm=0;
|
||||
int recepcion_datos=0;
|
||||
|
||||
float vbatt_too_high=0;
|
||||
float vbatt_high=0;
|
||||
float vbatt_low=0;
|
||||
|
||||
|
||||
int water_hot=0;
|
||||
int water_mild=0;
|
||||
int water_cold=0;
|
||||
|
||||
int oil_hot=0;
|
||||
int oil_mild=0;
|
||||
int oil_cold=0;
|
||||
|
||||
float oil_pressure_too_high=0;
|
||||
float oil_pressure_high=0;
|
||||
float oil_pressure_low=0;
|
||||
|
||||
float fuel_pressure_too_high=0;
|
||||
float fuel_pressure_high=0;
|
||||
float fuel_pressure_low=0;
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
40
Pantalla/include/led_strip.hpp
Normal file
40
Pantalla/include/led_strip.hpp
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
#ifndef LED_STRIP_HPP
|
||||
#define LED_STRIP_HPP
|
||||
|
||||
#include <Adafruit_NeoPixel.h>
|
||||
#include "common/crowpanel_pins.h"
|
||||
|
||||
#define PIN_WS2812B 6
|
||||
//#define PIN_WS2812B GPIO_AVAILABLE_1
|
||||
#define NUM_PIXELS 18
|
||||
#define T_PARPADEO 50
|
||||
|
||||
#define STOP_CAR_WARNING 1
|
||||
|
||||
#define RPM_MIN 8000
|
||||
#define RPM_MAX 12500
|
||||
|
||||
class LedStrip{
|
||||
public:
|
||||
LedStrip(): _ws2812b(NUM_PIXELS, PIN_WS2812B, NEO_GRB + NEO_KHZ800), _warning(0), _brightness(255) {}
|
||||
|
||||
void begin(){
|
||||
_ws2812b.begin();
|
||||
}
|
||||
|
||||
void display_rpm(int rpm);
|
||||
void display_startup();
|
||||
void launch_control(bool estado);
|
||||
|
||||
private:
|
||||
Adafruit_NeoPixel _ws2812b;
|
||||
SemaphoreHandle_t _mutex;
|
||||
int _rpm;
|
||||
int _warning;
|
||||
int _brightness;
|
||||
bool launch=false;
|
||||
uint32_t last_parpadeo=0;
|
||||
bool estado_parpadeo=false;
|
||||
};
|
||||
|
||||
#endif
|
||||
55
Pantalla/include/led_strip_fl.hpp
Normal file
55
Pantalla/include/led_strip_fl.hpp
Normal file
|
|
@ -0,0 +1,55 @@
|
|||
// #ifndef LED_STRIP_HPP
|
||||
// #define LED_STRIP_HPP
|
||||
|
||||
// #include <FastLED.h>
|
||||
|
||||
// #define PIN_WS2812B 6
|
||||
// #define NUM_PIXELS 18
|
||||
|
||||
// #define STOP_CAR_WARNING 1
|
||||
|
||||
// #define RPM_MIN 6000
|
||||
// #define RPM_MAX 11000
|
||||
|
||||
// class LedStrip{
|
||||
// public:
|
||||
// LedStrip(): _warning(0), _brightness(255) {}
|
||||
|
||||
// static void updateTask(void *arg) {
|
||||
// LedStrip *ledStrip = static_cast<LedStrip*>(arg);
|
||||
// ledStrip->update();
|
||||
// vTaskDelete(NULL);
|
||||
// }
|
||||
|
||||
// void update();
|
||||
|
||||
// void set_rpm(int rpm);
|
||||
|
||||
// void begin(){
|
||||
// FastLED.addLeds<WS2812B, PIN_WS2812B, GRB>(_leds, NUM_PIXELS);
|
||||
// FastLED.setBrightness(_brightness);
|
||||
// }
|
||||
|
||||
// void set_brightness(uint8_t brightness) {
|
||||
// _brightness = brightness;
|
||||
// FastLED.setBrightness(_brightness);
|
||||
// FastLED.show();
|
||||
// }
|
||||
|
||||
// void set_mutex(SemaphoreHandle_t mutex){
|
||||
// _mutex = mutex;
|
||||
// }
|
||||
|
||||
// void display_warning(int warning);
|
||||
// void display_rpm(int rpm);
|
||||
// void display_startup();
|
||||
|
||||
// private:
|
||||
// CRGB _leds[NUM_PIXELS];
|
||||
// SemaphoreHandle_t _mutex;
|
||||
// int _rpm;
|
||||
// int _warning;
|
||||
// int _brightness;
|
||||
// };
|
||||
|
||||
// #endif
|
||||
68
Pantalla/include/ui/ui.h
Normal file
68
Pantalla/include/ui/ui.h
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef _G26_V3_UI_H
|
||||
#define _G26_V3_UI_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#if defined __has_include
|
||||
#if __has_include("lvgl.h")
|
||||
#include "lvgl.h"
|
||||
#elif __has_include("lvgl/lvgl.h")
|
||||
#include "lvgl/lvgl.h"
|
||||
#else
|
||||
#include "lvgl.h"
|
||||
#endif
|
||||
#else
|
||||
#include "lvgl.h"
|
||||
#endif
|
||||
|
||||
#include "ui_helpers.h"
|
||||
#include "ui_events.h"
|
||||
#include "ui_theme_manager.h"
|
||||
#include "ui_themes.h"
|
||||
|
||||
///////////////////// SCREENS ////////////////////
|
||||
|
||||
#include "ui_bootscreen.h"
|
||||
#include "ui_Screen1.h"
|
||||
#include "ui_settingscreen.h"
|
||||
#include "ui_Screen2.h"
|
||||
|
||||
///////////////////// VARIABLES ////////////////////
|
||||
|
||||
|
||||
// EVENTS
|
||||
|
||||
extern lv_obj_t * ui____initial_actions0;
|
||||
|
||||
// IMAGES AND IMAGE SETS
|
||||
LV_IMG_DECLARE(ui_img_logo_volante_png); // assets/Logo_volante.png
|
||||
|
||||
// FONTS
|
||||
LV_FONT_DECLARE(ui_font_ajustes);
|
||||
LV_FONT_DECLARE(ui_font_ajustesnames);
|
||||
LV_FONT_DECLARE(ui_font_labeld);
|
||||
LV_FONT_DECLARE(ui_font_labeld2);
|
||||
LV_FONT_DECLARE(ui_font_labelt);
|
||||
LV_FONT_DECLARE(ui_font_neutral);
|
||||
LV_FONT_DECLARE(ui_font_offon);
|
||||
LV_FONT_DECLARE(ui_font_rpm);
|
||||
LV_FONT_DECLARE(ui_font_speed);
|
||||
LV_FONT_DECLARE(ui_font_speedlabel);
|
||||
LV_FONT_DECLARE(ui_font_warmup);
|
||||
|
||||
// UI INIT
|
||||
void ui_init(void);
|
||||
void ui_destroy(void);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
123
Pantalla/include/ui/ui_Screen1.h
Normal file
123
Pantalla/include/ui/ui_Screen1.h
Normal file
|
|
@ -0,0 +1,123 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef UI_SCREEN1_H
|
||||
#define UI_SCREEN1_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Screen1
|
||||
extern void ui_Screen1_screen_init(void);
|
||||
extern void ui_Screen1_screen_destroy(void);
|
||||
extern lv_obj_t * ui_Screen1;
|
||||
extern lv_obj_t * ui_main;
|
||||
extern lv_obj_t * ui_barcontainer;
|
||||
extern lv_obj_t * ui_rpm0;
|
||||
extern lv_obj_t * ui_rpmt0;
|
||||
extern lv_obj_t * ui_rpm1;
|
||||
extern lv_obj_t * ui_rpm2;
|
||||
extern lv_obj_t * ui_rpmt1;
|
||||
extern lv_obj_t * ui_rpm3;
|
||||
extern lv_obj_t * ui_rpm4;
|
||||
extern lv_obj_t * ui_rpmt2;
|
||||
extern lv_obj_t * ui_rpm5;
|
||||
extern lv_obj_t * ui_rpm6;
|
||||
extern lv_obj_t * ui_rpmt3;
|
||||
extern lv_obj_t * ui_rpm7;
|
||||
extern lv_obj_t * ui_rpm8;
|
||||
extern lv_obj_t * ui_rpmt4;
|
||||
extern lv_obj_t * ui_rpm9;
|
||||
extern lv_obj_t * ui_rpm10;
|
||||
extern lv_obj_t * ui_rpmt5;
|
||||
extern lv_obj_t * ui_rpm11;
|
||||
extern lv_obj_t * ui_rpm12;
|
||||
extern lv_obj_t * ui_rpmt6;
|
||||
extern lv_obj_t * ui_rpm13;
|
||||
extern lv_obj_t * ui_rpmt16;
|
||||
extern lv_obj_t * ui_rpmt7;
|
||||
extern lv_obj_t * ui_rpmt8;
|
||||
extern lv_obj_t * ui_rpmt9;
|
||||
extern lv_obj_t * ui_rpmt10;
|
||||
extern lv_obj_t * ui_rpmt11;
|
||||
extern lv_obj_t * ui_rpmt12;
|
||||
extern lv_obj_t * ui_rpmbaja1;
|
||||
extern lv_obj_t * ui_rpmbaja2;
|
||||
extern lv_obj_t * ui_rpmbaja3;
|
||||
extern lv_obj_t * ui_rpmbaja4;
|
||||
extern lv_obj_t * ui_rpmbaja5;
|
||||
extern lv_obj_t * ui_rpmbaja6;
|
||||
extern lv_obj_t * ui_rpmbaja7;
|
||||
extern lv_obj_t * ui_tiraledsrpmcontainer;
|
||||
extern lv_obj_t * ui_led0;
|
||||
extern lv_obj_t * ui_led1;
|
||||
extern lv_obj_t * ui_led2;
|
||||
extern lv_obj_t * ui_led3;
|
||||
extern lv_obj_t * ui_led4;
|
||||
extern lv_obj_t * ui_led5;
|
||||
extern lv_obj_t * ui_led6;
|
||||
extern lv_obj_t * ui_led7;
|
||||
extern lv_obj_t * ui_led8;
|
||||
extern lv_obj_t * ui_led9;
|
||||
extern lv_obj_t * ui_led10;
|
||||
extern lv_obj_t * ui_led11;
|
||||
extern lv_obj_t * ui_led12;
|
||||
extern lv_obj_t * ui_led13;
|
||||
extern lv_obj_t * ui_led14;
|
||||
extern lv_obj_t * ui_barrpm;
|
||||
extern lv_obj_t * ui_rpma;
|
||||
extern lv_obj_t * ui_rpmb;
|
||||
extern lv_obj_t * ui_rpmname;
|
||||
extern lv_obj_t * ui_rpm;
|
||||
extern lv_obj_t * ui_oiltpanel;
|
||||
extern lv_obj_t * ui_oilt;
|
||||
extern lv_obj_t * ui_oiltname;
|
||||
extern lv_obj_t * ui_oiltseparator;
|
||||
extern lv_obj_t * ui_oilppanel;
|
||||
extern lv_obj_t * ui_oilp;
|
||||
extern lv_obj_t * ui_oilpseparator;
|
||||
extern lv_obj_t * ui_oilpname;
|
||||
extern lv_obj_t * ui_fuelppanel;
|
||||
extern lv_obj_t * ui_fuelp;
|
||||
extern lv_obj_t * ui_fuelpseparator;
|
||||
extern lv_obj_t * ui_fuelpname;
|
||||
extern lv_obj_t * ui_lambdapanel;
|
||||
extern lv_obj_t * ui_lambda;
|
||||
extern lv_obj_t * ui_lambdaname;
|
||||
extern lv_obj_t * ui_lambdaseparator;
|
||||
extern lv_obj_t * ui_watertpanel;
|
||||
extern lv_obj_t * ui_watert;
|
||||
extern lv_obj_t * ui_watertseparator;
|
||||
extern lv_obj_t * ui_watertname;
|
||||
extern lv_obj_t * ui_sdownpanel;
|
||||
extern lv_obj_t * ui_sdownname;
|
||||
extern lv_obj_t * ui_sdown;
|
||||
extern lv_obj_t * ui_sdownseparator;
|
||||
extern lv_obj_t * ui_vbatpanel;
|
||||
extern lv_obj_t * ui_vbat;
|
||||
extern lv_obj_t * ui_vbatseparator;
|
||||
extern lv_obj_t * ui_vbatname;
|
||||
extern lv_obj_t * ui_fanpanel;
|
||||
extern lv_obj_t * ui_fanname;
|
||||
extern lv_obj_t * ui_fan;
|
||||
extern lv_obj_t * ui_fanseparator;
|
||||
extern lv_obj_t * ui_neutralpanel;
|
||||
extern lv_obj_t * ui_neutral;
|
||||
extern lv_obj_t * ui_warmuppanel;
|
||||
extern lv_obj_t * ui_warmup;
|
||||
extern void ui_event_botonshowajustes(lv_event_t * e);
|
||||
extern lv_obj_t * ui_botonshowajustes;
|
||||
extern void ui_event_ajustesboton(lv_event_t * e);
|
||||
extern lv_obj_t * ui_ajustesboton;
|
||||
extern lv_obj_t * ui_ajustesnombre;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
81
Pantalla/include/ui/ui_Screen2.h
Normal file
81
Pantalla/include/ui/ui_Screen2.h
Normal file
|
|
@ -0,0 +1,81 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef UI_SCREEN2_H
|
||||
#define UI_SCREEN2_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_Screen2
|
||||
extern void ui_Screen2_screen_init(void);
|
||||
extern void ui_Screen2_screen_destroy(void);
|
||||
extern lv_obj_t * ui_Screen2;
|
||||
extern lv_obj_t * ui_aux1panel;
|
||||
extern lv_obj_t * ui_aux1name;
|
||||
extern lv_obj_t * ui_aux1;
|
||||
extern lv_obj_t * ui_aux1separator;
|
||||
extern lv_obj_t * ui_aux3panel;
|
||||
extern lv_obj_t * ui_aux3name;
|
||||
extern lv_obj_t * ui_aux3;
|
||||
extern lv_obj_t * ui_aux3separator;
|
||||
extern lv_obj_t * ui_aux4panel;
|
||||
extern lv_obj_t * ui_aux4name;
|
||||
extern lv_obj_t * ui_aux4;
|
||||
extern lv_obj_t * ui_aux4separator;
|
||||
extern lv_obj_t * ui_aux5panel;
|
||||
extern lv_obj_t * ui_aux5name;
|
||||
extern lv_obj_t * ui_aux5;
|
||||
extern lv_obj_t * ui_aux5separator;
|
||||
extern lv_obj_t * ui_aux6panel;
|
||||
extern lv_obj_t * ui_aux6name;
|
||||
extern lv_obj_t * ui_aux6;
|
||||
extern lv_obj_t * ui_aux6separator;
|
||||
extern lv_obj_t * ui_aux7panel;
|
||||
extern lv_obj_t * ui_aux7name;
|
||||
extern lv_obj_t * ui_aux7;
|
||||
extern lv_obj_t * ui_aux7separator;
|
||||
extern lv_obj_t * ui_aux8panel;
|
||||
extern lv_obj_t * ui_aux8name;
|
||||
extern lv_obj_t * ui_aux8;
|
||||
extern lv_obj_t * ui_aux8separator;
|
||||
extern lv_obj_t * ui_dig1panel;
|
||||
extern lv_obj_t * ui_dig1name;
|
||||
extern lv_obj_t * ui_dig1;
|
||||
extern lv_obj_t * ui_dig1separator;
|
||||
extern lv_obj_t * ui_throttlepanel;
|
||||
extern lv_obj_t * ui_throttlename;
|
||||
extern lv_obj_t * ui_throttle;
|
||||
extern lv_obj_t * ui_throttleseparator;
|
||||
extern lv_obj_t * ui_nousepanel;
|
||||
extern lv_obj_t * ui_nousename;
|
||||
extern lv_obj_t * ui_nouse;
|
||||
extern lv_obj_t * ui_nouseseparator;
|
||||
extern lv_obj_t * ui_lambdtrgapanel;
|
||||
extern lv_obj_t * ui_lambdatrgname;
|
||||
extern lv_obj_t * ui_lambdatrg;
|
||||
extern lv_obj_t * ui_lambdatrgseparator;
|
||||
extern lv_obj_t * ui_mappanel;
|
||||
extern lv_obj_t * ui_mapname;
|
||||
extern lv_obj_t * ui_map;
|
||||
extern lv_obj_t * ui_mapseparator;
|
||||
extern lv_obj_t * ui_brakepanel;
|
||||
extern lv_obj_t * ui_brakename;
|
||||
extern lv_obj_t * ui_brake;
|
||||
extern lv_obj_t * ui_brakeseparator;
|
||||
extern void ui_event_botonshowajustes2(lv_event_t * e);
|
||||
extern lv_obj_t * ui_botonshowajustes2;
|
||||
extern void ui_event_ajustesboton2(lv_event_t * e);
|
||||
extern lv_obj_t * ui_ajustesboton2;
|
||||
extern lv_obj_t * ui_ajustesnombre2;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
25
Pantalla/include/ui/ui_bootscreen.h
Normal file
25
Pantalla/include/ui/ui_bootscreen.h
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef UI_BOOTSCREEN_H
|
||||
#define UI_BOOTSCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_bootscreen
|
||||
extern void ui_bootscreen_screen_init(void);
|
||||
extern void ui_bootscreen_screen_destroy(void);
|
||||
extern lv_obj_t * ui_bootscreen;
|
||||
extern lv_obj_t * ui_logoboot;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
69
Pantalla/include/ui/ui_events.h
Normal file
69
Pantalla/include/ui/ui_events.h
Normal file
|
|
@ -0,0 +1,69 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26
|
||||
|
||||
#ifndef _UI_EVENTS_H
|
||||
#define _UI_EVENTS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
void abrirajustes(lv_event_t * e);
|
||||
void cerrarajustes(lv_event_t * e);
|
||||
void opcionesdrop(lv_event_t * e);
|
||||
void themesitch(lv_event_t * e);
|
||||
void cambiarpantalla(lv_event_t * e);
|
||||
void cambiardatos(lv_event_t * e);
|
||||
|
||||
void lessrpm_(lv_event_t * e);
|
||||
void morerpm_(lv_event_t * e);
|
||||
void lessdesp(lv_event_t * e);
|
||||
void moredesp(lv_event_t * e);
|
||||
void rpmdisplay(lv_event_t * e);
|
||||
void lessdiffrpm(lv_event_t * e);
|
||||
void morediffrpm(lv_event_t * e);
|
||||
|
||||
void lessvbatttoohigh(lv_event_t * e);
|
||||
void morevbatttoohigh(lv_event_t * e);
|
||||
void lessvbatthigh(lv_event_t * e);
|
||||
void morebvbatthigh(lv_event_t * e);
|
||||
void lessvbattlow(lv_event_t * e);
|
||||
void morevbattlow(lv_event_t * e);
|
||||
|
||||
void lesswaterhot(lv_event_t * e);
|
||||
void mroewaterhot(lv_event_t * e);
|
||||
void lesswatermild(lv_event_t * e);
|
||||
void morewatermild(lv_event_t * e);
|
||||
void lesswatercold(lv_event_t * e);
|
||||
void morewatercold(lv_event_t * e);
|
||||
|
||||
void lessoilhot(lv_event_t * e);
|
||||
void moreoilhot(lv_event_t * e);
|
||||
void lessoilmild(lv_event_t * e);
|
||||
void moreoilmild(lv_event_t * e);
|
||||
void lessoilcold(lv_event_t * e);
|
||||
void moreoilcold(lv_event_t * e);
|
||||
|
||||
void lessoilptoohigh(lv_event_t * e);
|
||||
void moreoilptoohigh(lv_event_t * e);
|
||||
void lessoilphigh(lv_event_t * e);
|
||||
void moreoilphigh(lv_event_t * e);
|
||||
void lessoilplow(lv_event_t * e);
|
||||
void moreoilplow(lv_event_t * e);
|
||||
|
||||
void lessfuelptoohigh(lv_event_t * e);
|
||||
void morefuelptoohigh(lv_event_t * e);
|
||||
void lessfuelphigh(lv_event_t * e);
|
||||
void morefuelphigh(lv_event_t * e);
|
||||
void lessfuelp(lv_event_t * e);
|
||||
void morefuelplow(lv_event_t * e);
|
||||
|
||||
void refresh_ui_values();
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
148
Pantalla/include/ui/ui_helpers.h
Normal file
148
Pantalla/include/ui/ui_helpers.h
Normal file
|
|
@ -0,0 +1,148 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef _G26_V3_UI_HELPERS_H
|
||||
#define _G26_V3_UI_HELPERS_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#include "ui.h"
|
||||
|
||||
#define _UI_TEMPORARY_STRING_BUFFER_SIZE 32
|
||||
#define _UI_BAR_PROPERTY_VALUE 0
|
||||
#define _UI_BAR_PROPERTY_VALUE_WITH_ANIM 1
|
||||
void _ui_bar_set_property(lv_obj_t * target, int id, int val);
|
||||
|
||||
#define _UI_BASIC_PROPERTY_POSITION_X 0
|
||||
#define _UI_BASIC_PROPERTY_POSITION_Y 1
|
||||
#define _UI_BASIC_PROPERTY_WIDTH 2
|
||||
#define _UI_BASIC_PROPERTY_HEIGHT 3
|
||||
void _ui_basic_set_property(lv_obj_t * target, int id, int val);
|
||||
|
||||
#define _UI_DROPDOWN_PROPERTY_SELECTED 0
|
||||
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val);
|
||||
|
||||
#define _UI_IMAGE_PROPERTY_IMAGE 0
|
||||
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val);
|
||||
|
||||
#define _UI_LABEL_PROPERTY_TEXT 0
|
||||
void _ui_label_set_property(lv_obj_t * target, int id, const char * val);
|
||||
|
||||
#define _UI_ROLLER_PROPERTY_SELECTED 0
|
||||
#define _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM 1
|
||||
void _ui_roller_set_property(lv_obj_t * target, int id, int val);
|
||||
|
||||
#define _UI_SLIDER_PROPERTY_VALUE 0
|
||||
#define _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM 1
|
||||
void _ui_slider_set_property(lv_obj_t * target, int id, int val);
|
||||
|
||||
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void));
|
||||
|
||||
void _ui_screen_delete(void (*target)(void));
|
||||
|
||||
void _ui_arc_increment(lv_obj_t * target, int val);
|
||||
|
||||
void _ui_bar_increment(lv_obj_t * target, int val, int anm);
|
||||
|
||||
void _ui_slider_increment(lv_obj_t * target, int val, int anm);
|
||||
|
||||
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea);
|
||||
|
||||
#define _UI_MODIFY_FLAG_ADD 0
|
||||
#define _UI_MODIFY_FLAG_REMOVE 1
|
||||
#define _UI_MODIFY_FLAG_TOGGLE 2
|
||||
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value);
|
||||
|
||||
#define _UI_MODIFY_STATE_ADD 0
|
||||
#define _UI_MODIFY_STATE_REMOVE 1
|
||||
#define _UI_MODIFY_STATE_TOGGLE 2
|
||||
void _ui_state_modify(lv_obj_t * target, int32_t state, int value);
|
||||
|
||||
#define UI_MOVE_CURSOR_UP 0
|
||||
#define UI_MOVE_CURSOR_RIGHT 1
|
||||
#define UI_MOVE_CURSOR_DOWN 2
|
||||
#define UI_MOVE_CURSOR_LEFT 3
|
||||
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
|
||||
;
|
||||
|
||||
|
||||
void scr_unloaded_delete_cb(lv_event_t * e);
|
||||
|
||||
void _ui_opacity_set(lv_obj_t * target, int val);
|
||||
|
||||
/** Describes an animation*/
|
||||
typedef struct _ui_anim_user_data_t {
|
||||
lv_obj_t * target;
|
||||
lv_img_dsc_t ** imgset;
|
||||
int32_t imgset_size;
|
||||
int32_t val;
|
||||
} ui_anim_user_data_t;
|
||||
void _ui_anim_callback_free_user_data(lv_anim_t * a);
|
||||
|
||||
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v);
|
||||
|
||||
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v);
|
||||
|
||||
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v);
|
||||
|
||||
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v);
|
||||
|
||||
|
||||
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v);
|
||||
|
||||
|
||||
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v);
|
||||
|
||||
|
||||
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v);
|
||||
|
||||
|
||||
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_x(lv_anim_t * a);
|
||||
|
||||
int32_t _ui_anim_callback_get_y(lv_anim_t * a);
|
||||
|
||||
int32_t _ui_anim_callback_get_width(lv_anim_t * a);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_height(lv_anim_t * a);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a);
|
||||
|
||||
|
||||
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a);
|
||||
|
||||
|
||||
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
|
||||
|
||||
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix);
|
||||
|
||||
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off);
|
||||
|
||||
void _ui_spinbox_step(lv_obj_t * target, int val)
|
||||
;
|
||||
|
||||
|
||||
void _ui_switch_theme(int val)
|
||||
;
|
||||
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
196
Pantalla/include/ui/ui_settingscreen.h
Normal file
196
Pantalla/include/ui/ui_settingscreen.h
Normal file
|
|
@ -0,0 +1,196 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef UI_SETTINGSCREEN_H
|
||||
#define UI_SETTINGSCREEN_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
// SCREEN: ui_settingscreen
|
||||
extern void ui_settingscreen_screen_init(void);
|
||||
extern void ui_settingscreen_screen_destroy(void);
|
||||
extern lv_obj_t * ui_settingscreen;
|
||||
extern lv_obj_t * ui_cross1;
|
||||
extern lv_obj_t * ui_cross2;
|
||||
extern void ui_event_cerrarajustesboton(lv_event_t * e);
|
||||
extern lv_obj_t * ui_cerrarajustesboton;
|
||||
extern lv_obj_t * ui_ajustesname;
|
||||
extern lv_obj_t * ui_ajustesseparator;
|
||||
extern lv_obj_t * ui_opcionname;
|
||||
extern void ui_event_opciondrop(lv_event_t * e);
|
||||
extern lv_obj_t * ui_opciondrop;
|
||||
extern lv_obj_t * ui_settingsmain;
|
||||
extern lv_obj_t * ui_modooscuroname;
|
||||
extern void ui_event_modooscuoswitch(lv_event_t * e);
|
||||
extern lv_obj_t * ui_modooscuoswitch;
|
||||
extern lv_obj_t * ui_pantallaname;
|
||||
extern void ui_event_pantalladrop(lv_event_t * e);
|
||||
extern lv_obj_t * ui_pantalladrop;
|
||||
extern lv_obj_t * ui_recepciondatosname;
|
||||
extern void ui_event_recepciondatosdrop(lv_event_t * e);
|
||||
extern lv_obj_t * ui_recepciondatosdrop;
|
||||
extern lv_obj_t * ui_settingsrpm;
|
||||
extern lv_obj_t * ui_rpmfinalname;
|
||||
extern lv_obj_t * ui_rpmfinalvalue;
|
||||
extern void ui_event_lessrpm(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessrpm;
|
||||
extern lv_obj_t * ui_lessrpmname;
|
||||
extern void ui_event_morerpm(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morerpm;
|
||||
extern lv_obj_t * ui_morerpmname;
|
||||
extern lv_obj_t * ui_desplazamientoname;
|
||||
extern lv_obj_t * ui_desplazamientovalue;
|
||||
extern void ui_event_lessdesp(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessdesp;
|
||||
extern lv_obj_t * ui_lessdespname;
|
||||
extern void ui_event_moredesp(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moredesp;
|
||||
extern lv_obj_t * ui_moredespname;
|
||||
extern lv_obj_t * ui_rpmdisplayname;
|
||||
extern void ui_event_rpmdisplaydrop(lv_event_t * e);
|
||||
extern lv_obj_t * ui_rpmdisplaydrop;
|
||||
extern lv_obj_t * ui_diffrpmname;
|
||||
extern lv_obj_t * ui_diffrpmvalue;
|
||||
extern void ui_event_lessdiffrpm(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessdiffrpm;
|
||||
extern lv_obj_t * ui_lessdiffrpmname;
|
||||
extern void ui_event_morediffrpm(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morediffrpm;
|
||||
extern lv_obj_t * ui_morediffrpmname;
|
||||
extern lv_obj_t * ui_settingsvbatt;
|
||||
extern lv_obj_t * ui_vbatttoohigh;
|
||||
extern lv_obj_t * ui_vbatttoohighvalue;
|
||||
extern void ui_event_lessvbatttoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessvbatttoohigh;
|
||||
extern lv_obj_t * ui_lessvbatttoohighname;
|
||||
extern void ui_event_morevbatttoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morevbatttoohigh;
|
||||
extern lv_obj_t * ui_morevbatttoohighname;
|
||||
extern lv_obj_t * ui_vbatthighname;
|
||||
extern lv_obj_t * ui_vbatthighvalue;
|
||||
extern void ui_event_lessvbatthigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessvbatthigh;
|
||||
extern lv_obj_t * ui_lessvbatthighname;
|
||||
extern void ui_event_morevbatthigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morevbatthigh;
|
||||
extern lv_obj_t * ui_morevbatthighname;
|
||||
extern lv_obj_t * ui_vbattlowname;
|
||||
extern lv_obj_t * ui_vbattlowvalue;
|
||||
extern void ui_event_lessvbattlow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessvbattlow;
|
||||
extern lv_obj_t * ui_lessvbattlowname;
|
||||
extern void ui_event_morevbattlow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morevbattlow;
|
||||
extern lv_obj_t * ui_morevbattlowname;
|
||||
extern lv_obj_t * ui_settingswatert;
|
||||
extern lv_obj_t * ui_waterhotname;
|
||||
extern lv_obj_t * ui_waterhotvalue;
|
||||
extern void ui_event_lessrwaterhot(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessrwaterhot;
|
||||
extern lv_obj_t * ui_lessrwaterhotname;
|
||||
extern void ui_event_morerwaterhot(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morerwaterhot;
|
||||
extern lv_obj_t * ui_morerwaterhotname;
|
||||
extern lv_obj_t * ui_watermidname;
|
||||
extern lv_obj_t * ui_watermidvalue;
|
||||
extern void ui_event_lesswatermid(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lesswatermid;
|
||||
extern lv_obj_t * ui_lesswatermidname;
|
||||
extern void ui_event_morewatermid(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morewatermid;
|
||||
extern lv_obj_t * ui_morewatermid1;
|
||||
extern lv_obj_t * ui_watercoldname;
|
||||
extern lv_obj_t * ui_watercoldvalue;
|
||||
extern void ui_event_lesswatercold(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lesswatercold;
|
||||
extern lv_obj_t * ui_lesswatercoldname;
|
||||
extern void ui_event_morewatercold(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morewatercold;
|
||||
extern lv_obj_t * ui_morewatercoldname;
|
||||
extern lv_obj_t * ui_settingsoilt;
|
||||
extern lv_obj_t * ui_oilhotname;
|
||||
extern lv_obj_t * ui_oilhotvalue;
|
||||
extern void ui_event_lessoilhot(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilhot;
|
||||
extern lv_obj_t * ui_lessoilhotname;
|
||||
extern void ui_event_moreoilhot(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilhot;
|
||||
extern lv_obj_t * ui_moreoilhotname;
|
||||
extern lv_obj_t * ui_oilmildname;
|
||||
extern lv_obj_t * ui_oilmildvalue;
|
||||
extern void ui_event_lessoilmild(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilmild;
|
||||
extern lv_obj_t * ui_lessoilmildname;
|
||||
extern void ui_event_moreoilmild(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilmild;
|
||||
extern lv_obj_t * ui_moreoilmildname;
|
||||
extern lv_obj_t * ui_oilcoldname;
|
||||
extern lv_obj_t * ui_oilcoldvalue;
|
||||
extern void ui_event_lessoilcold(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilcold;
|
||||
extern lv_obj_t * ui_lessoilcoldname;
|
||||
extern void ui_event_moreoilcold(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilcold;
|
||||
extern lv_obj_t * ui_moreoilcoldname;
|
||||
extern lv_obj_t * ui_settingsoilp;
|
||||
extern lv_obj_t * ui_oilptoohighname;
|
||||
extern lv_obj_t * ui_oilptoohighvalue;
|
||||
extern void ui_event_lessoilptoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilptoohigh;
|
||||
extern lv_obj_t * ui_lessoilptoohighname;
|
||||
extern void ui_event_moreoilptoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilptoohigh;
|
||||
extern lv_obj_t * ui_moreoilptoohighname;
|
||||
extern lv_obj_t * ui_oilphighname;
|
||||
extern lv_obj_t * ui_oilphighvalue;
|
||||
extern void ui_event_lessoilphigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilphigh;
|
||||
extern lv_obj_t * ui_lessoilphighname;
|
||||
extern void ui_event_moreoilphigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilphigh;
|
||||
extern lv_obj_t * ui_moreoilphighname;
|
||||
extern lv_obj_t * ui_oilplowname;
|
||||
extern lv_obj_t * ui_oilplowvalue;
|
||||
extern void ui_event_lessoilplow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessoilplow;
|
||||
extern lv_obj_t * ui_lessoilplowname;
|
||||
extern void ui_event_moreoilplow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_moreoilplow;
|
||||
extern lv_obj_t * ui_moreoilploname;
|
||||
extern lv_obj_t * ui_settingsfuelp;
|
||||
extern lv_obj_t * ui_fuelptoohighname;
|
||||
extern lv_obj_t * ui_fuelptoohighvalue;
|
||||
extern void ui_event_lessfuelptoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessfuelptoohigh;
|
||||
extern lv_obj_t * ui_lessfuelptoohighname;
|
||||
extern void ui_event_morefuelptoohigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morefuelptoohigh;
|
||||
extern lv_obj_t * ui_morefuelptoohighname;
|
||||
extern lv_obj_t * ui_fuelphighname;
|
||||
extern lv_obj_t * ui_fuelphighvalue;
|
||||
extern void ui_event_lessfuelphigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessfuelphigh;
|
||||
extern lv_obj_t * ui_lessfuelphighname;
|
||||
extern void ui_event_morefuelphigh(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morefuelphigh;
|
||||
extern lv_obj_t * ui_morefuelphighname;
|
||||
extern lv_obj_t * ui_fuelplowname;
|
||||
extern lv_obj_t * ui_fuelplowvalue;
|
||||
extern void ui_event_lessfuelplow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_lessfuelplow;
|
||||
extern lv_obj_t * ui_lessfuelplowname;
|
||||
extern void ui_event_morefuelplow(lv_event_t * e);
|
||||
extern lv_obj_t * ui_morefuelplow;
|
||||
extern lv_obj_t * ui_morefuelplowname;
|
||||
// CUSTOM VARIABLES
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
75
Pantalla/include/ui/ui_theme_manager.h
Normal file
75
Pantalla/include/ui/ui_theme_manager.h
Normal file
|
|
@ -0,0 +1,75 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.4.3+
|
||||
|
||||
#ifndef _UI_THEME_MANAGER_H
|
||||
#define _UI_THEME_MANAGER_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define UI_THEME_ACTIVE 1
|
||||
|
||||
/*#ifndef LV_SQUARELINE_THEME__IMPLICIT_GARBAGE_COLLECTOR
|
||||
#ifndef LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD //for slow hardware, tells how frequently the style-properties inside this style should be garbage-collected (recommended value: 10..100, 0:never)
|
||||
#define LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD 100 //a sensible default value that already gives good results on slow hardware, can be overridden from outside
|
||||
#endif
|
||||
#endif*/
|
||||
|
||||
|
||||
enum { UI_VARIABLE_STYLES_MODE_INIT = 1, UI_VARIABLE_STYLES_MODE_FOLLOW = 0 };
|
||||
|
||||
|
||||
typedef int64_t ui_style_variable_t;
|
||||
typedef ui_style_variable_t ui_theme_variable_t; //A 'theme' variable array is an array of 'style' variables for corresponding themes.
|
||||
|
||||
typedef struct {
|
||||
lv_obj_t * object_p;
|
||||
lv_style_selector_t selector;
|
||||
lv_style_prop_t property;
|
||||
/*#ifdef LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE //for slow hardware, adding this and setting to 5..10 in lv_conf.h might make it faster (less lv_obj_is_valid calls)
|
||||
uint16_t validcheck_counter; //used for garbage collection (finding empty slots) not to call lv_obj_is_valid() every time
|
||||
#endif*/
|
||||
void * next_p;
|
||||
} _ui_local_style_property_setting_t;
|
||||
|
||||
typedef struct {
|
||||
bool is_themeable; //scalar or vector?
|
||||
ui_style_variable_t * style_variable_p;
|
||||
ui_style_variable_t * previous_pointer;
|
||||
ui_style_variable_t previous_value;
|
||||
uint32_t style_property_setting_count;
|
||||
_ui_local_style_property_setting_t * style_property_settings;
|
||||
/*#ifdef LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD
|
||||
uint16_t garbage_collector_couter;
|
||||
#endif*/
|
||||
} _ui_local_style_t;
|
||||
|
||||
|
||||
extern _ui_local_style_t * _ui_local_styles;
|
||||
extern uint32_t _ui_local_style_count;
|
||||
|
||||
|
||||
void ui_object_set_local_style_property
|
||||
(lv_obj_t* object_p, lv_style_selector_t selector, lv_style_prop_t property, ui_style_variable_t value );
|
||||
|
||||
void ui_object_set_themeable_style_property
|
||||
(lv_obj_t* object_p, lv_style_selector_t selector, lv_style_prop_t property, const ui_theme_variable_t* theme_variable_p);
|
||||
|
||||
void _ui_theme_set_variable_styles (uint8_t mode);
|
||||
|
||||
lv_style_value_t _ui_style_value_convert (lv_style_prop_t property, ui_style_variable_t value);
|
||||
ui_style_variable_t ui_get_theme_value (const ui_theme_variable_t *var);
|
||||
|
||||
_ui_local_style_t * _ui_local_style_create (const ui_style_variable_t * style_variable_p, bool is_themeable);
|
||||
|
||||
_ui_local_style_property_setting_t * _ui_local_style_property_setting_create
|
||||
(_ui_local_style_t * local_style, lv_obj_t * object_p, lv_style_selector_t selector, lv_style_prop_t property);
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
46
Pantalla/include/ui/ui_themes.h
Normal file
46
Pantalla/include/ui/ui_themes.h
Normal file
|
|
@ -0,0 +1,46 @@
|
|||
// This file was generated by SquareLine Studio
|
||||
// SquareLine Studio version: SquareLine Studio 1.6.0
|
||||
// LVGL version: 8.3.11
|
||||
// Project name: G26_v3
|
||||
|
||||
#ifndef _UI_THEMES_H
|
||||
#define _UI_THEMES_H
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define UI_THEME_COLOR_FONDO 0
|
||||
#define UI_THEME_COLOR_TEXTO 1
|
||||
#define UI_THEME_COLOR_FBARRA 2
|
||||
#define UI_THEME_COLOR_BARRAR 3
|
||||
|
||||
#define UI_THEME_DEFAULT 0
|
||||
|
||||
#define UI_THEME_OSCURO 1
|
||||
|
||||
#define UI_THEME_CLARO 2
|
||||
|
||||
extern const ui_theme_variable_t _ui_theme_color_fondo[3];
|
||||
extern const ui_theme_variable_t _ui_theme_alpha_fondo[3];
|
||||
|
||||
extern const ui_theme_variable_t _ui_theme_color_texto[3];
|
||||
extern const ui_theme_variable_t _ui_theme_alpha_texto[3];
|
||||
|
||||
extern const ui_theme_variable_t _ui_theme_color_fbarra[3];
|
||||
extern const ui_theme_variable_t _ui_theme_alpha_fbarra[3];
|
||||
|
||||
extern const ui_theme_variable_t _ui_theme_color_barrar[3];
|
||||
extern const ui_theme_variable_t _ui_theme_alpha_barrar[3];
|
||||
|
||||
extern const uint32_t * ui_theme_colors[3];
|
||||
extern const uint8_t * ui_theme_alphas[3];
|
||||
extern uint8_t ui_theme_idx;
|
||||
|
||||
void ui_theme_set(uint8_t theme_idx);
|
||||
|
||||
#ifdef __cplusplus
|
||||
} /*extern "C"*/
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue