Todo subido

This commit is contained in:
Álvaro Alcántara Ramírez 2026-08-03 21:52:05 +02:00
parent f0db3a8aeb
commit 27026caf57
87 changed files with 83292 additions and 17 deletions

107
Pantalla/G26_v3.ino Normal file
View file

@ -0,0 +1,107 @@
#include "include/data_processor.hpp"
#include "include/can.hpp"
#include "include/g24_wheel_buttons.hpp"
#include "include/led_strip.hpp"
#include "include/crowpanel_controller.hpp"
#include "include/ajustes.hpp"
#include "include/guardado.hpp"
#include "lv_conf.h"
#include <LittleFS.h>
#include <freertos/FreeRTOS.h>
#include <freertos/task.h>
DataProcessor dataProcessor;
CAN canController;
G24WheelButtons wheelButtons;
LedStrip ledStrip;
CrowPanelController crowPanelController;
data datos;
void setup() {
Serial.begin(115200);
Serial.println("Starting setup...");
canController.set_data_proccessor(&dataProcessor);
canController.start();
set_data(&datos);
if(!LittleFS.begin(false)){
Serial.println("LittleFS corrupto o sin formato. Formateando...");
if(LittleFS.format()){
Serial.println("LittleFS formateado correctamente");
if(!LittleFS.begin(false)){
Serial.println("Error montando LittleFS despues de formatear");
} else {
Serial.println("LittleFS iniciado correctamente");
load();
}
} else {
Serial.println("Error formateando LittleFS");
}
} else {
Serial.println("LittleFS iniciado correctamente");
load();
}
crowPanelController.begin();
dataProcessor.set_led_strip(&ledStrip);
dataProcessor.set_crow_panel_controller(&crowPanelController);
//wheelButtons.set_can(&canController);
//wheelButtons.begin();
//ledStrip.begin();
// wheelButtons.set_led_strip(&ledStrip);
// wheelButtons.set_can_controller(&canController);
// wheelButtons.set_data_processor(&dataProcessor);
// ledStrip.set_mutex(canController.get_mutex());
//wheelButtons.ejecucion();
// wheelButtons.begin();
// xTaskCreate(wheelButtons.updateTask, "updateTask", 4096, &wheelButtons, 1, NULL);
// Initialize with screen 1
if(get_modo_oscuro()==true){
ui_theme_set(1);
} else {
ui_theme_set(2);
}
DataProcessor::set_dataprocessor();
CrowPanelController::create_rpm_bar((get_rpm()/1000)*1000, get_desplazamiento());
lv_obj_add_flag(ui_barcontainer, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_tiraledsrpmcontainer, LV_OBJ_FLAG_HIDDEN);
if(get_rpm_display()==0){
lv_obj_clear_flag(ui_barcontainer, LV_OBJ_FLAG_HIDDEN);
} else {
lv_obj_clear_flag(ui_tiraledsrpmcontainer, LV_OBJ_FLAG_HIDDEN);
}
int recepcion_datos=get_recepcion_datos();
lv_dropdown_set_selected(ui_recepciondatosdrop, recepcion_datos);
if(recepcion_datos==1){
canController.start_iracing_task();
} else {
canController.clear_rx_queue();
canController.start_listening_task();
}
}
void loop(){
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_timer_handler();
xSemaphoreGiveRecursive(lvgl_mutex);
vTaskDelay(5);
}

231
Pantalla/PCA9557.cpp Normal file
View file

@ -0,0 +1,231 @@
/*==============================================================================================================*
@file PCA9557.cpp
@author Patryk Wagner
@license MIT (c) 2016 Nadav Matalon
PCA9557 Driver (8-Channel GPIO I2C Expander) based on Madav Matalon PCA9536 driver
Ver. 1.0.0 - First release (24.10.16)
*===============================================================================================================*
LICENSE
*===============================================================================================================*
The MIT License (MIT)
Copyright (c) 2016 Nadav Matalon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*==============================================================================================================*/
#include "PCA9557.h"
/*==============================================================================================================*
CONSTRUCTOR
*==============================================================================================================*/
PCA9557::PCA9557() {
// _comBuffer = ping();
}
/*==============================================================================================================*
DESTRUCTOR
*==============================================================================================================*/
PCA9557::~PCA9557() {}
/*==============================================================================================================*
PING (0 = SUCCESS / 1, 2... = ERROR CODE)
*==============================================================================================================*/
// For meaning of I2C Error Codes see README
byte PCA9557::ping() {
Wire.beginTransmission(DEV_ADDR);
return Wire.endTransmission();
}
/*==============================================================================================================*
GET MODE (0 = OUTPUT / 1 = INPUT)
*==============================================================================================================*/
byte PCA9557::getMode(pin_t pin) {
return getPin(pin, REG_CONFIG);
}
/*==============================================================================================================*
GET STATE (0 = LOW / 1 = HIGH)
*==============================================================================================================*/
/*
byte PCA9557::getState(pin_t pin) {
return getPin(pin, getMode(pin) ? IO_LOW : IO_HIGH);
}*/
/*==============================================================================================================*
GET POLARITY: INPUT PINS ONLY (0 = NON-INVERTED / 1 = INVERTED)
*==============================================================================================================*/
byte PCA9557::getPolarity(pin_t pin) {
return getPin(pin, REG_POLARITY);
}
/*==============================================================================================================*
SET MODE
*==============================================================================================================*/
void PCA9557::setMode(pin_t pin, mode_tt newMode) { // PARAMS: IO0 / IO1 / IO2 / IO3
setPin(pin, REG_CONFIG, newMode); // IO_INPUT / IO_OUTPUT
}
/*==============================================================================================================*
SET MODE : ALL PINS
*==============================================================================================================*/
void PCA9557::setMode(mode_tt newMode) { // PARAMS: IO_INPUT / IO_OUTPUT
setReg(REG_CONFIG, newMode ? ALL_INPUT : ALL_OUTPUT);
}
/*==============================================================================================================*
SET STATE (OUTPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::setState(pin_t pin, state_t newState) { // PARAMS: IO0 / IO1 / IO2 / IO3
setPin(pin, REG_OUTPUT, newState); // IO_LOW / IO_HIGH
}
/*==============================================================================================================*
SET STATE : ALL PINS (OUTPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::setState(state_t newState) { // PARAMS: IO_LOW / IO_HIGH
setReg(REG_OUTPUT, newState ? ALL_HIGH : ALL_LOW);
}
/*==============================================================================================================*
TOGGLE STATE (OUTPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::toggleState(pin_t pin) {
setReg(REG_OUTPUT, getReg(REG_OUTPUT) ^ (1 << pin));
}
/*==============================================================================================================*
TOGGLE STATE : ALL PINS (OUTPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::toggleState() {
setReg(REG_OUTPUT, ~getReg(REG_OUTPUT));
}
/*==============================================================================================================*
SET POLARITY (INPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::setPolarity(pin_t pin, polarity_t newPolarity) { // PARAMS: IO0 / IO1 / IO2 / IO3
setPin(pin, REG_POLARITY, newPolarity); // IO_NON_INVERTED / IO_INVERTED
}
/*==============================================================================================================*
SET POLARITY : ALL PINS (INPUT PINS ONLY)
*==============================================================================================================*/
void PCA9557::setPolarity(polarity_t newPolarity) { // PARAMS: IO_NON_INVERTED / IO_INVERTED
byte polarityVals, polarityMask, polarityNew;
polarityVals = getReg(REG_POLARITY);
polarityMask = getReg(REG_CONFIG);
polarityNew = newPolarity ? ALL_INVERTED : ALL_NON_INVERTED;
setReg(REG_POLARITY, (polarityVals & ~polarityMask) | (polarityNew & polarityMask));
}
/*==============================================================================================================*
RESET
*==============================================================================================================*/
void PCA9557::reset() {
setMode(IO_INPUT);
setState(IO_HIGH);
setPolarity(IO_NON_INVERTED);
initCall(REG_INPUT);
endCall();
}
/*==============================================================================================================*
GET REGISTER DATA
*==============================================================================================================*/
byte PCA9557::getReg(reg_ptr_t regPtr) {
byte regData = 0;
initCall(regPtr);
endCall();
if (_comBuffer == COM_SUCCESS) {
Wire.requestFrom(DEV_ADDR, NUM_BYTES);
if (Wire.available() == NUM_BYTES) regData = Wire.read();
else {
while (Wire.available()) Wire.read();
_comBuffer = ping();
}
}
return regData;
}
/*==============================================================================================================*
GET PIN DATA
*==============================================================================================================*/
byte PCA9557::getPin(pin_t pin, reg_ptr_t regPtr) {
return bitRead(getReg(regPtr), pin);
}
/*==============================================================================================================*
SET REGISTER DATA
*==============================================================================================================*/
void PCA9557::setReg(reg_ptr_t regPtr, byte newSetting) {
if (regPtr > 0) {
initCall(regPtr);
Wire.write(newSetting);
endCall();
}
}
/*==============================================================================================================*
SET PIN DATA
*==============================================================================================================*/
void PCA9557::setPin(pin_t pin, reg_ptr_t regPtr, byte newSetting) {
byte newReg = getReg(regPtr);
bitWrite(newReg, pin, newSetting);
setReg(regPtr, newReg);
}
/*==============================================================================================================*
INITIATE I2C COMMUNICATION
*==============================================================================================================*/
void PCA9557::initCall(reg_ptr_t regPtr) {
Wire.beginTransmission(DEV_ADDR);
Wire.write(regPtr);
}
/*==============================================================================================================*
END I2C COMMUNICATION
*==============================================================================================================*/
void PCA9557::endCall() {
_comBuffer = Wire.endTransmission();
}
/*==============================================================================================================*
GET COMMUNICATION RESULT
*==============================================================================================================*/
byte PCA9557::getComResult() {
return _comBuffer;
}

193
Pantalla/PCA9557.h Normal file
View file

@ -0,0 +1,193 @@
/*==============================================================================================================*
@file PCA9557.h
@author Patryk Wagner
@license MIT (c) 2016 Nadav Matalon
PCA9557 Driver (8-Channel GPIO I2C Expander) based on Madav Matalon PCA9536 driver
Ver. 1.0.0 - First release (16.05.18)
*===============================================================================================================*
INTRODUCTION
*===============================================================================================================*
The PCA9557 is a 8-Channel GPIO Expander with a hardware I2C interface.
The PCA9557's 8 channels (or IO pins) can be controlled as a single unit or individually in terms of their
Mode (INPUT /OUTPUT) and Polarity (NON-INVERTED INPUT / INVERTED INPUT). The pins' states (LOW / HIGH) can
be read (in INPUT mode) or written (in OUTPUT mode).
This library contains a complete driver for the PCA9557 exposing all the above functionality.
*===============================================================================================================*
I2C ADDRESS
*===============================================================================================================*
The PCA9557 has a single I2C address (factory hardwired):
PART DEVICE I2C ADDRESS PART
NUMBER (BIN) (HEX) (DEC) MARKING
PCA9557D 01000001 0x41 65 PCA9557
*===============================================================================================================*
REGISTER POINTERS
*===============================================================================================================*
REG_INPUT 0x00 // Input Port Register (R) B00000000 (Default)
REG_OUTPUT 0x01 // Output Port Register (R/W) B00000001
REG_POLARITY 0x02 // Polarity Inversion Register (R/W) B00000010
REG_CONFIG 0x03 // Configuration Register (R/W) B00000011
*===============================================================================================================*
REGISTER 0: INPUT REGIASTER - READ ONLY (0 = LOW / 1 = HIGH)
*===============================================================================================================*
DEFAULT (WITH NO EXTENRAL INPUT SIGNAL CONNECTED): 'HIGH' (ALL IO PINS HAVE WEAK PULL-UP RESISTORS)
DEFAULT
PIN_IO0 BIT 0 1
PIN_IO1 BIT 1 1
PIN_IO2 BIT 2 1
PIN_IO3 BIT 3 1
PIN_IO4 BIT 4 1
PIN_IO5 BIT 5 1
PIN_IO6 BIT 6 1
PIN_IO7 BIT 7 1
*===============================================================================================================*
REGISTER 1: OUTPUT REGIASTER - READ / WRITE (0 = LOW / 1 = HIGH)
*===============================================================================================================*
DEFAULT
IO0 BIT 0 1
IO1 BIT 1 1
IO2 BIT 2 1
IO3 BIT 3 1
IO4 BIT 4 1
IO5 BIT 5 1
IO6 BIT 6 1
IO7 BIT 7 1
*===============================================================================================================*
REGISTER 2: POLARITY REGIASTER - READ / WRITE (0 = NON-INVERTED / 1 = INVERTED)
*===============================================================================================================*
DEFAULT
PIN_IO0 BIT 0 0
PIN_IO1 BIT 1 0
PIN_IO2 BIT 2 0
PIN_IO3 BIT 3 0
PIN_IO4 BIT 4 0
PIN_IO5 BIT 5 0
PIN_IO6 BIT 6 0
PIN_IO7 BIT 7 0
*===============================================================================================================*
REGISTER 3: CONFIGURATION - READ / WRITE (0 = OUTPUT / 1 = INPUT)
*===============================================================================================================*
POWER-UP DEFAULT: ALL PINS ARE SET AS 'INPUT' (1)
DEFAULT
PIN_IO0 BIT 0 1
PIN_IO1 BIT 1 1
PIN_IO2 BIT 2 1
PIN_IO3 BIT 3 1
PIN_IO4 BIT 4 1
PIN_IO5 BIT 5 1
PIN_IO6 BIT 6 1
PIN_IO7 BIT 7 1
*===============================================================================================================*
LICENSE
*===============================================================================================================*
The MIT License (MIT)
Copyright (c) 2016 Nadav Matalon
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated
documentation files (the "Software"), to deal in the Software without restriction, including without
limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
the Software, and to permit persons to whom the Software is furnished to do so, subject to the following
conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial
portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*==============================================================================================================*/
#include <Arduino.h>
#include <Wire.h>
const byte DEV_ADDR = 0x18;//0b0011010R/W
const byte NUM_BYTES = 0x01;
const byte ALL_INPUT = 0xFF;
const byte ALL_OUTPUT = 0x00;
const byte ALL_LOW = 0x00;
const byte ALL_NON_INVERTED = 0x00;
const byte ALL_HIGH = 0xFF;
const byte ALL_INVERTED = 0xFF;
const byte COM_SUCCESS = 0x00;
typedef enum:
byte
{
REG_INPUT = 0, // default
REG_OUTPUT = 1,
REG_POLARITY = 2,
REG_CONFIG = 3
} reg_ptr_t;
typedef enum:
byte
{
IO0 = 0,
IO1 = 1,
IO2 = 2,
IO3 = 3,
IO4 = 4,
IO5 = 5,
IO6 = 6,
IO7 = 7
} pin_t;
typedef enum:
byte
{
IO_OUTPUT = 0,
IO_INPUT = 1
} mode_tt;
typedef enum:
byte
{
IO_LOW = 0,
IO_HIGH = 1
} state_t;
typedef enum:
byte
{
IO_NON_INVERTED = 0,
IO_INVERTED = 1
} polarity_t;
class PCA9557
{
public:
PCA9557();
~PCA9557();
byte ping();
byte getMode(pin_t pin);
byte getState(pin_t pin);
byte getPolarity(pin_t pin);
void setMode(pin_t pin, mode_tt newMode);
void setMode(mode_tt newMode);
void setState(pin_t pin, state_t newState);
void setState(state_t newState);
void toggleState(pin_t pin);
void toggleState();
void setPolarity(pin_t pin, polarity_t newPolarity);
void setPolarity(polarity_t newPolarity);
void reset();
byte getComResult();
private:
byte _comBuffer;
byte getReg(reg_ptr_t regPtr);
byte getPin(pin_t pin, reg_ptr_t regPtr);
void setReg(reg_ptr_t ptr, byte newSetting);
void setPin(pin_t pin, reg_ptr_t regPtr, byte newSetting);
void initCall(reg_ptr_t regPtr);
void endCall();
};

View 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
View 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

View 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

View 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

View 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

View file

@ -0,0 +1,9 @@
#ifndef TELEMETRY_STATUS_HPP
#define TELEMETRY_STATUS_HPP
enum class TelemetryStatus {
CONNECTED,
};
#endif

View 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

View 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

View 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

View 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

View 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

View 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
View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

View 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

784
Pantalla/lv_conf.h Normal file
View file

@ -0,0 +1,784 @@
/**
* @file lv_conf.h
* Configuration file for v8.4.0
*/
/*
* Copy this file as `lv_conf.h`
* 1. simply next to the `lvgl` folder
* 2. or any other places and
* - define `LV_CONF_INCLUDE_SIMPLE`
* - add the path as include path
*/
/* clang-format off */
#if 1 /*Set it to "1" to enable content*/
#ifndef LV_CONF_H
#define LV_CONF_H
#include <stdint.h>
/*====================
COLOR SETTINGS
*====================*/
/*Color depth: 1 (1 byte per pixel), 8 (RGB332), 16 (RGB565), 32 (ARGB8888)*/
#define LV_COLOR_DEPTH 16
/*Swap the 2 bytes of RGB565 color. Useful if the display has an 8-bit interface (e.g. SPI)*/
#define LV_COLOR_16_SWAP 0
/*Enable features to draw on transparent background.
*It's required if opa, and transform_* style properties are used.
*Can be also used if the UI is above another layer, e.g. an OSD menu or video player.*/
#define LV_COLOR_SCREEN_TRANSP 0
/* Adjust color mix functions rounding. GPUs might calculate color mix (blending) differently.
* 0: round down, 64: round up from x.75, 128: round up from half, 192: round up from x.25, 254: round up */
#define LV_COLOR_MIX_ROUND_OFS 0
/*Images pixels with this color will not be drawn if they are chroma keyed)*/
#define LV_COLOR_CHROMA_KEY lv_color_hex(0x00ff00) /*pure green*/
/*=========================
MEMORY SETTINGS
*=========================*/
/*1: use custom malloc/free, 0: use the built-in `lv_mem_alloc()` and `lv_mem_free()`*/
#define LV_MEM_CUSTOM 0
#if LV_MEM_CUSTOM == 0
/*Size of the memory available for `lv_mem_alloc()` in bytes (>= 2kB)*/
#define LV_MEM_SIZE (160U * 1024U) /*[bytes]*/
/*Set an address for the memory pool instead of allocating it as a normal array. Can be in external SRAM too.*/
#define LV_MEM_ADR 0 /*0: unused*/
/*Instead of an address give a memory allocator that will be called to get a memory pool for LVGL. E.g. my_malloc*/
#if LV_MEM_ADR == 0
#undef LV_MEM_POOL_INCLUDE
#undef LV_MEM_POOL_ALLOC
#endif
#else /*LV_MEM_CUSTOM*/
#define LV_MEM_CUSTOM_INCLUDE <stdlib.h> /*Header for the dynamic memory function*/
#define LV_MEM_CUSTOM_ALLOC malloc
#define LV_MEM_CUSTOM_FREE free
#define LV_MEM_CUSTOM_REALLOC realloc
#endif /*LV_MEM_CUSTOM*/
/*Number of the intermediate memory buffer used during rendering and other internal processing mechanisms.
*You will see an error log message if there wasn't enough buffers. */
#define LV_MEM_BUF_MAX_NUM 16
/*Use the standard `memcpy` and `memset` instead of LVGL's own functions. (Might or might not be faster).*/
#define LV_MEMCPY_MEMSET_STD 0
/*====================
HAL SETTINGS
*====================*/
/*Default display refresh period. LVG will redraw changed areas with this period time*/
#define LV_DISP_DEF_REFR_PERIOD 30 /*[ms]*/
/*Input device read period in milliseconds*/
#define LV_INDEV_DEF_READ_PERIOD 30 /*[ms]*/
/*Use a custom tick source that tells the elapsed time in milliseconds.
*It removes the need to manually update the tick with `lv_tick_inc()`)*/
#define LV_TICK_CUSTOM 1
#if LV_TICK_CUSTOM
#define LV_TICK_CUSTOM_INCLUDE "Arduino.h" /*Header for the system time function*/
#define LV_TICK_CUSTOM_SYS_TIME_EXPR (millis()) /*Expression evaluating to current system time in ms*/
/*If using lvgl as ESP32 component*/
// #define LV_TICK_CUSTOM_INCLUDE "esp_timer.h"
// #define LV_TICK_CUSTOM_SYS_TIME_EXPR ((esp_timer_get_time() / 1000LL))
#endif /*LV_TICK_CUSTOM*/
/*Default Dot Per Inch. Used to initialize default sizes such as widgets sized, style paddings.
*(Not so important, you can adjust it to modify default sizes and spaces)*/
#define LV_DPI_DEF 130 /*[px/inch]*/
/*=======================
* FEATURE CONFIGURATION
*=======================*/
/*-------------
* Drawing
*-----------*/
/*Enable complex draw engine.
*Required to draw shadow, gradient, rounded corners, circles, arc, skew lines, image transformations or any masks*/
#define LV_DRAW_COMPLEX 1
#if LV_DRAW_COMPLEX != 0
/*Allow buffering some shadow calculation.
*LV_SHADOW_CACHE_SIZE is the max. shadow size to buffer, where shadow size is `shadow_width + radius`
*Caching has LV_SHADOW_CACHE_SIZE^2 RAM cost*/
#define LV_SHADOW_CACHE_SIZE 0
/* Set number of maximally cached circle data.
* The circumference of 1/4 circle are saved for anti-aliasing
* radius * 4 bytes are used per circle (the most often used radiuses are saved)
* 0: to disable caching */
#define LV_CIRCLE_CACHE_SIZE 4
#endif /*LV_DRAW_COMPLEX*/
/**
* "Simple layers" are used when a widget has `style_opa < 255` to buffer the widget into a layer
* and blend it as an image with the given opacity.
* Note that `bg_opa`, `text_opa` etc don't require buffering into layer)
* The widget can be buffered in smaller chunks to avoid using large buffers.
*
* - LV_LAYER_SIMPLE_BUF_SIZE: [bytes] the optimal target buffer size. LVGL will try to allocate it
* - LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE: [bytes] used if `LV_LAYER_SIMPLE_BUF_SIZE` couldn't be allocated.
*
* Both buffer sizes are in bytes.
* "Transformed layers" (where transform_angle/zoom properties are used) use larger buffers
* and can't be drawn in chunks. So these settings affects only widgets with opacity.
*/
#define LV_LAYER_SIMPLE_BUF_SIZE (24 * 1024)
#define LV_LAYER_SIMPLE_FALLBACK_BUF_SIZE (3 * 1024)
/*Default image cache size. Image caching keeps the images opened.
*If only the built-in image formats are used there is no real advantage of caching. (I.e. if no new image decoder is added)
*With complex image decoders (e.g. PNG or JPG) caching can save the continuous open/decode of images.
*However the opened images might consume additional RAM.
*0: to disable caching*/
#define LV_IMG_CACHE_DEF_SIZE 0
/*Number of stops allowed per gradient. Increase this to allow more stops.
*This adds (sizeof(lv_color_t) + 1) bytes per additional stop*/
#define LV_GRADIENT_MAX_STOPS 2
/*Default gradient buffer size.
*When LVGL calculates the gradient "maps" it can save them into a cache to avoid calculating them again.
*LV_GRAD_CACHE_DEF_SIZE sets the size of this cache in bytes.
*If the cache is too small the map will be allocated only while it's required for the drawing.
*0 mean no caching.*/
#define LV_GRAD_CACHE_DEF_SIZE 0
/*Allow dithering the gradients (to achieve visual smooth color gradients on limited color depth display)
*LV_DITHER_GRADIENT implies allocating one or two more lines of the object's rendering surface
*The increase in memory consumption is (32 bits * object width) plus 24 bits * object width if using error diffusion */
#define LV_DITHER_GRADIENT 0
#if LV_DITHER_GRADIENT
/*Add support for error diffusion dithering.
*Error diffusion dithering gets a much better visual result, but implies more CPU consumption and memory when drawing.
*The increase in memory consumption is (24 bits * object's width)*/
#define LV_DITHER_ERROR_DIFFUSION 0
#endif
/*Maximum buffer size to allocate for rotation.
*Only used if software rotation is enabled in the display driver.*/
#define LV_DISP_ROT_MAX_BUF (10*1024)
/*-------------
* GPU
*-----------*/
/*Use Arm's 2D acceleration library Arm-2D */
#define LV_USE_GPU_ARM2D 0
/*Use STM32's DMA2D (aka Chrom Art) GPU*/
#define LV_USE_GPU_STM32_DMA2D 0
#if LV_USE_GPU_STM32_DMA2D
/*Must be defined to include path of CMSIS header of target processor
e.g. "stm32f7xx.h" or "stm32f4xx.h"*/
#define LV_GPU_DMA2D_CMSIS_INCLUDE
#endif
/*Enable RA6M3 G2D GPU*/
#define LV_USE_GPU_RA6M3_G2D 0
#if LV_USE_GPU_RA6M3_G2D
/*include path of target processor
e.g. "hal_data.h"*/
#define LV_GPU_RA6M3_G2D_INCLUDE "hal_data.h"
#endif
/*Use SWM341's DMA2D GPU*/
#define LV_USE_GPU_SWM341_DMA2D 0
#if LV_USE_GPU_SWM341_DMA2D
#define LV_GPU_SWM341_DMA2D_INCLUDE "SWM341.h"
#endif
/*Use NXP's PXP GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_PXP 0
#if LV_USE_GPU_NXP_PXP
/*1: Add default bare metal and FreeRTOS interrupt handling routines for PXP (lv_gpu_nxp_pxp_osa.c)
* and call lv_gpu_nxp_pxp_init() automatically during lv_init(). Note that symbol SDK_OS_FREE_RTOS
* has to be defined in order to use FreeRTOS OSA, otherwise bare-metal implementation is selected.
*0: lv_gpu_nxp_pxp_init() has to be called manually before lv_init()
*/
#define LV_USE_GPU_NXP_PXP_AUTO_INIT 0
#endif
/*Use NXP's VG-Lite GPU iMX RTxxx platforms*/
#define LV_USE_GPU_NXP_VG_LITE 0
/*Use SDL renderer API*/
#define LV_USE_GPU_SDL 0
#if LV_USE_GPU_SDL
#define LV_GPU_SDL_INCLUDE_PATH <SDL2/SDL.h>
/*Texture cache size, 8MB by default*/
#define LV_GPU_SDL_LRU_SIZE (1024 * 1024 * 8)
/*Custom blend mode for mask drawing, disable if you need to link with older SDL2 lib*/
#define LV_GPU_SDL_CUSTOM_BLEND_MODE (SDL_VERSION_ATLEAST(2, 0, 6))
#endif
/*-------------
* Logging
*-----------*/
/*Enable the log module*/
#define LV_USE_LOG 0
#if LV_USE_LOG
/*How important log should be added:
*LV_LOG_LEVEL_TRACE A lot of logs to give detailed information
*LV_LOG_LEVEL_INFO Log important events
*LV_LOG_LEVEL_WARN Log if something unwanted happened but didn't cause a problem
*LV_LOG_LEVEL_ERROR Only critical issue, when the system may fail
*LV_LOG_LEVEL_USER Only logs added by the user
*LV_LOG_LEVEL_NONE Do not log anything*/
#define LV_LOG_LEVEL LV_LOG_LEVEL_WARN
/*1: Print the log with 'printf';
*0: User need to register a callback with `lv_log_register_print_cb()`*/
#define LV_LOG_PRINTF 0
/*Enable/disable LV_LOG_TRACE in modules that produces a huge number of logs*/
#define LV_LOG_TRACE_MEM 1
#define LV_LOG_TRACE_TIMER 1
#define LV_LOG_TRACE_INDEV 1
#define LV_LOG_TRACE_DISP_REFR 1
#define LV_LOG_TRACE_EVENT 1
#define LV_LOG_TRACE_OBJ_CREATE 1
#define LV_LOG_TRACE_LAYOUT 1
#define LV_LOG_TRACE_ANIM 1
#endif /*LV_USE_LOG*/
/*-------------
* Asserts
*-----------*/
/*Enable asserts if an operation is failed or an invalid data is found.
*If LV_USE_LOG is enabled an error message will be printed on failure*/
#define LV_USE_ASSERT_NULL 1 /*Check if the parameter is NULL. (Very fast, recommended)*/
#define LV_USE_ASSERT_MALLOC 1 /*Checks is the memory is successfully allocated or no. (Very fast, recommended)*/
#define LV_USE_ASSERT_STYLE 0 /*Check if the styles are properly initialized. (Very fast, recommended)*/
#define LV_USE_ASSERT_MEM_INTEGRITY 0 /*Check the integrity of `lv_mem` after critical operations. (Slow)*/
#define LV_USE_ASSERT_OBJ 0 /*Check the object's type and existence (e.g. not deleted). (Slow)*/
/*Add a custom handler when assert happens e.g. to restart the MCU*/
#define LV_ASSERT_HANDLER_INCLUDE <stdint.h>
#define LV_ASSERT_HANDLER while(1); /*Halt by default*/
/*-------------
* Others
*-----------*/
/*1: Show CPU usage and FPS count*/
#define LV_USE_PERF_MONITOR 0
#if LV_USE_PERF_MONITOR
#define LV_USE_PERF_MONITOR_POS LV_ALIGN_BOTTOM_RIGHT
#endif
/*1: Show the used memory and the memory fragmentation
* Requires LV_MEM_CUSTOM = 0*/
#define LV_USE_MEM_MONITOR 0
#if LV_USE_MEM_MONITOR
#define LV_USE_MEM_MONITOR_POS LV_ALIGN_BOTTOM_LEFT
#endif
/*1: Draw random colored rectangles over the redrawn areas*/
#define LV_USE_REFR_DEBUG 0
/*Change the built in (v)snprintf functions*/
#define LV_SPRINTF_CUSTOM 0
#if LV_SPRINTF_CUSTOM
#define LV_SPRINTF_INCLUDE <stdio.h>
#define lv_snprintf snprintf
#define lv_vsnprintf vsnprintf
#else /*LV_SPRINTF_CUSTOM*/
#define LV_SPRINTF_USE_FLOAT 0
#endif /*LV_SPRINTF_CUSTOM*/
#define LV_USE_USER_DATA 1
/*Garbage Collector settings
*Used if lvgl is bound to higher level language and the memory is managed by that language*/
#define LV_ENABLE_GC 0
#if LV_ENABLE_GC != 0
#define LV_GC_INCLUDE "gc.h" /*Include Garbage Collector related things*/
#endif /*LV_ENABLE_GC*/
/*=====================
* COMPILER SETTINGS
*====================*/
/*For big endian systems set to 1*/
#define LV_BIG_ENDIAN_SYSTEM 0
/*Define a custom attribute to `lv_tick_inc` function*/
#define LV_ATTRIBUTE_TICK_INC
/*Define a custom attribute to `lv_timer_handler` function*/
#define LV_ATTRIBUTE_TIMER_HANDLER
/*Define a custom attribute to `lv_disp_flush_ready` function*/
#define LV_ATTRIBUTE_FLUSH_READY
/*Required alignment size for buffers*/
#define LV_ATTRIBUTE_MEM_ALIGN_SIZE 1
/*Will be added where memories needs to be aligned (with -Os data might not be aligned to boundary by default).
* E.g. __attribute__((aligned(4)))*/
#define LV_ATTRIBUTE_MEM_ALIGN
/*Attribute to mark large constant arrays for example font's bitmaps*/
#define LV_ATTRIBUTE_LARGE_CONST
/*Compiler prefix for a big array declaration in RAM*/
#define LV_ATTRIBUTE_LARGE_RAM_ARRAY
/*Place performance critical functions into a faster memory (e.g RAM)*/
#define LV_ATTRIBUTE_FAST_MEM
/*Prefix variables that are used in GPU accelerated operations, often these need to be placed in RAM sections that are DMA accessible*/
#define LV_ATTRIBUTE_DMA
/*Export integer constant to binding. This macro is used with constants in the form of LV_<CONST> that
*should also appear on LVGL binding API such as Micropython.*/
#define LV_EXPORT_CONST_INT(int_value) struct _silence_gcc_warning /*The default value just prevents GCC warning*/
/*Extend the default -32k..32k coordinate range to -4M..4M by using int32_t for coordinates instead of int16_t*/
#define LV_USE_LARGE_COORD 0
/*==================
* FONT USAGE
*===================*/
/*Montserrat fonts with ASCII range and some symbols using bpp = 4
*https://fonts.google.com/specimen/Montserrat*/
#define LV_FONT_MONTSERRAT_8 0
#define LV_FONT_MONTSERRAT_10 0
#define LV_FONT_MONTSERRAT_12 0
#define LV_FONT_MONTSERRAT_14 1
#define LV_FONT_MONTSERRAT_16 1
#define LV_FONT_MONTSERRAT_18 1
#define LV_FONT_MONTSERRAT_20 0
#define LV_FONT_MONTSERRAT_22 0
#define LV_FONT_MONTSERRAT_24 0
#define LV_FONT_MONTSERRAT_26 1
#define LV_FONT_MONTSERRAT_28 0
#define LV_FONT_MONTSERRAT_30 1
#define LV_FONT_MONTSERRAT_32 0
#define LV_FONT_MONTSERRAT_34 0
#define LV_FONT_MONTSERRAT_36 1
#define LV_FONT_MONTSERRAT_38 0
#define LV_FONT_MONTSERRAT_40 0
#define LV_FONT_MONTSERRAT_42 0
#define LV_FONT_MONTSERRAT_44 1
#define LV_FONT_MONTSERRAT_46 0
#define LV_FONT_MONTSERRAT_48 1
/*Demonstrate special features*/
#define LV_FONT_MONTSERRAT_12_SUBPX 0
#define LV_FONT_MONTSERRAT_28_COMPRESSED 0 /*bpp = 3*/
#define LV_FONT_DEJAVU_16_PERSIAN_HEBREW 0 /*Hebrew, Arabic, Persian letters and all their forms*/
#define LV_FONT_SIMSUN_16_CJK 0 /*1000 most common CJK radicals*/
/*Pixel perfect monospace fonts*/
#define LV_FONT_UNSCII_8 0
#define LV_FONT_UNSCII_16 0
/*Optionally declare custom fonts here.
*You can use these fonts as default font too and they will be available globally.
*E.g. #define LV_FONT_CUSTOM_DECLARE LV_FONT_DECLARE(my_font_1) LV_FONT_DECLARE(my_font_2)*/
#define LV_FONT_CUSTOM_DECLARE
/*Always set a default font*/
#define LV_FONT_DEFAULT &lv_font_montserrat_14
/*Enable handling large font and/or fonts with a lot of characters.
*The limit depends on the font size, font face and bpp.
*Compiler error will be triggered if a font needs it.*/
#define LV_FONT_FMT_TXT_LARGE 0
/*Enables/disables support for compressed fonts.*/
#define LV_USE_FONT_COMPRESSED 0
/*Enable subpixel rendering*/
#define LV_USE_FONT_SUBPX 0
#if LV_USE_FONT_SUBPX
/*Set the pixel order of the display. Physical order of RGB channels. Doesn't matter with "normal" fonts.*/
#define LV_FONT_SUBPX_BGR 0 /*0: RGB; 1:BGR order*/
#endif
/*Enable drawing placeholders when glyph dsc is not found*/
#define LV_USE_FONT_PLACEHOLDER 1
/*=================
* TEXT SETTINGS
*=================*/
/**
* Select a character encoding for strings.
* Your IDE or editor should have the same character encoding
* - LV_TXT_ENC_UTF8
* - LV_TXT_ENC_ASCII
*/
#define LV_TXT_ENC LV_TXT_ENC_UTF8
/*Can break (wrap) texts on these chars*/
#define LV_TXT_BREAK_CHARS " ,.;:-_"
/*If a word is at least this long, will break wherever "prettiest"
*To disable, set to a value <= 0*/
#define LV_TXT_LINE_BREAK_LONG_LEN 0
/*Minimum number of characters in a long word to put on a line before a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_PRE_MIN_LEN 3
/*Minimum number of characters in a long word to put on a line after a break.
*Depends on LV_TXT_LINE_BREAK_LONG_LEN.*/
#define LV_TXT_LINE_BREAK_LONG_POST_MIN_LEN 3
/*The control character to use for signalling text recoloring.*/
#define LV_TXT_COLOR_CMD "#"
/*Support bidirectional texts. Allows mixing Left-to-Right and Right-to-Left texts.
*The direction will be processed according to the Unicode Bidirectional Algorithm:
*https://www.w3.org/International/articles/inline-bidi-markup/uba-basics*/
#define LV_USE_BIDI 0
#if LV_USE_BIDI
/*Set the default direction. Supported values:
*`LV_BASE_DIR_LTR` Left-to-Right
*`LV_BASE_DIR_RTL` Right-to-Left
*`LV_BASE_DIR_AUTO` detect texts base direction*/
#define LV_BIDI_BASE_DIR_DEF LV_BASE_DIR_AUTO
#endif
/*Enable Arabic/Persian processing
*In these languages characters should be replaced with an other form based on their position in the text*/
#define LV_USE_ARABIC_PERSIAN_CHARS 0
/*==================
* WIDGET USAGE
*================*/
/*Documentation of the widgets: https://docs.lvgl.io/latest/en/html/widgets/index.html*/
#define LV_USE_ARC 1
#define LV_USE_BAR 1
#define LV_USE_BTN 1
#define LV_USE_BTNMATRIX 1
#define LV_USE_CANVAS 1
#define LV_USE_CHECKBOX 1
#define LV_USE_DROPDOWN 1 /*Requires: lv_label*/
#define LV_USE_IMG 1 /*Requires: lv_label*/
#define LV_USE_LABEL 1
#if LV_USE_LABEL
#define LV_LABEL_TEXT_SELECTION 1 /*Enable selecting text of the label*/
#define LV_LABEL_LONG_TXT_HINT 1 /*Store some extra info in labels to speed up drawing of very long texts*/
#endif
#define LV_USE_LINE 1
#define LV_USE_ROLLER 1 /*Requires: lv_label*/
#if LV_USE_ROLLER
#define LV_ROLLER_INF_PAGES 7 /*Number of extra "pages" when the roller is infinite*/
#endif
#define LV_USE_SLIDER 1 /*Requires: lv_bar*/
#define LV_USE_SWITCH 1
#define LV_USE_TEXTAREA 1 /*Requires: lv_label*/
#if LV_USE_TEXTAREA != 0
#define LV_TEXTAREA_DEF_PWD_SHOW_TIME 1500 /*ms*/
#endif
#define LV_USE_TABLE 1
/*==================
* EXTRA COMPONENTS
*==================*/
/*-----------
* Widgets
*----------*/
#define LV_USE_ANIMIMG 1
#define LV_USE_CALENDAR 1
#if LV_USE_CALENDAR
#define LV_CALENDAR_WEEK_STARTS_MONDAY 0
#if LV_CALENDAR_WEEK_STARTS_MONDAY
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Mo", "Tu", "We", "Th", "Fr", "Sa", "Su"}
#else
#define LV_CALENDAR_DEFAULT_DAY_NAMES {"Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"}
#endif
#define LV_CALENDAR_DEFAULT_MONTH_NAMES {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
#define LV_USE_CALENDAR_HEADER_ARROW 1
#define LV_USE_CALENDAR_HEADER_DROPDOWN 1
#endif /*LV_USE_CALENDAR*/
#define LV_USE_CHART 1
#define LV_USE_COLORWHEEL 1
#define LV_USE_IMGBTN 1
#define LV_USE_KEYBOARD 1
#define LV_USE_LED 1
#define LV_USE_LIST 1
#define LV_USE_MENU 1
#define LV_USE_METER 1
#define LV_USE_MSGBOX 1
#define LV_USE_SPAN 1
#if LV_USE_SPAN
/*A line text can contain maximum num of span descriptor */
#define LV_SPAN_SNIPPET_STACK_SIZE 64
#endif
#define LV_USE_SPINBOX 1
#define LV_USE_SPINNER 1
#define LV_USE_TABVIEW 1
#define LV_USE_TILEVIEW 1
#define LV_USE_WIN 1
/*-----------
* Themes
*----------*/
/*A simple, impressive and very complete theme*/
#define LV_USE_THEME_DEFAULT 1
#if LV_USE_THEME_DEFAULT
/*0: Light mode; 1: Dark mode*/
#define LV_THEME_DEFAULT_DARK 0
/*1: Enable grow on press*/
#define LV_THEME_DEFAULT_GROW 1
/*Default transition time in [ms]*/
#define LV_THEME_DEFAULT_TRANSITION_TIME 80
#endif /*LV_USE_THEME_DEFAULT*/
/*A very simple theme that is a good starting point for a custom theme*/
#define LV_USE_THEME_BASIC 1
/*A theme designed for monochrome displays*/
#define LV_USE_THEME_MONO 1
/*-----------
* Layouts
*----------*/
/*A layout similar to Flexbox in CSS.*/
#define LV_USE_FLEX 1
/*A layout similar to Grid in CSS.*/
#define LV_USE_GRID 1
/*---------------------
* 3rd party libraries
*--------------------*/
/*File system interfaces for common APIs */
/*API for fopen, fread, etc*/
#define LV_USE_FS_STDIO 0
#if LV_USE_FS_STDIO
#define LV_FS_STDIO_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_STDIO_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_STDIO_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for open, read, etc*/
#define LV_USE_FS_POSIX 0
#if LV_USE_FS_POSIX
#define LV_FS_POSIX_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_POSIX_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_POSIX_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for CreateFile, ReadFile, etc*/
#define LV_USE_FS_WIN32 0
#if LV_USE_FS_WIN32
#define LV_FS_WIN32_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_WIN32_PATH "" /*Set the working directory. File/directory paths will be appended to it.*/
#define LV_FS_WIN32_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for FATFS (needs to be added separately). Uses f_open, f_read, etc*/
#define LV_USE_FS_FATFS 0
#if LV_USE_FS_FATFS
#define LV_FS_FATFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_FATFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*API for LittleFS (library needs to be added separately). Uses lfs_file_open, lfs_file_read, etc*/
#define LV_USE_FS_LITTLEFS 0
#if LV_USE_FS_LITTLEFS
#define LV_FS_LITTLEFS_LETTER '\0' /*Set an upper cased letter on which the drive will accessible (e.g. 'A')*/
#define LV_FS_LITTLEFS_CACHE_SIZE 0 /*>0 to cache this number of bytes in lv_fs_read()*/
#endif
/*PNG decoder library*/
#define LV_USE_PNG 0
/*BMP decoder library*/
#define LV_USE_BMP 0
/* JPG + split JPG decoder library.
* Split JPG is a custom format optimized for embedded systems. */
#define LV_USE_SJPG 0
/*GIF decoder library*/
#define LV_USE_GIF 0
/*QR code library*/
#define LV_USE_QRCODE 0
/*FreeType library*/
#define LV_USE_FREETYPE 0
#if LV_USE_FREETYPE
/*Memory used by FreeType to cache characters [bytes] (-1: no caching)*/
#define LV_FREETYPE_CACHE_SIZE (16 * 1024)
#if LV_FREETYPE_CACHE_SIZE >= 0
/* 1: bitmap cache use the sbit cache, 0:bitmap cache use the image cache. */
/* sbit cache:it is much more memory efficient for small bitmaps(font size < 256) */
/* if font size >= 256, must be configured as image cache */
#define LV_FREETYPE_SBIT_CACHE 0
/* Maximum number of opened FT_Face/FT_Size objects managed by this cache instance. */
/* (0:use system defaults) */
#define LV_FREETYPE_CACHE_FT_FACES 0
#define LV_FREETYPE_CACHE_FT_SIZES 0
#endif
#endif
/*Tiny TTF library*/
#define LV_USE_TINY_TTF 0
#if LV_USE_TINY_TTF
/*Load TTF data from files*/
#define LV_TINY_TTF_FILE_SUPPORT 0
#endif
/*Rlottie library*/
#define LV_USE_RLOTTIE 0
/*FFmpeg library for image decoding and playing videos
*Supports all major image formats so do not enable other image decoder with it*/
#define LV_USE_FFMPEG 0
#if LV_USE_FFMPEG
/*Dump input information to stderr*/
#define LV_FFMPEG_DUMP_FORMAT 0
#endif
/*-----------
* Others
*----------*/
/*1: Enable API to take snapshot for object*/
#define LV_USE_SNAPSHOT 0
/*1: Enable Monkey test*/
#define LV_USE_MONKEY 0
/*1: Enable grid navigation*/
#define LV_USE_GRIDNAV 0
/*1: Enable lv_obj fragment*/
#define LV_USE_FRAGMENT 0
/*1: Support using images as font in label or span widgets */
#define LV_USE_IMGFONT 0
/*1: Enable a published subscriber based messaging system */
#define LV_USE_MSG 0
/*1: Enable Pinyin input method*/
/*Requires: lv_keyboard*/
#define LV_USE_IME_PINYIN 0
#if LV_USE_IME_PINYIN
/*1: Use default thesaurus*/
/*If you do not use the default thesaurus, be sure to use `lv_ime_pinyin` after setting the thesauruss*/
#define LV_IME_PINYIN_USE_DEFAULT_DICT 1
/*Set the maximum number of candidate panels that can be displayed*/
/*This needs to be adjusted according to the size of the screen*/
#define LV_IME_PINYIN_CAND_TEXT_NUM 6
/*Use 9 key input(k9)*/
#define LV_IME_PINYIN_USE_K9_MODE 1
#if LV_IME_PINYIN_USE_K9_MODE == 1
#define LV_IME_PINYIN_K9_CAND_TEXT_NUM 3
#endif // LV_IME_PINYIN_USE_K9_MODE
#endif
/*==================
* EXAMPLES
*==================*/
/*Enable the examples to be built with the library*/
#define LV_BUILD_EXAMPLES 1
/*===================
* DEMO USAGE
====================*/
/*Show some widget. It might be required to increase `LV_MEM_SIZE` */
#define LV_USE_DEMO_WIDGETS 0
#if LV_USE_DEMO_WIDGETS
#define LV_DEMO_WIDGETS_SLIDESHOW 0
#endif
/*Demonstrate the usage of encoder and keyboard*/
#define LV_USE_DEMO_KEYPAD_AND_ENCODER 0
/*Benchmark your system*/
#define LV_USE_DEMO_BENCHMARK 0
#if LV_USE_DEMO_BENCHMARK
/*Use RGB565A8 images with 16 bit color depth instead of ARGB8565*/
#define LV_DEMO_BENCHMARK_RGB565A8 0
#endif
/*Stress test for LVGL*/
#define LV_USE_DEMO_STRESS 0
/*Music player demo*/
#define LV_USE_DEMO_MUSIC 0
#if LV_USE_DEMO_MUSIC
#define LV_DEMO_MUSIC_SQUARE 0
#define LV_DEMO_MUSIC_LANDSCAPE 0
#define LV_DEMO_MUSIC_ROUND 0
#define LV_DEMO_MUSIC_LARGE 0
#define LV_DEMO_MUSIC_AUTO_PLAY 0
#endif
/*--END OF LV_CONF_H--*/
#endif /*LV_CONF_H*/
#endif /*End of "Content enable"*/

161
Pantalla/src/ajustes.cpp Normal file
View file

@ -0,0 +1,161 @@
#include "../include/ajustes.hpp"
data *puntero_datos;
void set_data(data *datos){
puntero_datos=datos;
}
int get_rpm(){
return puntero_datos->get_rpm();
}
int get_desplazamiento(){
return puntero_datos->get_desplazamiento();
}
bool get_modo_oscuro(){
return puntero_datos->get_modo_oscuro();
}
int get_pantalla(){
return puntero_datos->get_pantalla();
}
int get_rpm_display(){
return puntero_datos->get_rpm_display();
}
int get_diff_rpm(){
return puntero_datos->get_diff_rpm();
}
int get_recepcion_datos(){
return puntero_datos->get_recepcion_datos();
}
float get_vbatt_too_high(){
return puntero_datos->get_vbatt_too_high();
}
float get_vbatt_high(){
return puntero_datos->get_vbatt_high();
}
float get_vbatt_low(){
return puntero_datos->get_vbatt_low();
}
int get_water_hot(){
return puntero_datos->get_water_hot();
}
int get_water_mild(){
return puntero_datos->get_water_mild();
}
int get_water_cold(){
return puntero_datos->get_water_cold();
}
int get_oil_hot(){
return puntero_datos->get_oil_hot();
}
int get_oil_mild(){
return puntero_datos->get_oil_mild();
}
int get_oil_cold(){
return puntero_datos->get_oil_cold();
}
float get_oil_pressure_too_high(){
return puntero_datos->get_oil_pressure_too_high();
}
float get_oil_pressure_high(){
return puntero_datos->get_oil_pressure_high();
}
float get_oil_pressure_low(){
return puntero_datos->get_oil_pressure_low();
}
float get_fuel_pressure_too_high(){
return puntero_datos->get_fuel_pressure_too_high();
}
float get_fuel_pressure_high(){
return puntero_datos->get_fuel_pressure_high();
}
float get_fuel_pressure_low(){
return puntero_datos->get_fuel_pressure_low();
}
void save(){
puntero_datos->save_data();
}
void load(){
puntero_datos->load_data();
}
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
){
puntero_datos->update_data(
rpm_max,
desplazamiento,
modo_oscuro,
pantalla,
rpm_display,
diff_rpm,
recepcion_datos,
vbatt_too_high,
vbatt_high,
vbatt_low,
water_hot,
water_mild,
water_cold,
oil_hot,
oil_mild,
oil_cold,
oil_pressure_too_high,
oil_pressure_high,
oil_pressure_low,
fuel_pressure_too_high,
fuel_pressure_high,
fuel_pressure_low
);
}
int modify_value(int value, int modifier){
return value+modifier;
}
float modify_value(float value, float modifier){
return value+modifier;
}

560
Pantalla/src/can.cpp Normal file
View file

@ -0,0 +1,560 @@
/**
* @file can.cpp
* @author Raúl Arcos Herrera
* @brief This file contains the implementation of the CAN Controller class for Link G4+ ECU.
*/
#include "../include/can.hpp"
#include "../include/data_processor.hpp"
#include <Arduino.h>
static bool driver_installed = false;
static const uint32_t UI_CAN_MS = 40;
static bool every_ms(uint32_t &last_time, uint32_t interval)
{
uint32_t now = millis();
if(last_time == 0 || now - last_time >= interval){
last_time = now;
return true;
}
return false;
}
void CAN::start() {
Serial.println("Starting CAN Controller...");
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT((gpio_num_t)TX_PIN, (gpio_num_t)RX_PIN, TWAI_MODE_NORMAL);
g_config.rx_queue_len = 64;
g_config.tx_queue_len = 16;
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS();
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
esp_err_t install_status = twai_driver_install(&g_config, &t_config, &f_config);
if (install_status != ESP_OK) {
Serial.println("Failed to install TWAI driver");
driver_installed = false;
return;
} else {
Serial.println("TWAI driver installed");
}
esp_err_t start_status = twai_start();
if (start_status != ESP_OK) {
Serial.println("Failed to start TWAI driver");
driver_installed = false;
return;
} else {
Serial.println("TWAI driver started");
}
uint32_t alerts_to_enable = TWAI_ALERT_RX_DATA | TWAI_ALERT_ERR_PASS | TWAI_ALERT_BUS_ERROR | TWAI_ALERT_RX_QUEUE_FULL;
if (twai_reconfigure_alerts(alerts_to_enable, NULL) == ESP_OK) {
Serial.println("CAN Alerts reconfigured");
} else {
Serial.println("Failed to reconfigure alerts");
driver_installed = false;
return;
}
// TWAI driver is now successfully installed and started
driver_installed = true;
}
CAN::~CAN() {
stop_iracing_task();
stop_listening_task();
if (driver_installed) {
twai_stop();
twai_driver_uninstall();
driver_installed = false;
}
}
void CAN::start_listening_task() {
if (_listen_task_handle == NULL) {
_should_stop_listening = false;
BaseType_t result = xTaskCreate(
listenTask, // Task function
"CAN_Listen_Task", // Task name
4096, // Stack size (words)
this, // Task parameter (this CAN instance)
1, // Priority (lowered from 5 to 1)
&_listen_task_handle // Task handle
);
// BaseType_t result = xTaskCreatePinnedToCore(
// listenTask, // Task function
// "CAN_Listen_Task", // Task name
// 4096, // Stack size (words)
// this, // Task parameter (this CAN instance)
// 1, // Priority
// &_listen_task_handle, // Task handle
// 0 // Core 0 (main loop typically runs on Core 1)
// );
if (result == pdPASS) {
Serial.println("CAN listening task created successfully");
} else {
Serial.println("Failed to create CAN listening task");
_listen_task_handle = NULL;
}
} else {
Serial.println("CAN listening task already running");
}
}
void CAN::stop_listening_task() {
if (_listen_task_handle != NULL) {
_should_stop_listening = true;
// Wait for task to finish (max 1 second)
for (int i = 0; i < 100; i++) {
if (_listen_task_handle == NULL) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
// Force delete if still running
if (_listen_task_handle != NULL) {
vTaskDelete(_listen_task_handle);
_listen_task_handle = NULL;
}
Serial.println("CAN listening task stopped");
}
}
void CAN::start_iracing_task() {
if (_iracing_task_handle == NULL) {
_should_stop_iracing = false;
_serial_protocol = 0;
_serial_index = 0;
BaseType_t result = xTaskCreate(iracingTask, "iRacing_Task", 4096, this, 1, &_iracing_task_handle);
if (result == pdPASS) {
Serial.println("iRacing serial task created successfully");
} else {
Serial.println("Failed to create iRacing serial task");
_iracing_task_handle = NULL;
}
} else {
Serial.println("iRacing serial task already running");
}
}
void CAN::stop_iracing_task() {
if (_iracing_task_handle != NULL) {
_should_stop_iracing = true;
for (int i = 0; i < 100; i++) {
if (_iracing_task_handle == NULL) {
break;
}
vTaskDelay(pdMS_TO_TICKS(10));
}
if (_iracing_task_handle != NULL) {
vTaskDelete(_iracing_task_handle);
_iracing_task_handle = NULL;
}
Serial.println("iRacing serial task stopped");
}
}
void CAN::send_frame(twai_message_t message) {
while (xSemaphoreTake(_mutex, portMAX_DELAY) != pdTRUE) {
Serial.println("Retrying to take mutex in send_frame");
}
twai_transmit(&message, pdMS_TO_TICKS(TRANSMIT_RATE_MS));
xSemaphoreGive(_mutex);
}
twai_message_t CAN::createBoolMessage(bool b0, bool b1, bool b2, bool b3, bool b4, bool b5, bool b6, bool b7) {
twai_message_t message;
memset(&message, 0, sizeof(message));
message.identifier = 0x001;
message.data[0] = (b7 << 7) | (b6 << 6) | (b5 << 5) | (b4 << 4) |
(b3 << 3) | (b2 << 2) | (b1 << 1) | b0;
message.data_length_code = 8;
message.flags = TWAI_MSG_FLAG_NONE;
return message;
}
void CAN::listenTask(void *arg){
CAN* instance=static_cast<CAN*>(arg);
instance->listen_id();
instance->_listen_task_handle=NULL;
vTaskDelete(NULL);
}
void CAN::iracingTask(void *arg) {
CAN* instance = static_cast<CAN*>(arg);
while (!instance->_should_stop_iracing) {
instance->data_update();
vTaskDelay(pdMS_TO_TICKS(1));
}
instance->_iracing_task_handle = NULL;
vTaskDelete(NULL);
}
void CAN::listen() {
Serial.println("CAN listening task started");
// Continuous loop for the thread
while (!_should_stop_listening) {
if (!driver_installed) {
// Driver not installed
vTaskDelay(pdMS_TO_TICKS(1000));
continue;
Serial.println("No driver");
}
mensaje_botonera(1, 1, 1, 1, 1, 1);
Serial.println("Enviado boton");
// Check if alert happened
uint32_t alerts_triggered;
twai_read_alerts(&alerts_triggered, pdMS_TO_TICKS(1000)); // Reduced timeout for more responsiveness
twai_status_info_t twaistatus;
twai_get_status_info(&twaistatus);
//Serial.print(alerts_triggered);
//Serial.println();
// Handle alerts
if (alerts_triggered & TWAI_ALERT_ERR_PASS) {
Serial.println("Alert: TWAI controller has become error passive.");
}
if (alerts_triggered & TWAI_ALERT_BUS_ERROR) {
Serial.println("Alert: A (Bit, Stuff, CRC, Form, ACK) error has occurred on the bus.");
Serial.printf("Bus error count: %lu\n", twaistatus.bus_error_count);
}
if (alerts_triggered & TWAI_ALERT_RX_QUEUE_FULL) {
Serial.println("Alert: The RX queue is full causing a received frame to be lost.");
Serial.printf("RX buffered: %lu\t", twaistatus.msgs_to_rx);
Serial.printf("RX missed: %lu\t", twaistatus.rx_missed_count);
Serial.printf("RX overrun %lu\n", twaistatus.rx_overrun_count);
}
if (alerts_triggered & TWAI_ALERT_RX_DATA) {
//Serial.println("Alerta detectada");
twai_message_t message;
int message_count = 0;
while (twai_receive(&message, 0) == ESP_OK && !_should_stop_listening) {
bool all_zeros = true;
for (int i = 0; i < message.data_length_code; i++) {
if (message.data[i] != 0) {
all_zeros = false;
break;
}
}
if (all_zeros) {
Serial.println("Ignoring message with all zero data");
taskYIELD();
continue;
}
/*
if (message.extd) {
Serial.println("Extended Format");
} else {
Serial.println("Standard Format");
}
*/
//Serial.printf("ID: %lx\nByte:", message.identifier);
if (!(message.rtr)) {
for (int i = 0; i < message.data_length_code; i++) {
Serial.printf(" %d = %02x,", i, message.data[i]);
}
Serial.println("");
// Send to data processor based on first byte (maintaining original logic)
switch (message.data[0]) {
case 0:
_data_processor->send_serial_frame_0(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 1:
_data_processor->send_serial_frame_1(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 2:
_data_processor->send_serial_frame_2(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 3:
_data_processor->send_serial_frame_3(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 5:
_data_processor->send_serial_frame_volante(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
default:
break;
}
}
taskYIELD();
}
}
taskYIELD();
vTaskDelay(pdMS_TO_TICKS(5));
}
Serial.println("CAN listening task ending");
_listen_task_handle = NULL;
vTaskDelete(NULL); // Delete this task
}
twai_message_t CAN::mensaje_botonera(uint8_t B1, uint8_t B2, uint8_t B3, uint8_t B4, uint8_t leval, uint8_t levar) {
twai_message_t message;
memset(&message, 0, sizeof(message));
message.identifier = 0x40;
message.data[0]=ID_BOTONES;
message.data[1]=B1; // Neutra
message.data[2]=B2; // Cambio de pantalla
message.data[3]=B3; // Arrancado
message.data[4]=B4; // Launch
message.data[5]=leval; // Leva izquierda
message.data[6]=levar; // Leva derecha
message.data[7]=1; // Para que el can lo escuche ya que si todos son 0, ignora el mensaje
message.data_length_code = 8;
message.flags = TWAI_MSG_FLAG_SELF;
return message;
}
void CAN::listen_id() {
Serial.println("CAN listening task started");
static uint32_t last_can_update=0;
// Continuous loop for the thread
while (!_should_stop_listening) {
if (!driver_installed) {
// Driver not installed
vTaskDelay(pdMS_TO_TICKS(1000));
continue;
Serial.println("No driver");
}
if(!every_ms(last_can_update, UI_CAN_MS)){
continue;
}
// Check if alert happened
uint32_t alerts_triggered;
twai_read_alerts(&alerts_triggered, 0); // Reduced timeout for more responsiveness
twai_status_info_t twaistatus;
twai_get_status_info(&twaistatus);
//Serial.print(alerts_triggered);
//Serial.println();
// Handle alerts
if (alerts_triggered & TWAI_ALERT_ERR_PASS) {
Serial.println("Alert: TWAI controller has become error passive.");
}
if (alerts_triggered & TWAI_ALERT_BUS_ERROR) {
Serial.println("Alert: A (Bit, Stuff, CRC, Form, ACK) error has occurred on the bus.");
Serial.printf("Bus error count: %lu\n", twaistatus.bus_error_count);
}
if (alerts_triggered & TWAI_ALERT_RX_QUEUE_FULL) {
Serial.println("Alert: The RX queue is full causing a received frame to be lost.");
Serial.printf("RX buffered: %lu\t", twaistatus.msgs_to_rx);
Serial.printf("RX missed: %lu\t", twaistatus.rx_missed_count);
Serial.printf("RX overrun %lu\n", twaistatus.rx_overrun_count);
}
if (alerts_triggered & TWAI_ALERT_RX_DATA) {
//Serial.println("Alerta detectada");
twai_message_t message;
int message_count = 0;
while (twai_receive(&message, 0) == ESP_OK && !_should_stop_listening) {
//bool all_zeros = true;
/*
for (int i = 1; i < message.data_length_code; i++){
if (message.data[i] != 0) {
all_zeros = false;
break;
}
}
if(message.data[0]==0){
float vbatt_prueba = ((message.data[6] * 256.0) + (float)message.data[5])/100.0;
if(vbatt_prueba<=2){
continue;
}
}
if (all_zeros) {
//Serial.println("Ignoring message with all zero data");
taskYIELD();
continue;
}
*/
/*
if (message.extd) {
Serial.println("Extended Format");
} else {
Serial.println("Standard Format");
}
*/
//Serial.printf("ID: %lx\nByte:", message.identifier);
if (!(message.rtr)) {
/*
for (int i = 0; i < message.data_length_code; i++) {
Serial.printf(" %d = %02x,", i, message.data[i]);
}
Serial.println("");
*/
// Send to data processor based on first byte (maintaining original logic)
switch (message.data[0]) {
case 0:
_data_processor->send_serial_frame_0(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 1:
_data_processor->send_serial_frame_1(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 2:
_data_processor->send_serial_frame_2(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 3:
_data_processor->send_serial_frame_3(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
case 100:
_data_processor->send_serial_frame_volante(message.data[1], message.data[2], message.data[3], message.data[4], message.data[5], message.data[6], message.data[7]);
break;
default:
break;
}
}
taskYIELD();
}
}
taskYIELD();
vTaskDelay(pdMS_TO_TICKS(5));
}
Serial.println("CAN listening task ending");
_listen_task_handle = NULL;
vTaskDelete(NULL); // Delete this task
}
void CAN::clear_rx_queue() {
esp_err_t result = twai_clear_receive_queue();
/*
if (result == ESP_OK) {
Serial.println("CAN RX queue cleared");
} else {
Serial.printf("Error clearing CAN RX queue: %d\n", result);
}
*/
}
void CAN::data_update() {
while(Serial.available()>0){
uint8_t b=(uint8_t)Serial.read();
if(_serial_protocol==0){
if(b==0xAD){
_serial_buffer[0]=b;
_serial_protocol=1;
_serial_index=1;
} else if(b==0xAA){
_serial_protocol=3;
_serial_index=0;
}
continue;
}
if(_serial_protocol==1){
if(b==0x02){
_serial_buffer[1]=b;
_serial_protocol=2;
_serial_index=2;
} else if(b==0xAD){
_serial_buffer[0]=b;
_serial_index=1;
} else if(b==0xAA){
_serial_protocol=3;
_serial_index=0;
} else {
_serial_protocol=0;
_serial_index=0;
}
continue;
}
if(_serial_protocol==2){
if(_serial_index<sizeof(_serial_buffer)){
_serial_buffer[_serial_index++]=b;
} else {
_serial_protocol=0;
_serial_index=0;
continue;
}
if(_serial_index==15 && _serial_buffer[14]==0x0A){
_data_processor->send_serial_frame_0(_serial_buffer[3], _serial_buffer[2], _serial_buffer[5], _serial_buffer[4], _serial_buffer[7], _serial_buffer[6], _serial_buffer[8]);
_data_processor->send_serial_frame_1(_serial_buffer[11], _serial_buffer[10], 0, 0, _serial_buffer[13], _serial_buffer[12], _serial_buffer[9]);
_data_processor->send_serial_frame_2(0, 0, 0, 0, 0, 0, _serial_buffer[9]);
_serial_protocol=0;
_serial_index=0;
} else if(_serial_index==21){
if(_serial_buffer[20]==0x0A){
_data_processor->send_serial_frame_0(_serial_buffer[3], _serial_buffer[2], _serial_buffer[5], _serial_buffer[4], _serial_buffer[7], _serial_buffer[6], _serial_buffer[8]);
_data_processor->send_serial_frame_1(_serial_buffer[11], _serial_buffer[10], _serial_buffer[15], _serial_buffer[14], _serial_buffer[13], _serial_buffer[12], _serial_buffer[9]);
_data_processor->send_serial_frame_2(_serial_buffer[16], _serial_buffer[17], 0, 0, _serial_buffer[19], _serial_buffer[18], _serial_buffer[9]);
}
_serial_protocol=0;
_serial_index=0;
}
continue;
}
if(_serial_protocol==3){
if(_serial_index<13){
_serial_buffer[_serial_index++]=b;
}
if(_serial_index==13){
uint16_t oil_temperature_raw=(uint16_t)_serial_buffer[5]*100U;
_data_processor->send_serial_frame_0(_serial_buffer[0], _serial_buffer[1], 0, 0, _serial_buffer[10], _serial_buffer[11], _serial_buffer[12]);
_data_processor->send_serial_frame_1(0, 0, 0, 0, _serial_buffer[8], _serial_buffer[9], _serial_buffer[4]);
_data_processor->send_serial_frame_2(0, 0, 0, 0, 0, 0, _serial_buffer[4]);
_data_processor->send_serial_frame_3((oil_temperature_raw>>8)&0xFF, oil_temperature_raw&0xFF, _serial_buffer[6], _serial_buffer[7], 0, 0, 0);
_serial_protocol=0;
_serial_index=0;
}
}
}
}

View file

@ -0,0 +1,563 @@
#include "../include/crowpanel_controller.hpp"
#include "../include/ajustes.hpp"
#include <PCA9557.h>
uint32_t CrowPanelController::screenWidth;
uint32_t CrowPanelController::screenHeight;
lv_disp_draw_buf_t CrowPanelController::draw_buf;
lv_color_t CrowPanelController::disp_draw_buf[800 * 480 / 10];
lv_disp_drv_t CrowPanelController::disp_drv;
lv_indev_drv_t CrowPanelController::indev_drv;
SemaphoreHandle_t lvgl_mutex;
PCA9557 Out;
// -------------------------------------------------------------------------------------------
static const int RPM_SCALE_START_X = -385;
static const int RPM_SCALE_BREAK_RPM = 6000;
static const int RPM_SCALE_BREAK_X = -198;
static const int RPM_SCALE_END_X_BASE = 365;
static const int RPM_MAJOR_Y = -190;
static const int RPM_MAJOR_H = 22;
static const int RPM_MID_Y = -186;
static const int RPM_MID_H = 12;
static const int RPM_LABEL_Y = -218;
static const int RPM_MAX_OBJECTS = 16;
static lv_obj_t *rpm_dynamic_major[RPM_MAX_OBJECTS] = {nullptr};
static lv_obj_t *rpm_dynamic_mid[RPM_MAX_OBJECTS] = {nullptr};
static lv_obj_t *rpm_dynamic_label[RPM_MAX_OBJECTS] = {nullptr};
static bool rpm_original_scale_hidden = false;
static int rpm_scale_x_from_rpm(int rpm_value, int rpm_max, int desplazamiento)
{
if(rpm_max < 1000){
rpm_max = 1000;
}
if(rpm_value < 0){
rpm_value = 0;
}
if(rpm_value > rpm_max){
rpm_value = rpm_max;
}
int end_x = RPM_SCALE_END_X_BASE + desplazamiento;
if(end_x > 385){
end_x = 385;
}
if(end_x < RPM_SCALE_BREAK_X + 20){
end_x = RPM_SCALE_BREAK_X + 20;
}
if(CrowPanelController::set_lineal()==2 || CrowPanelController::set_lineal()==3 || rpm_max <= RPM_SCALE_BREAK_RPM){
return RPM_SCALE_START_X + ((rpm_value * (end_x - RPM_SCALE_START_X)) / rpm_max);
}
if(rpm_value <= RPM_SCALE_BREAK_RPM){
return RPM_SCALE_START_X + ((rpm_value * (RPM_SCALE_BREAK_X - RPM_SCALE_START_X)) / RPM_SCALE_BREAK_RPM);
}
return RPM_SCALE_BREAK_X + (((rpm_value - RPM_SCALE_BREAK_RPM) * (end_x - RPM_SCALE_BREAK_X)) / (rpm_max - RPM_SCALE_BREAK_RPM));
}
static void hide_original_rpm_scale()
{
if(rpm_original_scale_hidden){
return;
}
lv_obj_t *original_objs[] = {
ui_rpm0, ui_rpm1, ui_rpm2, ui_rpm3, ui_rpm4, ui_rpm5, ui_rpm6,
ui_rpm7, ui_rpm8, ui_rpm9, ui_rpm10, ui_rpm11, ui_rpm12, ui_rpm13,
ui_rpmt0, ui_rpmt1, ui_rpmt2, ui_rpmt3, ui_rpmt4, ui_rpmt5, ui_rpmt6,
ui_rpmt7, ui_rpmt8, ui_rpmt9, ui_rpmt10, ui_rpmt11, ui_rpmt12, ui_rpmt16,
ui_rpmbaja1, ui_rpmbaja2, ui_rpmbaja3, ui_rpmbaja4,
ui_rpmbaja5, ui_rpmbaja6, ui_rpmbaja7
};
int total = sizeof(original_objs) / sizeof(original_objs[0]);
for(int i=0; i<total; i++){
if(original_objs[i] != nullptr){
lv_obj_add_flag(original_objs[i], LV_OBJ_FLAG_HIDDEN);
}
}
rpm_original_scale_hidden = true;
}
static uint32_t rpm_scale_normal_color()
{
return (ui_theme_idx == 1) ? CrowPanelController::COLOR_BLANCO_NUEVO : CrowPanelController::COLOR_NEGRO_NUEVO;
}
static uint32_t rpm_scale_red_color()
{
return CrowPanelController::COLOR_ROJO_BARRA;
}
static void set_rpm_mark_color(lv_obj_t *obj, bool red)
{
if(obj == nullptr){
return;
}
uint32_t color = red ? rpm_scale_red_color() : rpm_scale_normal_color();
lv_obj_set_style_bg_opa(obj, LV_OPA_TRANSP, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_width(obj, 3, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_color(obj, lv_color_hex(color), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_border_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
}
static void set_rpm_label_color(lv_obj_t *obj, bool red)
{
if(obj == nullptr){
return;
}
uint32_t color = red ? rpm_scale_red_color() : rpm_scale_normal_color();
lv_obj_set_style_text_color(obj, lv_color_hex(color), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_text_opa(obj, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
}
// -------------------------------------------------------------------------------------------
CrowPanelController::CrowPanelController()
{
}
void CrowPanelController::begin()
{
if (initialized) return;
lvgl_mutex = xSemaphoreCreateRecursiveMutex();
if (lvgl_mutex == NULL) {
Serial.println("ERROR: lvgl_mutex no creado");
return;
}
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
Serial.println("Init CrowPanel...");
pinMode(17, OUTPUT);
digitalWrite(17, LOW);
pinMode(18, OUTPUT);
digitalWrite(18, LOW);
pinMode(42, OUTPUT);
digitalWrite(42, LOW);
Wire.begin(19, 20);
Out.reset();
Out.setMode(IO_OUTPUT);
Out.setState(IO0, IO_LOW);
Out.setState(IO1, IO_LOW);
delay(20);
Out.setState(IO0, IO_HIGH);
delay(100);
Out.setMode(IO1, IO_INPUT);
lcd.begin();
lcd.setRotation(2);
lcd.fillScreen(TFT_BLACK);
screenWidth = lcd.width();
screenHeight = lcd.height();
Serial.printf("LCD %lux%lu\n", (unsigned long)screenWidth, (unsigned long)screenHeight);
lv_init();
delay(100);
lv_disp_draw_buf_init(&draw_buf, disp_draw_buf, NULL, screenWidth * screenHeight / 10);
lv_disp_drv_init(&disp_drv);
disp_drv.hor_res = screenWidth;
disp_drv.ver_res = screenHeight;
disp_drv.flush_cb = my_disp_flush;
disp_drv.full_refresh = 1;
disp_drv.draw_buf = &draw_buf;
disp_drv.user_data = this;
lv_disp_drv_register(&disp_drv);
lv_indev_drv_init(&CrowPanelController::indev_drv);
CrowPanelController::indev_drv.type = LV_INDEV_TYPE_POINTER;
CrowPanelController::indev_drv.read_cb = my_touchpad_read;
CrowPanelController::indev_drv.user_data = this;
lv_indev_drv_register(&CrowPanelController::indev_drv);
ui_init();
inic_barra_rpm();
lv_timer_create(CrowPanelController::iniciar_pantalla, 2000, this);
initialized = true;
Serial.println("CrowPanel OK");
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::show_label(lv_obj_t *label){
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_obj_clear_flag(label, LV_OBJ_FLAG_HIDDEN);
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::hide_label(lv_obj_t *label){
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_obj_add_flag(label, LV_OBJ_FLAG_HIDDEN);
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::my_disp_flush(lv_disp_drv_t *disp, const lv_area_t *area, lv_color_t *color_p)
{
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
CrowPanelController* controller = static_cast<CrowPanelController*>(disp->user_data);
LGFX& lcd = controller->lcd;
uint32_t w = (area->x2 - area->x1 + 1);
uint32_t h = (area->y2 - area->y1 + 1);
#if (LV_COLOR_16_SWAP != 0)
lcd.pushImageDMA(area->x1, area->y1, w, h, (lgfx::rgb565_t*)&color_p->full);
#else
lcd.pushImageDMA(area->x1, area->y1, w, h, (lgfx::rgb565_t*)&color_p->full);
#endif
lv_disp_flush_ready(disp);
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::my_touchpad_read(lv_indev_drv_t *indev_driver, lv_indev_data_t *data)
{
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
CrowPanelController* controller = static_cast<CrowPanelController*>(indev_driver->user_data);
uint16_t touchX, touchY;
bool touched = controller->lcd.getTouch(&touchX, &touchY);
if (!touched) {
data->state = LV_INDEV_STATE_REL;
} else {
data->state = LV_INDEV_STATE_PR;
data->point.x = screenWidth - 1 - touchX;
data->point.y = screenHeight - 1 - touchY;
}
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::set_value_to_label(lv_obj_t *label, double value)
{
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
if (value == (int)value) {
lv_label_set_text_fmt(label, "%d", (int)value);
} else {
char buffer[10];
snprintf(buffer, sizeof(buffer), "%.2f", value);
lv_label_set_text(label, buffer);
}
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::set_string_to_label(lv_obj_t *label, const char *string){
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_label_set_text(label, string);
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::iniciar_pantalla(lv_timer_t * timer){ // Temporizador para que este 2 segundos en el logo y llama al cambio de pantalla
CrowPanelController *self = (CrowPanelController *) timer->user_data;
if(self){
self->encendido_pantalla=true;
self->change_screen();
}
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_timer_del(timer);
xSemaphoreGiveRecursive(lvgl_mutex);
}
void CrowPanelController::change_screen(){
if(encendido_pantalla){
new_screen++;
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
if(new_screen >= 2){ // Se puede expandir si se ponen mas pantallas
new_screen = 1;
}
switch(new_screen){
case 1:
lv_disp_load_scr(ui_Screen1);
break;
case 2:
lv_disp_load_scr(ui_Screen2);
break;
case 3:
//lv_disp_load_scr(ui_Screen3);
break;
default:
Serial.println("Error cambiar pantalla");
break;
}
xSemaphoreGiveRecursive(lvgl_mutex);
}
}
// New color management methods
void CrowPanelController::set_label_color(lv_obj_t *label, uint32_t color) {
if (label != NULL) {
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_obj_set_style_text_color(label, lv_color_hex(color), LV_PART_MAIN | LV_STATE_DEFAULT);
xSemaphoreGiveRecursive(lvgl_mutex);
}
}
void CrowPanelController::set_panel_color(lv_obj_t *panel, uint32_t bg_color) {
if (panel != NULL) {
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
// 1. COPIAMOS la lógica de opacidad de la función default
// LV_OPA_COVER significa 100% opaco (es lo mismo que 255)
lv_obj_set_style_bg_opa(panel, LV_OPA_COVER, LV_PART_MAIN | LV_STATE_DEFAULT);
// 2. Aplicamos el color que queremos (Rojo, Verde, etc.)
lv_obj_set_style_bg_color(panel, lv_color_hex(bg_color), LV_PART_MAIN | LV_STATE_DEFAULT);
xSemaphoreGiveRecursive(lvgl_mutex);
}
}
void CrowPanelController::set_conditional_colors() {
// This method will be called from data_processor.cpp to update colors based on conditions
// Implementation will be added when specific conditions are defined
}
void CrowPanelController::update_rpm_bar(int rpm){ // Actualiza la barra de las rpm
int pixel=0;
uint32_t color;
// bool rpm12300=false;
pixel=rpm_to_pixel(rpm);
if(pixel<695){
color=(ui_theme_idx==1) ? COLOR_BLANCO_NUEVO : COLOR_NEGRO_NUEVO;
lv_obj_set_style_bg_color(ui_barrpm, lv_color_hex(color), LV_PART_INDICATOR);
} else{
lv_obj_set_style_bg_color(ui_barrpm, lv_color_hex(COLOR_ROJO_BARRA), LV_PART_INDICATOR);
}
lv_bar_set_value(ui_barrpm, pixel, LV_ANIM_ON);
/*
if(rpm>12300){
uint32_t ahora=millis();
rpm12300=true;
if(ahora-last_parpadeo>50){
last_parpadeo=ahora;
parpadeo=!parpadeo;
}
if(parpadeo){
lv_obj_set_style_bg_color(ui_barrpm, lv_color_make(255, 255, 255), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm, lv_color_make(255, 255, 255), LV_PART_INDICATOR);
lv_obj_set_style_bg_color(ui_barrpm1, lv_color_make(255, 255, 255), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm1, lv_color_make(255, 255, 255), LV_PART_INDICATOR);
} else {
lv_obj_set_style_bg_color(ui_barrpm, lv_color_make(255, 0, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm, lv_color_make(255, 0, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_color(ui_barrpm1, lv_color_make(255, 0, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm1, lv_color_make(255, 0, 0), LV_PART_INDICATOR);
}
}
if(!rpm12300 && last_rpm12300){
lv_obj_set_style_bg_color(ui_barrpm, lv_color_make(0, 205, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm, lv_color_make(230, 230, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_color(ui_barrpm1, lv_color_make(230, 230, 0), LV_PART_INDICATOR);
lv_obj_set_style_bg_grad_color(ui_barrpm1, lv_color_make(255, 0, 0), LV_PART_INDICATOR);
}
last_rpm12300=rpm12300;
*/
}
int CrowPanelController::rpm_to_pixel(int rpm)
{
int rpm_max = (get_rpm()/1000)*1000;
int desplazamiento = get_desplazamiento();
int x = rpm_scale_x_from_rpm(rpm, rpm_max, desplazamiento);
int pixel = x - RPM_SCALE_START_X;
if(pixel < 0){
pixel = 0;
}
if(pixel > 770){
pixel = 770;
}
return pixel;
}
void CrowPanelController::inic_barra_rpm(){ // Inicializa el rango de la barra y la animacion
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
lv_bar_set_range(ui_barrpm, 0, 770);
lv_obj_set_style_anim_time(ui_barrpm, 40, LV_PART_MAIN); // Si se ve mal se puede cambiar e incluso quitar, si se quita hay que modificar en update_rpm_bar
xSemaphoreGiveRecursive(lvgl_mutex);
}
// -------------------------------------------------------------------------------------------
void CrowPanelController::create_rpm_bar(int rpm_max, int desplazamiento)
{
if(ui_barcontainer == nullptr){
return;
}
if(rpm_max < 1000){
rpm_max = 1000;
}
if(rpm_max > 15000){
rpm_max = 15000;
}
int divisor = rpm_max / 1000;
if(divisor >= RPM_MAX_OBJECTS){
divisor = RPM_MAX_OBJECTS - 1;
}
xSemaphoreTakeRecursive(lvgl_mutex, portMAX_DELAY);
hide_original_rpm_scale();
for(int i=0; i<RPM_MAX_OBJECTS; i++){
if(rpm_dynamic_major[i] != nullptr){
lv_obj_add_flag(rpm_dynamic_major[i], LV_OBJ_FLAG_HIDDEN);
}
if(rpm_dynamic_mid[i] != nullptr){
lv_obj_add_flag(rpm_dynamic_mid[i], LV_OBJ_FLAG_HIDDEN);
}
if(rpm_dynamic_label[i] != nullptr){
lv_obj_add_flag(rpm_dynamic_label[i], LV_OBJ_FLAG_HIDDEN);
}
}
int previous_x = RPM_SCALE_START_X;
for(int i=0; i<=divisor; i++){
int rpm_value = i * 1000;
if(i == divisor){
rpm_value = rpm_max;
}
int x = rpm_scale_x_from_rpm(rpm_value, rpm_max, desplazamiento);
bool red = (i == divisor);
if(rpm_dynamic_major[i] == nullptr){
rpm_dynamic_major[i] = lv_obj_create(ui_barcontainer);
lv_obj_set_width(rpm_dynamic_major[i], 3);
lv_obj_set_height(rpm_dynamic_major[i], RPM_MAJOR_H);
lv_obj_set_align(rpm_dynamic_major[i], LV_ALIGN_CENTER);
lv_obj_clear_flag(rpm_dynamic_major[i], LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_radius(rpm_dynamic_major[i], 0, LV_PART_MAIN | LV_STATE_DEFAULT);
}
lv_obj_set_x(rpm_dynamic_major[i], x);
lv_obj_set_y(rpm_dynamic_major[i], RPM_MAJOR_Y);
lv_obj_clear_flag(rpm_dynamic_major[i], LV_OBJ_FLAG_HIDDEN);
set_rpm_mark_color(rpm_dynamic_major[i], red);
if(rpm_dynamic_label[i] == nullptr){
rpm_dynamic_label[i] = lv_label_create(ui_barcontainer);
lv_obj_set_width(rpm_dynamic_label[i], LV_SIZE_CONTENT);
lv_obj_set_height(rpm_dynamic_label[i], LV_SIZE_CONTENT);
lv_obj_set_align(rpm_dynamic_label[i], LV_ALIGN_CENTER);
lv_obj_set_style_text_font(rpm_dynamic_label[i], &ui_font_rpm, LV_PART_MAIN | LV_STATE_DEFAULT);
}
lv_obj_set_x(rpm_dynamic_label[i], x);
lv_obj_set_y(rpm_dynamic_label[i], RPM_LABEL_Y);
if(rpm_value <= 6000){
lv_label_set_text_fmt(rpm_dynamic_label[i], "%d", rpm_value / 1000);
} else {
lv_label_set_text_fmt(rpm_dynamic_label[i], "%d", rpm_value);
}
lv_obj_clear_flag(rpm_dynamic_label[i], LV_OBJ_FLAG_HIDDEN);
set_rpm_label_color(rpm_dynamic_label[i], red);
if(i > 0 && rpm_value > 6000){
int x_middle = (previous_x + x) / 2;
bool mid_red = (i == divisor);
if(rpm_dynamic_mid[i] == nullptr){
rpm_dynamic_mid[i] = lv_obj_create(ui_barcontainer);
lv_obj_set_width(rpm_dynamic_mid[i], 3);
lv_obj_set_height(rpm_dynamic_mid[i], RPM_MID_H);
lv_obj_set_align(rpm_dynamic_mid[i], LV_ALIGN_CENTER);
lv_obj_clear_flag(rpm_dynamic_mid[i], LV_OBJ_FLAG_SCROLLABLE);
lv_obj_set_style_radius(rpm_dynamic_mid[i], 0, LV_PART_MAIN | LV_STATE_DEFAULT);
}
lv_obj_set_x(rpm_dynamic_mid[i], x_middle);
lv_obj_set_y(rpm_dynamic_mid[i], RPM_MID_Y);
lv_obj_clear_flag(rpm_dynamic_mid[i], LV_OBJ_FLAG_HIDDEN);
set_rpm_mark_color(rpm_dynamic_mid[i], mid_red);
}
previous_x = x;
}
xSemaphoreGiveRecursive(lvgl_mutex);
}
int CrowPanelController::set_lineal(){
return get_rpm_display();
}
// -------------------------------------------------------------------------------------------

View file

@ -0,0 +1,584 @@
/**
* @file data_processor.cpp
* @author Raúl Arcos Herrera
* @brief This file contains the implementation of the Data Processor class for Link G4+ ECU.
*/
#include "../include/data_processor.hpp"
#include "../include/ajustes.hpp"
// ---------------------------------
static int rpm_max=8000;
static int desp=0;
static bool modo_oscuro=true;
static int pantalla=0;
static int rpm_display=false;
static int diff_rpm=1200;
static float vbatt_too_high=15.0;
static float vbatt_high=14.5;
static float vbatt_low=12.5;
static int water_hot=110;
static int water_mild=100;
static int water_cold=70;
static int oil_hot=110;
static int oil_mild=100;
static int oil_cold=70;
static float oil_pressure_too_high=4.0;
static float oil_pressure_high=3.0;
static float oil_pressure_low=1.0;
static float fuel_pressure_too_high=15.0;
static float fuel_pressure_high=12.0;
static float fuel_pressure_low=3.0;
static const uint32_t UI_RPM_MS = 30;
static const uint32_t UI_SLOW_MS = 100;
static const uint32_t UI_AUX_MS = 200;
static bool every_ms(uint32_t &last_time, uint32_t interval)
{
uint32_t now = millis();
if(last_time == 0 || now - last_time >= interval){
last_time = now;
return true;
}
return false;
}
// --------------------------------
void DataProcessor::send_serial(byte type, unsigned int value) { //Como parámetros se pasan el ID (type), que es el ID establecido al inicio del código para el dato que se quiera enviar. Ej: RPM_ID -> 0x51; y se envía el valor de dicho dato.
byte dato[8] = { 0x5A, 0xA5, 0x05, 0x82, 0x00, 0x00, 0x00, 0x00 }; //Se establece un arreglo de bytes con los primeros datos necesarios para que la pantalla lo interprete como mensaje (En la Wiki hay tutoriales que lo explican a fondo), como ser la longitud y el tipo de mensaje.
dato[4] = type; //Se configura en el mensaje el ID correspondiente al dato a enviar.
dato[6] = (value >> 8) & 0xFF; //Se configura el dato en los últimos 2 bytes.
dato[7] = value & 0xFF;
Serial.write(dato, 8); //Se envía serialmente el mensaje, indicando su longituden bytes para ello.
}
//RPM + TPS + vBatt + ECT
void DataProcessor::send_serial_frame_0(int rpmh, int rpml, int tpsh, int tpsl, int vbatth, int vbattl, int ect){
//Serial.println("send_serial_frame_0");
uint32_t color;
int rpm = (rpmh * 256) + rpml;
float tps = ((tpsh * 256) + tpsl);
float vbatt = ((vbatth * 256.0) + (float)vbattl)/100.0;
static uint32_t last_rpm_update = 0;
static uint32_t last_slow_update = 0;
if(every_ms(last_rpm_update, UI_RPM_MS)){
_crow_panel_controller->set_value_to_label(ui_rpm, rpm);
_crow_panel_controller->update_rpm_bar(rpm);
DataProcessor::update_rpm_leds(rpm);
_crow_panel_controller->set_value_to_label(ui_throttle, tps);
}
if(!every_ms(last_slow_update, UI_SLOW_MS)){
return;
}
_crow_panel_controller->set_value_to_label(ui_vbat, vbatt);
_crow_panel_controller->set_value_to_label(ui_watert, ect);
// Battery voltage color (typical car battery: 12.6V resting, 13.2-14.4V running)
if (vbatt < vbatt_low) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_vbatpanel, color); // Red for low
} else if (vbatt < vbatt_high) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_vbatpanel, color); // Yellow for warning
} else if (vbatt > vbatt_too_high) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_vbatpanel, color); // Yellow for overcharge
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_vbatpanel, color); // Green for good
}
// Engine coolant temperature (typical range: 80-105°C normal operating temp)
if (ect > water_hot) {
// Crítico: Rojo
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_watertpanel, color);
_crow_panel_controller->hide_label(ui_warmuppanel);
_crow_panel_controller->hide_label(ui_warmup);
} else if (ect >= water_mild) {
// Advertencia: Amarillo (100 a 110)
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_watertpanel, color);
_crow_panel_controller->hide_label(ui_warmuppanel);
_crow_panel_controller->hide_label(ui_warmup);
} else if (ect >= water_cold) {
//Temperatura Ideal: Verde (70 a 100)
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_watertpanel, color);
_crow_panel_controller->hide_label(ui_warmuppanel);
_crow_panel_controller->hide_label(ui_warmup);
} else { // etc <= 70 Azul
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AZUL_NUEVO : CrowPanelController::COLOR_AZUL_CLARO;
_crow_panel_controller->show_label(ui_warmuppanel);
_crow_panel_controller->show_label(ui_warmup);
_crow_panel_controller->set_panel_color(ui_watertpanel, color);
}
}
//LAMB + LAMBTRG + FUEL + GEAR
void DataProcessor::send_serial_frame_1(int lmbh, int lmbl, int lmbth, int lmbtl, int fuelh, int fuell, int gear){
//Serial.println("send_serial_frame_1");
static uint32_t last_slow_update = 0;
if(!every_ms(last_slow_update, UI_SLOW_MS)){
return;
}
uint32_t color;
double lmb = ((lmbh * 256) + lmbl) / 100.0;
double lmbtrg = ((lmbth * 256) + lmbtl) / 100.0;
double fuel = ((fuelh * 256) + fuell)/100.0;
_crow_panel_controller->set_value_to_label(ui_lambda, lmb);
_crow_panel_controller->set_value_to_label(ui_lambdatrg, lmbtrg);
_crow_panel_controller->set_value_to_label(ui_fuelp, fuel);
//_crow_panel_controller->set_value_to_label(ui_neutral, gear);
if (fuel > fuel_pressure_too_high) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_fuelppanel, color);
} else if (fuel >= fuel_pressure_high) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_fuelppanel, color);
} else if (fuel >= fuel_pressure_low) {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_fuelppanel, color);
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_fuelppanel, color);
}
if(lmb > 1.1){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_lambdapanel, color);
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_lambdapanel, color);
}
}
void DataProcessor::send_serial_frame_2(int shut, int fan, int lmbch, int lmbcl, int brakeh, int brakel, int aux1){
//Serial.println("send_serial_frame_2");
static uint32_t last_aux_update = 0;
if(!every_ms(last_aux_update, UI_AUX_MS)){
return;
}
double lmbcorrect = ((lmbch * 256) + lmbcl) / 100.0;
double brake = ((brakeh * 256) + brakel);
char shut_str[4];
char fan_str[4];
char aux1_str[4];
uint32_t color;
if (shut == 1){
strcpy(shut_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_sdownpanel, color);
} else {
strcpy(shut_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_sdownpanel, color);
}
if (fan == 1){
strcpy(fan_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_fanpanel, color);
} else {
strcpy(fan_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_fanpanel, color);
}
if (aux1 == 0){
strcpy(aux1_str, "N");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->show_label(ui_neutralpanel);
_crow_panel_controller->set_panel_color(ui_neutralpanel, color);
} else {
strcpy(aux1_str, "D");
_crow_panel_controller->hide_label(ui_neutralpanel);
}
_crow_panel_controller->set_string_to_label(ui_sdown, shut_str);
_crow_panel_controller->set_string_to_label(ui_fan, fan_str);
// _crow_panel_controller->set_value_to_label(ui_correctionlambda, lmbcorrect); NO HAY AHORA MISMO
_crow_panel_controller->set_value_to_label(ui_brake, brake);
_crow_panel_controller->set_string_to_label(ui_neutral, aux1_str);
// Brake pressure color (assuming brake > 0 means brakes applied)
/*
if (brake > 100) { // Adjust threshold as needed
_crow_panel_controller->set_label_color(ui_auxstatus9, CrowPanelController::COLOR_WARNING); // Yellow for heavy braking
} else if (brake > 0) {
_crow_panel_controller->set_label_color(ui_auxstatus9, CrowPanelController::COLOR_NORMAL); // White for light braking
} else {
_crow_panel_controller->set_label_color(ui_auxstatus9, CrowPanelController::COLOR_GOOD); // Green for no braking
}
TODO COMENTADO PORQUE LO ULTIMO NO VEO UTILIDAD Y LAS 2 COSAS PRIMERAS ESTAN OPTIMIZADAS PAR DE LINEAS ARRIBAS
*/
}
void DataProcessor::send_serial_frame_3(int oilth, int oiltl, int oilph, int oilpl, int maph, int mapl, int useless) {
float oilt = ((oilth * 256) + oiltl) / 100.0;
float oilp = ((oilph * 256) + oilpl) / 100.0;
float map = ((maph * 256) + mapl) / 100.0;
uint32_t color;
// Temperatura del aceite
if (oilt > oil_hot) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_oiltpanel, color);
} else if (oilt >= oil_mild) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_oiltpanel, color);
} else if (oilt >= oil_cold) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_oiltpanel, color);
} else {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_oiltpanel, color);
}
// Presión del aceite
if (oilp > oil_pressure_too_high) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_oilppanel, color);
} else if (oilp >= oil_pressure_high) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
_crow_panel_controller->set_panel_color(ui_oilppanel, color);
} else if (oilp >= oil_pressure_low) {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_oilppanel, color);
} else {
color = (ui_theme_idx == 1) ? CrowPanelController::COLOR_AZUL_NUEVO : CrowPanelController::COLOR_AZUL_CLARO;
_crow_panel_controller->set_panel_color(ui_oilppanel, color);
}
_crow_panel_controller->set_value_to_label(ui_oilt, oilt);
_crow_panel_controller->set_value_to_label(ui_oilp, oilp);
_crow_panel_controller->set_value_to_label(ui_map, map);
}
void DataProcessor::send_serial_frame_5(int aux3, int aux4, int aux5, int aux6, int aux7, int aux8, int dig1){
Serial.println("send_serial_frame_5");
uint32_t color;
char aux3_str[4];
char aux4_str[4];
char aux5_str[4];
char aux6_str[4];
char aux7_str[4];
char aux8_str[4];
char dig1_str[4];
if (aux3 == 1){ // Cambio de pantalla
strcpy(aux3_str, "ON");
_crow_panel_controller->change_screen();
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux3panel, color);
} else {
strcpy(aux3_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux3panel, color);
}
if (aux4 == 1){
strcpy(aux4_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux4panel, color);
} else {
strcpy(aux4_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux4panel, color);
}
if (aux5 == 1){
strcpy(aux5_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux5panel, color);
} else {
strcpy(aux5_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux5panel, color);
}
if (aux6 == 1){
strcpy(aux6_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux6panel, color);
} else {
strcpy(aux6_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux6panel, color);
}
if(aux7==1){
strcpy(aux7_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux7panel, color);
} else {
strcpy(aux7_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux7panel, color);
}
if(aux8==1){
strcpy(aux8_str, "ON");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
_crow_panel_controller->set_panel_color(ui_aux8panel, color);
} else {
strcpy(aux8_str, "OFF");
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
_crow_panel_controller->set_panel_color(ui_aux8panel, color);
}
//_led_strip->launch_control(aux6);
_crow_panel_controller -> set_string_to_label(ui_aux3, aux3_str);
_crow_panel_controller -> set_string_to_label(ui_aux4, aux4_str);
_crow_panel_controller -> set_string_to_label(ui_aux5, aux5_str);
_crow_panel_controller -> set_string_to_label(ui_aux6, aux6_str);
_crow_panel_controller -> set_string_to_label(ui_aux7, aux7_str);
_crow_panel_controller -> set_string_to_label(ui_aux8, aux8_str);
_crow_panel_controller -> set_string_to_label(ui_dig1, dig1_str);
}
void DataProcessor::send_serial_frame_volante(int neutra, int cpant, int arrancar, int launch, int levaizq, int levader, int aux){
/*
char neutra_str[4];
char cpant_str[4];
char arrancar_str[4];
char launch_str[4];
char levaizq_str[4];
char levader_str[4];
if (neutra== 1){ // Neutra
strcpy(neutra_str, "ON");
_crow_panel_controller->set_panel_color(ui_pneutra, CrowPanelController::COLOR_VERDE);
} else {
strcpy(neutra_str, "OFF");
_crow_panel_controller->set_panel_color(ui_pneutra, CrowPanelController::COLOR_ROJO);
}
if (cpant == 1){ // Cambio de pantalla
if(request_screen==0){
_crow_panel_controller->change_screen();
}
strcpy(cpant_str, "ON");
_crow_panel_controller->set_panel_color(ui_ppantalla, CrowPanelController::COLOR_VERDE);
} else {
strcpy(cpant_str, "OFF");
_crow_panel_controller->set_panel_color(ui_ppantalla, CrowPanelController::COLOR_ROJO);
}
request_screen=cpant;
if (arrancar == 1){ // Arrancar
strcpy(arrancar_str, "ON");
_crow_panel_controller->set_panel_color(ui_parrancar, CrowPanelController::COLOR_VERDE);
} else {
strcpy(arrancar_str, "OFF");
_crow_panel_controller->set_panel_color(ui_parrancar, CrowPanelController::COLOR_ROJO);
}
if (launch == 1){ // Launch
strcpy(launch_str, "ON");
_crow_panel_controller->set_panel_color(ui_plaunch, CrowPanelController::COLOR_VERDE);
} else {
strcpy(launch_str, "OFF");
_crow_panel_controller->set_panel_color(ui_plaunch, CrowPanelController::COLOR_ROJO);
}
if(levaizq==1){ // Leva izquierda
strcpy(levaizq_str, "ON");
_crow_panel_controller->set_panel_color(ui_plevaizq, CrowPanelController::COLOR_VERDE);
} else {
strcpy(levaizq_str, "OFF");
_crow_panel_controller->set_panel_color(ui_plevaizq, CrowPanelController::COLOR_ROJO);
}
if(levader==1){ // Leva derecha
strcpy(levader_str, "ON");
_crow_panel_controller->set_panel_color(ui_plevader, CrowPanelController::COLOR_VERDE);
} else {
strcpy(levader_str, "OFF");
_crow_panel_controller->set_panel_color(ui_plevader, CrowPanelController::COLOR_ROJO);
}
_led_strip->launch_control(launch);
_crow_panel_controller -> set_string_to_label(ui_neutra, neutra_str);
_crow_panel_controller -> set_string_to_label(ui_pantalla, cpant_str);
_crow_panel_controller -> set_string_to_label(ui_arrancar, arrancar_str);
_crow_panel_controller -> set_string_to_label(ui_launch, launch_str);
_crow_panel_controller -> set_string_to_label(ui_levaizq, levaizq_str);
_crow_panel_controller -> set_string_to_label(ui_levader, levader_str);
*/
}
void DataProcessor::set_dataprocessor(){
rpm_max=get_rpm();
desp=get_desplazamiento();
modo_oscuro=get_modo_oscuro();
pantalla=get_pantalla();
rpm_display=get_rpm_display();
diff_rpm=get_diff_rpm();
vbatt_too_high=get_vbatt_too_high();
vbatt_high=get_vbatt_high();
vbatt_low=get_vbatt_low();
water_hot=get_water_hot();
water_mild=get_water_mild();
water_cold=get_water_cold();
oil_hot=get_oil_hot();
oil_mild=get_oil_mild();
oil_cold=get_oil_cold();
oil_pressure_too_high=get_oil_pressure_too_high();
oil_pressure_high=get_oil_pressure_high();
oil_pressure_low=get_oil_pressure_low();
fuel_pressure_too_high=get_fuel_pressure_too_high();
fuel_pressure_high=get_fuel_pressure_high();
fuel_pressure_low=get_fuel_pressure_low();
}
void DataProcessor::update_rpm_leds(int rpm){
static int last_leds = -1;
static int last_theme = -1;
static bool last_over_rpm = false;
static lv_obj_t* rpm_bars[15] = {
ui_led0, ui_led1, ui_led2, ui_led3, ui_led4,
ui_led5, ui_led6, ui_led7, ui_led8, ui_led9,
ui_led10, ui_led11, ui_led12, ui_led13, ui_led14
};
int rpm_inicio = rpm_max - diff_rpm;
if(rpm_inicio < 0){
rpm_inicio = 0;
}
int leds = 0;
bool over_rpm = rpm >= rpm_max;
if(rpm >= rpm_max){
leds = 15;
} else if(rpm > rpm_inicio){
int rango = rpm_max - rpm_inicio;
if(rango > 0){
leds = ((rpm - rpm_inicio) * 15) / rango;
}
if(leds < 0){
leds = 0;
} else if(leds > 15){
leds = 15;
}
}
if(leds == last_leds && ui_theme_idx == last_theme && over_rpm == last_over_rpm){
return;
}
uint32_t color;
if(ui_theme_idx != last_theme || last_leds == -1 || over_rpm != last_over_rpm){
for(int i=0;i<15;i++){
if(i<leds){
if(over_rpm){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AZUL_NUEVO : CrowPanelController::COLOR_AZUL_CLARO;
} else if(i<=4){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
} else if(i<=10){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
}
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_FONDO_BARRA_OSCURO : CrowPanelController::COLOR_FONDO_BARRA_CLARO;
}
_crow_panel_controller->set_panel_color(rpm_bars[i], color);
}
} else if(leds > last_leds){
for(int i=last_leds;i<leds;i++){
if(over_rpm){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AZUL_NUEVO : CrowPanelController::COLOR_AZUL_CLARO;
} else if(i<=4){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_VERDE_NUEVO : CrowPanelController::COLOR_VERDE_CLARO;
} else if(i<=10){
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_AMARILLO_NUEVO : CrowPanelController::COLOR_AMARILLO_CLARO;
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_ROJO_NUEVO : CrowPanelController::COLOR_ROJO_CLARO;
}
_crow_panel_controller->set_panel_color(rpm_bars[i], color);
}
} else {
color=(ui_theme_idx==1) ? CrowPanelController::COLOR_FONDO_BARRA_OSCURO : CrowPanelController::COLOR_FONDO_BARRA_CLARO;
for(int i=leds;i<last_leds;i++){
_crow_panel_controller->set_panel_color(rpm_bars[i], color);
}
}
last_leds = leds;
last_theme = ui_theme_idx;
last_over_rpm = over_rpm;
}

View file

@ -0,0 +1,139 @@
#include "../include/g24_wheel_buttons.hpp"
void G24WheelButtons::begin() {
pinMode(B1_PIN, INPUT_PULLUP); // Arriba izquierda, funcion: neutro
pinMode(B2_PIN, INPUT_PULLUP); // Arriba derecha, funcion: cambiar de pantalla
pinMode(B3_PIN, INPUT_PULLUP); // Abajo izquierda, funcion: arrancar
pinMode(B4_PIN, INPUT_PULLUP); // Abajo derecha, funcion: launch control
pinMode(LEVA_IZQ_PIN, INPUT_PULLUP); // Leva derecha
pinMode(LEVA_DER_PIN, INPUT_PULLUP); // Leva izquierda
/*
pinMode(B1_LED_PIN, OUTPUT);
pinMode(B2_LED_PIN, OUTPUT);
pinMode(B3_LED_PIN, OUTPUT);
pinMode(B4_LED_PIN, OUTPUT);
pinMode(E1_PIN_A, INPUT);
pinMode(E1_PIN_B, INPUT);
pinMode(E2_PIN_A, INPUT);
pinMode(E2_PIN_B, INPUT);
pinMode(E1_BUTTON_PIN, INPUT_PULLUP);
pinMode(E2_BUTTON_PIN, INPUT_PULLUP);
*/
// attachInterruptArg(digitalPinToInterrupt(E1_PIN_A), handleEncoderInterrupt, this, CHANGE);
// attachInterruptArg(digitalPinToInterrupt(E2_PIN_A), handleEncoderInterrupt, this, CHANGE);
}
void G24WheelButtons::ejecucion(){
if(manejador_tarea==NULL){
estado_tarea=true;
BaseType_t tarea = xTaskCreate(
botonera, // Task function
"Botones", // Task name
4096, // Stack size (words)
this, // Task parameter
1, // Priority
&manejador_tarea // Task handle
);
if(tarea==pdPASS){
Serial.println("Tarea de botones del volante creada");
} else {
Serial.println("Error creacion del boton de la tarea del boton del volante");
manejador_tarea=NULL;
}
}
}
void G24WheelButtons::botonera(void *arg){ // Funcion para la tarea de la botonera
G24WheelButtons* instance = static_cast<G24WheelButtons*>(arg);
while(instance->estado_tarea){
instance->check_boton();
vTaskDelay(pdMS_TO_TICKS(20));
}
instance->manejador_tarea = NULL;
vTaskDelete(NULL);
}
void G24WheelButtons::estado_boton(gpio_num_t buttonPin, volatile bool &buttonState, volatile bool &laststate, volatile unsigned long &lastPressTime, volatile unsigned long &temporizador){ // Mira como esta el boton (presionado o no)
int boton=digitalRead(buttonPin);
unsigned long tiempo=millis();
laststate=buttonState;
if(boton==LOW && !buttonState){ // Esta presionado
if(tiempo - lastPressTime >= debounceTime){ // No hay doble presion
if(temporizador==0) temporizador=tiempo;
if(tiempo-temporizador>=PRESS_TIME){ // Temporizador para que no se presione solo por la cara, hay que mantener pulsado el boton 50ms
lastPressTime=tiempo;
buttonState=true;
}
}
} else if(boton==HIGH && buttonState){ // Se ha dejado de presionar
if(tiempo - lastPressTime >= debounceTime){ // No hay doble presion
lastPressTime=tiempo;
buttonState=false;
}
}
if(boton==HIGH) temporizador=0;
}
void G24WheelButtons::check_boton(){
uint8_t b1=0, b2=0, b3=0, b4=0, leval=0, levar=0;
bool enviar=false;
estado_boton(B1_PIN, B1.estado, B1.last_estado, B1.lastPressTime, B1.temporizador);
estado_boton(B2_PIN, B2.estado, B2.last_estado, B2.lastPressTime, B2.temporizador);
estado_boton(B3_PIN, B3.estado, B3.last_estado, B3.lastPressTime, B3.temporizador);
estado_boton(B4_PIN, B4.estado, B4.last_estado, B4.lastPressTime, B4.temporizador);
estado_boton(LEVA_IZQ_PIN, levaizq.estado, levaizq.last_estado, levaizq.lastPressTime, levaizq.temporizador);
estado_boton(LEVA_DER_PIN, levader.estado, levader.last_estado, levader.lastPressTime, levader.temporizador);
if(B1.estado!=B1.last_estado){ // Boton neutral presionado, evento puntual
b1=B1.estado;
enviar=true;
}
if(B2.estado!=B2.last_estado){ // Cambio de pantalla presionado, evento puntual
b2=B2.estado;
enviar=true;
}
if(B3.estado!=B3.last_estado){ // Arrancado presionado, mantener
b3=B3.estado;
enviar=true;
}
if(B4.estado!=B4.last_estado){ // Launch control presionado, mantener
b4=B4.estado;
enviar=true;
}
if(levaizq.estado!=levaizq.last_estado){
leval=levaizq.estado;
enviar=true;
}
if(levader.estado!=levader.last_estado){
levar=levader.estado;
enviar=true;
}
if(enviar){
_can->send_frame(_can->mensaje_botonera(b1, b2, b3, b4, leval, levar)); // Crea un mensaje y lo envia
}
}

271
Pantalla/src/guardado.cpp Normal file
View file

@ -0,0 +1,271 @@
#include "../include/guardado.hpp"
#include <LittleFS.h>
#include <Arduino.h>
void data::save_data(){
File archivo=LittleFS.open(nombre_archivo, "w");
if(!archivo){
Serial.println("Archivo escritura no abierto");
return;
}
archivo.printf("RPM-%d\n", rpm_max);
archivo.printf("DESP-%d\n", desplazamiento);
archivo.printf("MODO-%d\n", modo_oscuro ? 1 : 0);
archivo.printf("PANTALLA-%d\n", pantalla);
archivo.printf("RPM_DISPLAY-%d\n", rpm_display);
archivo.printf("DIFF_RPM-%d\n", diff_rpm);
archivo.printf("VBATT_TOO_HIGH-%.2f\n", vbatt_too_high);
archivo.printf("VBATT_HIGH-%.2f\n", vbatt_high);
archivo.printf("VBATT_LOW-%.2f\n", vbatt_low);
archivo.printf("WATER_HOT-%d\n", water_hot);
archivo.printf("WATER_MILD-%d\n", water_mild);
archivo.printf("WATER_COLD-%d\n", water_cold);
archivo.printf("OIL_HOT-%d\n", oil_hot);
archivo.printf("OIL_MILD-%d\n", oil_mild);
archivo.printf("OIL_COLD-%d\n", oil_cold);
archivo.printf("OIL_PRESSURE_TOO_HIGH-%.2f\n", oil_pressure_too_high);
archivo.printf("OIL_PRESSURE_HIGH-%.2f\n", oil_pressure_high);
archivo.printf("OIL_PRESSURE_LOW-%.2f\n", oil_pressure_low);
archivo.printf("FUEL_PRESSURE_TOO_HIGH-%.2f\n", fuel_pressure_too_high);
archivo.printf("FUEL_PRESSURE_HIGH-%.2f\n", fuel_pressure_high);
archivo.printf("FUEL_PRESSURE_LOW-%.2f\n", fuel_pressure_low);
archivo.printf("RECEPCION_DATOS-%d\n", recepcion_datos);
archivo.close();
}
void data::load_data(){
File archivo=LittleFS.open(nombre_archivo, "r");
if(!archivo){
Serial.println("Archivo lectura no abierto");
rpm_max=8000;
desplazamiento=0;
modo_oscuro=1;
pantalla=0;
rpm_display=0;
diff_rpm=1200;
recepcion_datos=0;
vbatt_too_high=15.0;
vbatt_high=14.5;
vbatt_low=12.5;
water_hot=110;
water_mild=100;
water_cold=70;
oil_hot=110;
oil_mild=100;
oil_cold=70;
oil_pressure_too_high=4.0;
oil_pressure_high=3.0;
oil_pressure_low=1.0;
fuel_pressure_too_high=15.0;
fuel_pressure_high=12.0;
fuel_pressure_low=3.0;
return;
}
int cantidad=0;
while(archivo.available() && cantidad<22){
String linea=archivo.readStringUntil('\n');
int guion=linea.indexOf('-');
if(guion<0){
continue;
}
String clave=linea.substring(0, guion);
float valor=linea.substring(guion+1).toFloat();
if(clave=="RPM") rpm_max=(int)valor;
else if(clave=="DESP") desplazamiento=(int)valor;
else if(clave=="MODO") modo_oscuro=(valor!=0);
else if(clave=="PANTALLA") pantalla=(int)valor;
else if(clave=="RPM_DISPLAY") rpm_display=(int)valor;
else if(clave=="DIFF_RPM") diff_rpm=(int)valor;
else if(clave=="RECEPCION_DATOS") recepcion_datos=(int)valor;
else if(clave=="VBATT_TOO_HIGH") vbatt_too_high=valor;
else if(clave=="VBATT_HIGH") vbatt_high=valor;
else if(clave=="VBATT_LOW") vbatt_low=valor;
else if(clave=="WATER_HOT") water_hot=(int)valor;
else if(clave=="WATER_MILD") water_mild=(int)valor;
else if(clave=="WATER_COLD") water_cold=(int)valor;
else if(clave=="OIL_HOT") oil_hot=(int)valor;
else if(clave=="OIL_MILD") oil_mild=(int)valor;
else if(clave=="OIL_COLD") oil_cold=(int)valor;
else if(clave=="OIL_PRESSURE_TOO_HIGH") oil_pressure_too_high=valor;
else if(clave=="OIL_PRESSURE_HIGH") oil_pressure_high=valor;
else if(clave=="OIL_PRESSURE_LOW") oil_pressure_low=valor;
else if(clave=="FUEL_PRESSURE_TOO_HIGH") fuel_pressure_too_high=valor;
else if(clave=="FUEL_PRESSURE_HIGH") fuel_pressure_high=valor;
else if(clave=="FUEL_PRESSURE_LOW") fuel_pressure_low=valor;
cantidad++;
}
if(recepcion_datos<0 || recepcion_datos>1){
recepcion_datos=0;
}
archivo.close();
}
void data::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
){
rpm_max=rpm_maxn;
desplazamiento=desplazamienton;
modo_oscuro=modo_oscuron;
pantalla=pantallan;
rpm_display=rpm_displayn;
diff_rpm=diff_rpmn;
recepcion_datos=recepcion_datosn;
vbatt_too_high=vbatt_too_highn;
vbatt_high=vbatt_highn;
vbatt_low=vbatt_lown;
water_hot=water_hotn;
water_mild=water_mildn;
water_cold=water_coldn;
oil_hot=oil_hotn;
oil_mild=oil_mildn;
oil_cold=oil_coldn;
oil_pressure_too_high=oil_pressure_too_highn;
oil_pressure_high=oil_pressure_highn;
oil_pressure_low=oil_pressure_lown;
fuel_pressure_too_high=fuel_pressure_too_highn;
fuel_pressure_high=fuel_pressure_highn;
fuel_pressure_low=fuel_pressure_lown;
}
int data::get_rpm(){
return rpm_max;
}
int data::get_desplazamiento(){
return desplazamiento;
}
bool data::get_modo_oscuro(){
return modo_oscuro;
}
int data::get_pantalla(){
return pantalla;
}
int data::get_rpm_display(){
return rpm_display;
}
int data::get_diff_rpm(){
return diff_rpm;
}
float data::get_vbatt_too_high(){
return vbatt_too_high;
}
float data::get_vbatt_high(){
return vbatt_high;
}
float data::get_vbatt_low(){
return vbatt_low;
}
int data::get_water_hot(){
return water_hot;
}
int data::get_water_mild(){
return water_mild;
}
int data::get_water_cold(){
return water_cold;
}
int data::get_oil_hot(){
return oil_hot;
}
int data::get_oil_mild(){
return oil_mild;
}
int data::get_oil_cold(){
return oil_cold;
}
float data::get_oil_pressure_too_high(){
return oil_pressure_too_high;
}
float data::get_oil_pressure_high(){
return oil_pressure_high;
}
float data::get_oil_pressure_low(){
return oil_pressure_low;
}
float data::get_fuel_pressure_too_high(){
return fuel_pressure_too_high;
}
float data::get_fuel_pressure_high(){
return fuel_pressure_high;
}
float data::get_fuel_pressure_low(){
return fuel_pressure_low;
}
int data::get_recepcion_datos(){
return recepcion_datos;
}

View file

@ -0,0 +1,99 @@
/**
* @file led_strip.cpp
* @author Raúl Arcos Herrera
* @brief This file contains the implementation of the LED Strip class for Link G4+ ECU.
*/
#include "../include/led_strip.hpp"
void LedStrip::display_rpm(int rpm){
if(!launch){
if (rpm >= RPM_MAX) {
uint32_t ahora=millis();
if(ahora-last_parpadeo>T_PARPADEO){
last_parpadeo=ahora;
estado_parpadeo=!estado_parpadeo;
}
if(estado_parpadeo){
for (int i = 0; i < NUM_PIXELS; i++) {
_ws2812b.setPixelColor(i, _ws2812b.Color(255, 0, 0));
}
_ws2812b.show();
} else {
_ws2812b.clear();
_ws2812b.show();
}
} else {
int numLeds = map(rpm, RPM_MIN, RPM_MAX, 0, NUM_PIXELS);
int sector1=NUM_PIXELS/3;
int sector2=2*sector1;
for (int i = 0; i < NUM_PIXELS; i++) {
if (i < numLeds) {
if (i <sector1) {
_ws2812b.setPixelColor(i, _ws2812b.Color(0, 255, 0));
} else if (i < sector2) {
_ws2812b.setPixelColor(i, _ws2812b.Color(255, 255, 0));
} else {
_ws2812b.setPixelColor(i, _ws2812b.Color(255, 0, 0));
}
} else {
_ws2812b.setPixelColor(i, 0);
}
}
_ws2812b.show();
}
}
}
void LedStrip::display_startup(){
_ws2812b.setBrightness(255);
uint32_t colors[3] = { _ws2812b.Color(255, 0, 0), _ws2812b.Color(0, 255, 0), _ws2812b.Color(0, 0, 255) };
for (int pass = 0; pass < 3; pass++) {
for (int i = 0; i <= NUM_PIXELS - 4; i++) {
_ws2812b.clear();
_ws2812b.show();
for (int j = 0; j < 4; j++) {
_ws2812b.setPixelColor(i + j, colors[pass]);
}
_ws2812b.show();
vTaskDelay(pdMS_TO_TICKS(10));
}
for (int i = NUM_PIXELS - 4; i >= 0; i--) {
_ws2812b.clear();
_ws2812b.show();
for (int j = 0; j < 4; j++) {
_ws2812b.setPixelColor(i + j, colors[pass]);
}
_ws2812b.show();
vTaskDelay(pdMS_TO_TICKS(10));
}
}
_ws2812b.clear();
_ws2812b.show();
}
void LedStrip::launch_control(bool estado){
if (launch==estado) return;
launch=estado;
if(launch){
for(int i=0;i<NUM_PIXELS;i++){
_ws2812b.setPixelColor(i, _ws2812b.Color(255, 255, 0));
}
_ws2812b.show();
} else {
_ws2812b.clear();
_ws2812b.show();
}
}

View file

@ -0,0 +1,82 @@
// #include "../include/led_strip.hpp"
// void LedStrip::display_warning(int warning){
// if(warning == STOP_CAR_WARNING){
// for(int i = 0; i < NUM_PIXELS; i++){
// _leds[i] = CRGB::Red;
// }
// FastLED.show();
// }
// }
// void LedStrip::set_rpm(int rpm){
// if (xSemaphoreTake(_mutex, portMAX_DELAY) == pdTRUE) {
// display_rpm(rpm);
// xSemaphoreGive(_mutex);
// }
// }
// void LedStrip::display_rpm(int rpm){
// if (rpm > RPM_MAX) {
// for (int i = 0; i < NUM_PIXELS; i++) {
// _leds[i] = CRGB::Red;
// }
// FastLED.show();
// delay(50);
// for (int i = 0; i < NUM_PIXELS; i++) {
// _leds[i] = CRGB::Black;
// }
// FastLED.show();
// delay(50);
// } else {
// int numLeds = map(rpm, RPM_MIN, RPM_MAX, 0, NUM_PIXELS);
// for (int i = 0; i < NUM_PIXELS; i++) {
// if (i < numLeds) {
// if (i < NUM_PIXELS / 3) {
// _leds[i] = CRGB::Green;
// } else if (i < 2 * NUM_PIXELS / 3) {
// _leds[i] = CRGB::Yellow;
// } else {
// _leds[i] = CRGB::Red;
// }
// } else {
// _leds[i] = CRGB::Black;
// }
// }
// FastLED.show();
// }
// }
// void LedStrip::display_startup(){
// FastLED.setBrightness(255);
// CRGB colors[3] = { CRGB::Red, CRGB::Green, CRGB::Blue };
// for (int pass = 0; pass < 3; pass++) {
// for (int i = 0; i <= NUM_PIXELS - 4; i++) {
// fill_solid(_leds, NUM_PIXELS, CRGB::Black);
// FastLED.show();
// for (int j = 0; j < 4; j++) {
// _leds[i + j] = colors[pass];
// }
// FastLED.show();
// delay(10);
// }
// for (int i = NUM_PIXELS - 4; i >= 0; i--) {
// fill_solid(_leds, NUM_PIXELS, CRGB::Black);
// FastLED.show();
// for (int j = 0; j < 4; j++) {
// _leds[i + j] = colors[pass];
// }
// FastLED.show();
// delay(10);
// }
// }
// fill_solid(_leds, NUM_PIXELS, CRGB::Black);
// FastLED.show();
// }
// void LedStrip::update(){
// display_rpm(_rpm);
// }

View file

@ -0,0 +1,23 @@
[LocalizedFileNames]
ui_img_logo_volante_png.c=@ui_img_logo_volante_png.c,0
ui_events.cpp=@ui_events.cpp,0
ui_helpers.c=@ui_helpers.c,0
ui_comp_hook.c=@ui_comp_hook.c,0
ui.c=@ui.c,0
ui_font_warmup.c=@ui_font_warmup.c,0
ui_font_speedlabel.c=@ui_font_speedlabel.c,0
ui_font_speed.c=@ui_font_speed.c,0
ui_font_rpm.c=@ui_font_rpm.c,0
ui_themes.cpp=@ui_themes.cpp,0
ui_Screen2.c=@ui_Screen2.c,0
ui_settingscreen.c=@ui_settingscreen.c,0
ui_Screen1.c=@ui_Screen1.c,0
ui_bootscreen.c=@ui_bootscreen.c,0
ui_theme_manager.cpp=@ui_theme_manager.cpp,0
ui_font_offon.c=@ui_font_offon.c,0
ui_font_neutral.c=@ui_font_neutral.c,0
ui_font_labelt.c=@ui_font_labelt.c,0
ui_font_labeld2.c=@ui_font_labeld2.c,0
ui_font_labeld.c=@ui_font_labeld.c,0
ui_font_ajustesnames.c=@ui_font_ajustesnames.c,0
ui_font_ajustes.c=@ui_font_ajustes.c,0

50
Pantalla/src/ui/ui.c Normal file
View file

@ -0,0 +1,50 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3
#include "../../include/ui/ui.h"
#include "../../include/ui/ui_helpers.h"
///////////////////// VARIABLES ////////////////////
// EVENTS
lv_obj_t * ui____initial_actions0;
// IMAGES AND IMAGE SETS
///////////////////// TEST LVGL SETTINGS ////////////////////
#if LV_COLOR_DEPTH != 16
#error "LV_COLOR_DEPTH should be 16bit to match SquareLine Studio's settings"
#endif
#if LV_COLOR_16_SWAP !=0
#error "LV_COLOR_16_SWAP should be 0 to match SquareLine Studio's settings"
#endif
///////////////////// ANIMATIONS ////////////////////
///////////////////// FUNCTIONS ////////////////////
///////////////////// SCREENS ////////////////////
void ui_init(void)
{
lv_disp_t * dispp = lv_disp_get_default();
lv_theme_t * theme = lv_theme_default_init(dispp, lv_palette_main(LV_PALETTE_BLUE), lv_palette_main(LV_PALETTE_RED),
false, LV_FONT_DEFAULT);
lv_disp_set_theme(dispp, theme);
ui_bootscreen_screen_init();
ui_Screen1_screen_init();
ui_settingscreen_screen_init();
ui_Screen2_screen_init();
ui____initial_actions0 = lv_obj_create(NULL);
lv_disp_load_scr(ui_bootscreen);
}
void ui_destroy(void)
{
ui_bootscreen_screen_destroy();
ui_Screen1_screen_destroy();
ui_settingscreen_screen_destroy();
ui_Screen2_screen_destroy();
}

1535
Pantalla/src/ui/ui_Screen1.c Normal file

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,932 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3
#include "../../include/ui/ui.h"
lv_obj_t * ui_Screen2 = NULL;
lv_obj_t * ui_aux1panel = NULL;
lv_obj_t * ui_aux1name = NULL;
lv_obj_t * ui_aux1 = NULL;
lv_obj_t * ui_aux1separator = NULL;
lv_obj_t * ui_aux3panel = NULL;
lv_obj_t * ui_aux3name = NULL;
lv_obj_t * ui_aux3 = NULL;
lv_obj_t * ui_aux3separator = NULL;
lv_obj_t * ui_aux4panel = NULL;
lv_obj_t * ui_aux4name = NULL;
lv_obj_t * ui_aux4 = NULL;
lv_obj_t * ui_aux4separator = NULL;
lv_obj_t * ui_aux5panel = NULL;
lv_obj_t * ui_aux5name = NULL;
lv_obj_t * ui_aux5 = NULL;
lv_obj_t * ui_aux5separator = NULL;
lv_obj_t * ui_aux6panel = NULL;
lv_obj_t * ui_aux6name = NULL;
lv_obj_t * ui_aux6 = NULL;
lv_obj_t * ui_aux6separator = NULL;
lv_obj_t * ui_aux7panel = NULL;
lv_obj_t * ui_aux7name = NULL;
lv_obj_t * ui_aux7 = NULL;
lv_obj_t * ui_aux7separator = NULL;
lv_obj_t * ui_aux8panel = NULL;
lv_obj_t * ui_aux8name = NULL;
lv_obj_t * ui_aux8 = NULL;
lv_obj_t * ui_aux8separator = NULL;
lv_obj_t * ui_dig1panel = NULL;
lv_obj_t * ui_dig1name = NULL;
lv_obj_t * ui_dig1 = NULL;
lv_obj_t * ui_dig1separator = NULL;
lv_obj_t * ui_throttlepanel = NULL;
lv_obj_t * ui_throttlename = NULL;
lv_obj_t * ui_throttle = NULL;
lv_obj_t * ui_throttleseparator = NULL;
lv_obj_t * ui_nousepanel = NULL;
lv_obj_t * ui_nousename = NULL;
lv_obj_t * ui_nouse = NULL;
lv_obj_t * ui_nouseseparator = NULL;
lv_obj_t * ui_lambdtrgapanel = NULL;
lv_obj_t * ui_lambdatrgname = NULL;
lv_obj_t * ui_lambdatrg = NULL;
lv_obj_t * ui_lambdatrgseparator = NULL;
lv_obj_t * ui_mappanel = NULL;
lv_obj_t * ui_mapname = NULL;
lv_obj_t * ui_map = NULL;
lv_obj_t * ui_mapseparator = NULL;
lv_obj_t * ui_brakepanel = NULL;
lv_obj_t * ui_brakename = NULL;
lv_obj_t * ui_brake = NULL;
lv_obj_t * ui_brakeseparator = NULL;
lv_obj_t * ui_botonshowajustes2 = NULL;
lv_obj_t * ui_ajustesboton2 = NULL;
lv_obj_t * ui_ajustesnombre2 = NULL;
// event funtions
void ui_event_botonshowajustes2(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
if(event_code == LV_EVENT_LONG_PRESSED) {
_ui_flag_modify(ui_ajustesboton2, LV_OBJ_FLAG_HIDDEN, _UI_MODIFY_FLAG_REMOVE);
}
}
void ui_event_ajustesboton2(lv_event_t * e)
{
lv_event_code_t event_code = lv_event_get_code(e);
if(event_code == LV_EVENT_CLICKED) {
_ui_screen_change(&ui_settingscreen, LV_SCR_LOAD_ANIM_NONE, 0, 0, &ui_settingscreen_screen_init);
_ui_flag_modify(ui_ajustesboton2, LV_OBJ_FLAG_HIDDEN, _UI_MODIFY_FLAG_ADD);
abrirajustes(e);
}
}
// build funtions
void ui_Screen2_screen_init(void)
{
ui_Screen2 = lv_obj_create(NULL);
lv_obj_clear_flag(ui_Screen2, LV_OBJ_FLAG_SCROLLABLE); /// Flags
ui_object_set_themeable_style_property(ui_Screen2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_Screen2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_aux1panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux1panel, 125);
lv_obj_set_height(ui_aux1panel, 100);
lv_obj_set_x(ui_aux1panel, 160);
lv_obj_set_y(ui_aux1panel, -144);
lv_obj_set_align(ui_aux1panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux1panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux1panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux1panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux1panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux1panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux1panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux1name = lv_label_create(ui_aux1panel);
lv_obj_set_width(ui_aux1name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux1name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux1name, 0);
lv_obj_set_y(ui_aux1name, -30);
lv_obj_set_align(ui_aux1name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux1name, "AUX 1");
ui_object_set_themeable_style_property(ui_aux1name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux1name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux1name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux1 = lv_label_create(ui_aux1panel);
lv_obj_set_width(ui_aux1, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux1, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux1, 0);
lv_obj_set_y(ui_aux1, 17);
lv_obj_set_align(ui_aux1, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux1, "OFF");
ui_object_set_themeable_style_property(ui_aux1, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux1, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux1, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux1separator = lv_obj_create(ui_aux1panel);
lv_obj_set_width(ui_aux1separator, 70);
lv_obj_set_height(ui_aux1separator, 1);
lv_obj_set_x(ui_aux1separator, 0);
lv_obj_set_y(ui_aux1separator, -14);
lv_obj_set_align(ui_aux1separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux1separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux1separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux1separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux1separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux1separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux1separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux3panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux3panel, 125);
lv_obj_set_height(ui_aux3panel, 100);
lv_obj_set_x(ui_aux3panel, 283);
lv_obj_set_y(ui_aux3panel, -144);
lv_obj_set_align(ui_aux3panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux3panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux3panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux3panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux3panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux3panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux3panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux3name = lv_label_create(ui_aux3panel);
lv_obj_set_width(ui_aux3name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux3name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux3name, 0);
lv_obj_set_y(ui_aux3name, -30);
lv_obj_set_align(ui_aux3name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux3name, "AUX 3");
ui_object_set_themeable_style_property(ui_aux3name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux3name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux3name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux3 = lv_label_create(ui_aux3panel);
lv_obj_set_width(ui_aux3, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux3, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux3, 0);
lv_obj_set_y(ui_aux3, 17);
lv_obj_set_align(ui_aux3, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux3, "OFF");
ui_object_set_themeable_style_property(ui_aux3, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux3, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux3, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux3separator = lv_obj_create(ui_aux3panel);
lv_obj_set_width(ui_aux3separator, 70);
lv_obj_set_height(ui_aux3separator, 1);
lv_obj_set_x(ui_aux3separator, 0);
lv_obj_set_y(ui_aux3separator, -14);
lv_obj_set_align(ui_aux3separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux3separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux3separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux3separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux3separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux3separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux3separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux4panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux4panel, 125);
lv_obj_set_height(ui_aux4panel, 100);
lv_obj_set_x(ui_aux4panel, 160);
lv_obj_set_y(ui_aux4panel, -46);
lv_obj_set_align(ui_aux4panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux4panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux4panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux4panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux4panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux4panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux4panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux4name = lv_label_create(ui_aux4panel);
lv_obj_set_width(ui_aux4name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux4name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux4name, 0);
lv_obj_set_y(ui_aux4name, -30);
lv_obj_set_align(ui_aux4name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux4name, "AUX 4");
ui_object_set_themeable_style_property(ui_aux4name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux4name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux4name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux4 = lv_label_create(ui_aux4panel);
lv_obj_set_width(ui_aux4, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux4, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux4, 0);
lv_obj_set_y(ui_aux4, 17);
lv_obj_set_align(ui_aux4, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux4, "OFF");
ui_object_set_themeable_style_property(ui_aux4, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux4, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux4, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux4separator = lv_obj_create(ui_aux4panel);
lv_obj_set_width(ui_aux4separator, 70);
lv_obj_set_height(ui_aux4separator, 1);
lv_obj_set_x(ui_aux4separator, 0);
lv_obj_set_y(ui_aux4separator, -14);
lv_obj_set_align(ui_aux4separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux4separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux4separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux4separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux4separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux4separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux4separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux5panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux5panel, 125);
lv_obj_set_height(ui_aux5panel, 100);
lv_obj_set_x(ui_aux5panel, 283);
lv_obj_set_y(ui_aux5panel, -46);
lv_obj_set_align(ui_aux5panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux5panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux5panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux5panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux5panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux5panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux5panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux5name = lv_label_create(ui_aux5panel);
lv_obj_set_width(ui_aux5name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux5name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux5name, 0);
lv_obj_set_y(ui_aux5name, -30);
lv_obj_set_align(ui_aux5name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux5name, "AUX 5");
ui_object_set_themeable_style_property(ui_aux5name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux5name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux5name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux5 = lv_label_create(ui_aux5panel);
lv_obj_set_width(ui_aux5, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux5, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux5, 0);
lv_obj_set_y(ui_aux5, 17);
lv_obj_set_align(ui_aux5, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux5, "OFF");
ui_object_set_themeable_style_property(ui_aux5, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux5, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux5, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux5separator = lv_obj_create(ui_aux5panel);
lv_obj_set_width(ui_aux5separator, 70);
lv_obj_set_height(ui_aux5separator, 1);
lv_obj_set_x(ui_aux5separator, 0);
lv_obj_set_y(ui_aux5separator, -14);
lv_obj_set_align(ui_aux5separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux5separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux5separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux5separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux5separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux5separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux5separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux6panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux6panel, 125);
lv_obj_set_height(ui_aux6panel, 100);
lv_obj_set_x(ui_aux6panel, 160);
lv_obj_set_y(ui_aux6panel, 51);
lv_obj_set_align(ui_aux6panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux6panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux6panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux6panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux6panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux6panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux6panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux6name = lv_label_create(ui_aux6panel);
lv_obj_set_width(ui_aux6name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux6name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux6name, 0);
lv_obj_set_y(ui_aux6name, -30);
lv_obj_set_align(ui_aux6name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux6name, "AUX 6");
ui_object_set_themeable_style_property(ui_aux6name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux6name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux6name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux6 = lv_label_create(ui_aux6panel);
lv_obj_set_width(ui_aux6, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux6, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux6, 0);
lv_obj_set_y(ui_aux6, 17);
lv_obj_set_align(ui_aux6, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux6, "OFF");
ui_object_set_themeable_style_property(ui_aux6, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux6, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux6, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux6separator = lv_obj_create(ui_aux6panel);
lv_obj_set_width(ui_aux6separator, 70);
lv_obj_set_height(ui_aux6separator, 1);
lv_obj_set_x(ui_aux6separator, 0);
lv_obj_set_y(ui_aux6separator, -14);
lv_obj_set_align(ui_aux6separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux6separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux6separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux6separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux6separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux6separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux6separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux7panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux7panel, 125);
lv_obj_set_height(ui_aux7panel, 100);
lv_obj_set_x(ui_aux7panel, 283);
lv_obj_set_y(ui_aux7panel, 51);
lv_obj_set_align(ui_aux7panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux7panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux7panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux7panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux7panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux7panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux7panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux7name = lv_label_create(ui_aux7panel);
lv_obj_set_width(ui_aux7name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux7name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux7name, 0);
lv_obj_set_y(ui_aux7name, -30);
lv_obj_set_align(ui_aux7name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux7name, "AUX 7");
ui_object_set_themeable_style_property(ui_aux7name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux7name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux7name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux7 = lv_label_create(ui_aux7panel);
lv_obj_set_width(ui_aux7, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux7, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux7, 0);
lv_obj_set_y(ui_aux7, 17);
lv_obj_set_align(ui_aux7, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux7, "OFF");
ui_object_set_themeable_style_property(ui_aux7, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux7, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux7, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux7separator = lv_obj_create(ui_aux7panel);
lv_obj_set_width(ui_aux7separator, 70);
lv_obj_set_height(ui_aux7separator, 1);
lv_obj_set_x(ui_aux7separator, 0);
lv_obj_set_y(ui_aux7separator, -14);
lv_obj_set_align(ui_aux7separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux7separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux7separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux7separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux7separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux7separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux7separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux8panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_aux8panel, 125);
lv_obj_set_height(ui_aux8panel, 100);
lv_obj_set_x(ui_aux8panel, 160);
lv_obj_set_y(ui_aux8panel, 149);
lv_obj_set_align(ui_aux8panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux8panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux8panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux8panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux8panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux8panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux8panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_aux8name = lv_label_create(ui_aux8panel);
lv_obj_set_width(ui_aux8name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux8name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux8name, 0);
lv_obj_set_y(ui_aux8name, -30);
lv_obj_set_align(ui_aux8name, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux8name, "AUX 8");
ui_object_set_themeable_style_property(ui_aux8name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux8name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux8name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux8 = lv_label_create(ui_aux8panel);
lv_obj_set_width(ui_aux8, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_aux8, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_aux8, 0);
lv_obj_set_y(ui_aux8, 17);
lv_obj_set_align(ui_aux8, LV_ALIGN_CENTER);
lv_label_set_text(ui_aux8, "OFF");
ui_object_set_themeable_style_property(ui_aux8, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux8, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_aux8, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_aux8separator = lv_obj_create(ui_aux8panel);
lv_obj_set_width(ui_aux8separator, 70);
lv_obj_set_height(ui_aux8separator, 1);
lv_obj_set_x(ui_aux8separator, 0);
lv_obj_set_y(ui_aux8separator, -14);
lv_obj_set_align(ui_aux8separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_aux8separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_aux8separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_aux8separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_aux8separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_aux8separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_aux8separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_dig1panel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_dig1panel, 125);
lv_obj_set_height(ui_dig1panel, 100);
lv_obj_set_x(ui_dig1panel, 283);
lv_obj_set_y(ui_dig1panel, 149);
lv_obj_set_align(ui_dig1panel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_dig1panel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_dig1panel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_dig1panel, lv_color_hex(0x9E3D3D), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_dig1panel, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_dig1panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_dig1panel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_dig1name = lv_label_create(ui_dig1panel);
lv_obj_set_width(ui_dig1name, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_dig1name, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_dig1name, 0);
lv_obj_set_y(ui_dig1name, -30);
lv_obj_set_align(ui_dig1name, LV_ALIGN_CENTER);
lv_label_set_text(ui_dig1name, "DIG 1");
ui_object_set_themeable_style_property(ui_dig1name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_dig1name, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_dig1name, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_dig1 = lv_label_create(ui_dig1panel);
lv_obj_set_width(ui_dig1, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_dig1, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_dig1, 0);
lv_obj_set_y(ui_dig1, 17);
lv_obj_set_align(ui_dig1, LV_ALIGN_CENTER);
lv_label_set_text(ui_dig1, "OFF");
ui_object_set_themeable_style_property(ui_dig1, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_dig1, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_dig1, &ui_font_offon, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_dig1separator = lv_obj_create(ui_dig1panel);
lv_obj_set_width(ui_dig1separator, 70);
lv_obj_set_height(ui_dig1separator, 1);
lv_obj_set_x(ui_dig1separator, 0);
lv_obj_set_y(ui_dig1separator, -14);
lv_obj_set_align(ui_dig1separator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_dig1separator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_dig1separator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_color(ui_dig1separator, lv_color_hex(0x232323), LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_bg_opa(ui_dig1separator, 255, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_dig1separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_dig1separator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_throttlepanel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_throttlepanel, 250);
lv_obj_set_height(ui_throttlepanel, 100);
lv_obj_set_x(ui_throttlepanel, -240);
lv_obj_set_y(ui_throttlepanel, -144);
lv_obj_set_align(ui_throttlepanel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_throttlepanel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_throttlepanel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_throttlepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_throttlepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_throttlepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_throttlepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_throttlename = lv_label_create(ui_throttlepanel);
lv_obj_set_width(ui_throttlename, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_throttlename, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_throttlename, 0);
lv_obj_set_y(ui_throttlename, -32);
lv_obj_set_align(ui_throttlename, LV_ALIGN_CENTER);
lv_label_set_text(ui_throttlename, "THROTTLE");
ui_object_set_themeable_style_property(ui_throttlename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_throttlename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_throttlename, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_throttle = lv_label_create(ui_throttlepanel);
lv_obj_set_width(ui_throttle, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_throttle, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_throttle, 0);
lv_obj_set_y(ui_throttle, 17);
lv_obj_set_align(ui_throttle, LV_ALIGN_CENTER);
lv_label_set_text(ui_throttle, "-");
ui_object_set_themeable_style_property(ui_throttle, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_throttle, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_throttle, &ui_font_labeld2, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_throttleseparator = lv_obj_create(ui_throttlepanel);
lv_obj_set_width(ui_throttleseparator, 120);
lv_obj_set_height(ui_throttleseparator, 1);
lv_obj_set_x(ui_throttleseparator, 2);
lv_obj_set_y(ui_throttleseparator, -18);
lv_obj_set_align(ui_throttleseparator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_throttleseparator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_throttleseparator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_throttleseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_throttleseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_nousepanel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_nousepanel, 250);
lv_obj_set_height(ui_nousepanel, 100);
lv_obj_set_x(ui_nousepanel, -240);
lv_obj_set_y(ui_nousepanel, -46);
lv_obj_set_align(ui_nousepanel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_nousepanel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_nousepanel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_nousepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_nousepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_nousepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_nousepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_nousename = lv_label_create(ui_nousepanel);
lv_obj_set_width(ui_nousename, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_nousename, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_nousename, 0);
lv_obj_set_y(ui_nousename, -32);
lv_obj_set_align(ui_nousename, LV_ALIGN_CENTER);
lv_label_set_text(ui_nousename, "-");
ui_object_set_themeable_style_property(ui_nousename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_nousename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_nousename, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_nouse = lv_label_create(ui_nousepanel);
lv_obj_set_width(ui_nouse, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_nouse, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_nouse, 0);
lv_obj_set_y(ui_nouse, 17);
lv_obj_set_align(ui_nouse, LV_ALIGN_CENTER);
lv_label_set_text(ui_nouse, "-");
ui_object_set_themeable_style_property(ui_nouse, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_nouse, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_nouse, &ui_font_labeld2, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_nouseseparator = lv_obj_create(ui_nousepanel);
lv_obj_set_width(ui_nouseseparator, 120);
lv_obj_set_height(ui_nouseseparator, 1);
lv_obj_set_x(ui_nouseseparator, 2);
lv_obj_set_y(ui_nouseseparator, -18);
lv_obj_set_align(ui_nouseseparator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_nouseseparator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_nouseseparator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_nouseseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_nouseseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_lambdtrgapanel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_lambdtrgapanel, 250);
lv_obj_set_height(ui_lambdtrgapanel, 100);
lv_obj_set_x(ui_lambdtrgapanel, -240);
lv_obj_set_y(ui_lambdtrgapanel, 52);
lv_obj_set_align(ui_lambdtrgapanel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_lambdtrgapanel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_lambdtrgapanel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_lambdtrgapanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_lambdtrgapanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_lambdtrgapanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_lambdtrgapanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_lambdatrgname = lv_label_create(ui_lambdtrgapanel);
lv_obj_set_width(ui_lambdatrgname, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_lambdatrgname, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_lambdatrgname, 0);
lv_obj_set_y(ui_lambdatrgname, -32);
lv_obj_set_align(ui_lambdatrgname, LV_ALIGN_CENTER);
lv_label_set_text(ui_lambdatrgname, "LAMBDA TARGET");
ui_object_set_themeable_style_property(ui_lambdatrgname, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_lambdatrgname, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_lambdatrgname, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_lambdatrg = lv_label_create(ui_lambdtrgapanel);
lv_obj_set_width(ui_lambdatrg, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_lambdatrg, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_lambdatrg, 0);
lv_obj_set_y(ui_lambdatrg, 17);
lv_obj_set_align(ui_lambdatrg, LV_ALIGN_CENTER);
lv_label_set_text(ui_lambdatrg, "-");
ui_object_set_themeable_style_property(ui_lambdatrg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_lambdatrg, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_lambdatrg, &ui_font_labeld2, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_lambdatrgseparator = lv_obj_create(ui_lambdtrgapanel);
lv_obj_set_width(ui_lambdatrgseparator, 120);
lv_obj_set_height(ui_lambdatrgseparator, 1);
lv_obj_set_x(ui_lambdatrgseparator, 2);
lv_obj_set_y(ui_lambdatrgseparator, -18);
lv_obj_set_align(ui_lambdatrgseparator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_lambdatrgseparator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_lambdatrgseparator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_lambdatrgseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_lambdatrgseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_mappanel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_mappanel, 218);
lv_obj_set_height(ui_mappanel, 100);
lv_obj_set_x(ui_mappanel, -8);
lv_obj_set_y(ui_mappanel, -144);
lv_obj_set_align(ui_mappanel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_mappanel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_mappanel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_mappanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_mappanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_mappanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_mappanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_mapname = lv_label_create(ui_mappanel);
lv_obj_set_width(ui_mapname, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_mapname, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_mapname, 0);
lv_obj_set_y(ui_mapname, -32);
lv_obj_set_align(ui_mapname, LV_ALIGN_CENTER);
lv_label_set_text(ui_mapname, "MAP");
ui_object_set_themeable_style_property(ui_mapname, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_mapname, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_mapname, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_map = lv_label_create(ui_mappanel);
lv_obj_set_width(ui_map, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_map, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_map, 0);
lv_obj_set_y(ui_map, 17);
lv_obj_set_align(ui_map, LV_ALIGN_CENTER);
lv_label_set_text(ui_map, "-");
ui_object_set_themeable_style_property(ui_map, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_map, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_map, &ui_font_labeld2, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_mapseparator = lv_obj_create(ui_mappanel);
lv_obj_set_width(ui_mapseparator, 120);
lv_obj_set_height(ui_mapseparator, 1);
lv_obj_set_x(ui_mapseparator, 2);
lv_obj_set_y(ui_mapseparator, -18);
lv_obj_set_align(ui_mapseparator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_mapseparator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_mapseparator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_mapseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_mapseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_brakepanel = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_brakepanel, 250);
lv_obj_set_height(ui_brakepanel, 100);
lv_obj_set_x(ui_brakepanel, -240);
lv_obj_set_y(ui_brakepanel, 149);
lv_obj_set_align(ui_brakepanel, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_brakepanel, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_brakepanel, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_brakepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_brakepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_brakepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_brakepanel, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_brakename = lv_label_create(ui_brakepanel);
lv_obj_set_width(ui_brakename, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_brakename, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_brakename, 0);
lv_obj_set_y(ui_brakename, -32);
lv_obj_set_align(ui_brakename, LV_ALIGN_CENTER);
lv_label_set_text(ui_brakename, "BRAKE");
ui_object_set_themeable_style_property(ui_brakename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_brakename, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_brakename, &ui_font_labelt, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_brake = lv_label_create(ui_brakepanel);
lv_obj_set_width(ui_brake, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_brake, LV_SIZE_CONTENT); /// 1
lv_obj_set_x(ui_brake, 0);
lv_obj_set_y(ui_brake, 17);
lv_obj_set_align(ui_brake, LV_ALIGN_CENTER);
lv_label_set_text(ui_brake, "-");
ui_object_set_themeable_style_property(ui_brake, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_brake, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_brake, &ui_font_labeld2, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_brakeseparator = lv_obj_create(ui_brakepanel);
lv_obj_set_width(ui_brakeseparator, 120);
lv_obj_set_height(ui_brakeseparator, 1);
lv_obj_set_x(ui_brakeseparator, 2);
lv_obj_set_y(ui_brakeseparator, -18);
lv_obj_set_align(ui_brakeseparator, LV_ALIGN_CENTER);
lv_obj_clear_flag(ui_brakeseparator, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_brakeseparator, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_brakeseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_brakeseparator, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
ui_botonshowajustes2 = lv_btn_create(ui_Screen2);
lv_obj_set_width(ui_botonshowajustes2, 800);
lv_obj_set_height(ui_botonshowajustes2, 480);
lv_obj_set_x(ui_botonshowajustes2, 1);
lv_obj_set_y(ui_botonshowajustes2, 0);
lv_obj_set_align(ui_botonshowajustes2, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_botonshowajustes2, LV_OBJ_FLAG_SCROLL_ON_FOCUS); /// Flags
lv_obj_clear_flag(ui_botonshowajustes2, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_botonshowajustes2, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_set_style_opa(ui_botonshowajustes2, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_ajustesboton2 = lv_obj_create(ui_Screen2);
lv_obj_set_width(ui_ajustesboton2, 150);
lv_obj_set_height(ui_ajustesboton2, 70);
lv_obj_set_x(ui_ajustesboton2, 303);
lv_obj_set_y(ui_ajustesboton2, -190);
lv_obj_set_align(ui_ajustesboton2, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_ajustesboton2, LV_OBJ_FLAG_HIDDEN); /// Flags
lv_obj_clear_flag(ui_ajustesboton2, LV_OBJ_FLAG_SCROLLABLE); /// Flags
lv_obj_set_style_radius(ui_ajustesboton2, 0, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_object_set_themeable_style_property(ui_ajustesboton2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_ajustesboton2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_object_set_themeable_style_property(ui_ajustesboton2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_ajustesboton2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BORDER_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_border_width(ui_ajustesboton2, 4, LV_PART_MAIN | LV_STATE_DEFAULT);
ui_ajustesnombre2 = lv_label_create(ui_ajustesboton2);
lv_obj_set_width(ui_ajustesnombre2, LV_SIZE_CONTENT); /// 1
lv_obj_set_height(ui_ajustesnombre2, LV_SIZE_CONTENT); /// 1
lv_obj_set_align(ui_ajustesnombre2, LV_ALIGN_CENTER);
lv_label_set_text(ui_ajustesnombre2, "Ajustes");
ui_object_set_themeable_style_property(ui_ajustesnombre2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_COLOR,
_ui_theme_color_texto);
ui_object_set_themeable_style_property(ui_ajustesnombre2, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_TEXT_OPA,
_ui_theme_alpha_texto);
lv_obj_set_style_text_font(ui_ajustesnombre2, &ui_font_ajustesnames, LV_PART_MAIN | LV_STATE_DEFAULT);
lv_obj_add_event_cb(ui_botonshowajustes2, ui_event_botonshowajustes2, LV_EVENT_ALL, NULL);
lv_obj_add_event_cb(ui_ajustesboton2, ui_event_ajustesboton2, LV_EVENT_ALL, NULL);
}
void ui_Screen2_screen_destroy(void)
{
if(ui_Screen2) lv_obj_del(ui_Screen2);
// NULL screen variables
ui_Screen2 = NULL;
ui_aux1panel = NULL;
ui_aux1name = NULL;
ui_aux1 = NULL;
ui_aux1separator = NULL;
ui_aux3panel = NULL;
ui_aux3name = NULL;
ui_aux3 = NULL;
ui_aux3separator = NULL;
ui_aux4panel = NULL;
ui_aux4name = NULL;
ui_aux4 = NULL;
ui_aux4separator = NULL;
ui_aux5panel = NULL;
ui_aux5name = NULL;
ui_aux5 = NULL;
ui_aux5separator = NULL;
ui_aux6panel = NULL;
ui_aux6name = NULL;
ui_aux6 = NULL;
ui_aux6separator = NULL;
ui_aux7panel = NULL;
ui_aux7name = NULL;
ui_aux7 = NULL;
ui_aux7separator = NULL;
ui_aux8panel = NULL;
ui_aux8name = NULL;
ui_aux8 = NULL;
ui_aux8separator = NULL;
ui_dig1panel = NULL;
ui_dig1name = NULL;
ui_dig1 = NULL;
ui_dig1separator = NULL;
ui_throttlepanel = NULL;
ui_throttlename = NULL;
ui_throttle = NULL;
ui_throttleseparator = NULL;
ui_nousepanel = NULL;
ui_nousename = NULL;
ui_nouse = NULL;
ui_nouseseparator = NULL;
ui_lambdtrgapanel = NULL;
ui_lambdatrgname = NULL;
ui_lambdatrg = NULL;
ui_lambdatrgseparator = NULL;
ui_mappanel = NULL;
ui_mapname = NULL;
ui_map = NULL;
ui_mapseparator = NULL;
ui_brakepanel = NULL;
ui_brakename = NULL;
ui_brake = NULL;
ui_brakeseparator = NULL;
ui_botonshowajustes2 = NULL;
ui_ajustesboton2 = NULL;
ui_ajustesnombre2 = NULL;
}

View file

@ -0,0 +1,41 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3
#include "../../include/ui/ui.h"
lv_obj_t * ui_bootscreen = NULL;
lv_obj_t * ui_logoboot = NULL;
// event funtions
// build funtions
void ui_bootscreen_screen_init(void)
{
ui_bootscreen = lv_obj_create(NULL);
lv_obj_clear_flag(ui_bootscreen, LV_OBJ_FLAG_SCROLLABLE); /// Flags
ui_object_set_themeable_style_property(ui_bootscreen, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_COLOR,
_ui_theme_color_fondo);
ui_object_set_themeable_style_property(ui_bootscreen, LV_PART_MAIN | LV_STATE_DEFAULT, LV_STYLE_BG_OPA,
_ui_theme_alpha_fondo);
ui_logoboot = lv_img_create(ui_bootscreen);
lv_img_set_src(ui_logoboot, &ui_img_logo_volante_png);
lv_obj_set_width(ui_logoboot, LV_SIZE_CONTENT); /// 660
lv_obj_set_height(ui_logoboot, LV_SIZE_CONTENT); /// 161
lv_obj_set_align(ui_logoboot, LV_ALIGN_CENTER);
lv_obj_add_flag(ui_logoboot, LV_OBJ_FLAG_ADV_HITTEST); /// Flags
lv_obj_clear_flag(ui_logoboot, LV_OBJ_FLAG_SCROLLABLE); /// Flags
}
void ui_bootscreen_screen_destroy(void)
{
if(ui_bootscreen) lv_obj_del(ui_bootscreen);
// NULL screen variables
ui_bootscreen = NULL;
ui_logoboot = NULL;
}

View file

@ -0,0 +1,5 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3

View file

@ -0,0 +1,837 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26
#include "../../include/ui/ui.h"
#include "../../include/ajustes.hpp"
#include "../../include/crowpanel_controller.hpp"
#include "../../include/data_processor.hpp"
#include "../../include/can.hpp"
extern CAN canController;
static int rpm=8000;
static int desp=0;
static bool modo_oscuro=true;
static int pantalla=0;
static int rpm_display=0;
static int diff_rpm=1200;
static int recepcion_datos=0;
static float vbatt_too_high=15.0;
static float vbatt_high=14.5;
static float vbatt_low=12.5;
static int water_hot=110;
static int water_mild=100;
static int water_cold=70;
static int oil_hot=110;
static int oil_mild=100;
static int oil_cold=70;
static float oil_pressure_too_high=4.0;
static float oil_pressure_high=3.0;
static float oil_pressure_low=1.0;
static float fuel_pressure_too_high=15.0;
static float fuel_pressure_high=12.0;
static float fuel_pressure_low=3.0;
void refresh_ui_values();
void set(){
rpm=get_rpm();
desp=get_desplazamiento();
modo_oscuro=get_modo_oscuro();
pantalla=get_pantalla();
rpm_display=get_rpm_display();
diff_rpm=get_diff_rpm();
recepcion_datos=get_recepcion_datos();
vbatt_too_high=get_vbatt_too_high();
vbatt_high=get_vbatt_high();
vbatt_low=get_vbatt_low();
water_hot=get_water_hot();
water_mild=get_water_mild();
water_cold=get_water_cold();
oil_hot=get_oil_hot();
oil_mild=get_oil_mild();
oil_cold=get_oil_cold();
oil_pressure_too_high=get_oil_pressure_too_high();
oil_pressure_high=get_oil_pressure_high();
oil_pressure_low=get_oil_pressure_low();
fuel_pressure_too_high=get_fuel_pressure_too_high();
fuel_pressure_high=get_fuel_pressure_high();
fuel_pressure_low=get_fuel_pressure_low();
}
void update_all(){
update(
rpm,
desp,
modo_oscuro,
pantalla,
rpm_display,
diff_rpm,
recepcion_datos,
vbatt_too_high,
vbatt_high,
vbatt_low,
water_hot,
water_mild,
water_cold,
oil_hot,
oil_mild,
oil_cold,
oil_pressure_too_high,
oil_pressure_high,
oil_pressure_low,
fuel_pressure_too_high,
fuel_pressure_high,
fuel_pressure_low
);
}
void abrirajustes(lv_event_t * e)
{
set();
refresh_ui_values();
}
void cerrarajustes(lv_event_t * e)
{
set();
save();
DataProcessor::set_dataprocessor();
CrowPanelController::create_rpm_bar(((rpm/1000)*1000), desp);
lv_scr_load(ui_Screen1);
}
void opcionesdrop(lv_event_t * e)
{
lv_obj_t * obj=lv_event_get_target(e);
int opcion=lv_dropdown_get_selected(obj);
lv_obj_add_flag(ui_settingsmain, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsrpm, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsvbatt, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingswatert, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsoilt, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsoilp, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsfuelp, LV_OBJ_FLAG_HIDDEN);
switch(opcion){
case 0:
lv_obj_clear_flag(ui_settingsmain, LV_OBJ_FLAG_HIDDEN);
break;
case 1:
lv_obj_clear_flag(ui_settingsrpm, LV_OBJ_FLAG_HIDDEN);
break;
case 2:
lv_obj_clear_flag(ui_settingsvbatt, LV_OBJ_FLAG_HIDDEN);
break;
case 3:
lv_obj_clear_flag(ui_settingswatert, LV_OBJ_FLAG_HIDDEN);
break;
case 4:
lv_obj_clear_flag(ui_settingsoilt, LV_OBJ_FLAG_HIDDEN);
break;
case 5:
lv_obj_clear_flag(ui_settingsoilp, LV_OBJ_FLAG_HIDDEN);
break;
case 6:
lv_obj_clear_flag(ui_settingsfuelp, LV_OBJ_FLAG_HIDDEN);
break;
}
}
void themesitch(lv_event_t * e)
{
set();
lv_obj_t * obj=lv_event_get_target(e);
if(lv_obj_has_state(obj, LV_STATE_CHECKED)){
modo_oscuro=true;
ui_theme_set(1);
} else {
modo_oscuro=false;
ui_theme_set(2);
}
update_all();
}
void cambiarpantalla(lv_event_t * e)
{
set();
lv_obj_t * obj=lv_event_get_target(e);
pantalla=0;
if(lv_dropdown_get_selected(obj)==0){
lv_scr_load(ui_Screen1);
} else {
lv_scr_load(ui_Screen2);
}
update_all();
}
void cambiardatos(lv_event_t * e)
{
lv_obj_t * obj=lv_event_get_target(e);
recepcion_datos=lv_dropdown_get_selected(obj);
if(recepcion_datos==0){
canController.stop_iracing_task();
canController.clear_rx_queue();
canController.start_listening_task();
} else {
canController.stop_listening_task();
canController.start_iracing_task();
}
update_all();
save();
}
void lessrpm_(lv_event_t * e)
{
set();
if(rpm<=5000){
return;
} else {
rpm=modify_value(rpm, -50);
}
CrowPanelController::set_value_to_label(ui_rpmfinalvalue, rpm);
update_all();
}
void morerpm_(lv_event_t * e)
{
set();
if(rpm>=14000){
return;
} else {
rpm=modify_value(rpm, 50);
}
CrowPanelController::set_value_to_label(ui_rpmfinalvalue, rpm);
update_all();
}
void lessdesp(lv_event_t * e)
{
set();
if(desp<=-45){
return;
} else {
desp=modify_value(desp, -1);
}
CrowPanelController::set_value_to_label(ui_desplazamientovalue, desp);
update_all();
}
void moredesp(lv_event_t * e)
{
set();
if(desp>=15){
return;
} else {
desp=modify_value(desp, 1);
}
CrowPanelController::set_value_to_label(ui_desplazamientovalue, desp);
update_all();
}
void rpmdisplay(lv_event_t * e)
{
set();
lv_obj_t * obj=lv_event_get_target(e);
lv_obj_add_flag(ui_barcontainer, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_tiraledsrpmcontainer, LV_OBJ_FLAG_HIDDEN);
if(lv_dropdown_get_selected(obj)==0){
lv_obj_clear_flag(ui_barcontainer, LV_OBJ_FLAG_HIDDEN);
rpm_display=0; // Barra
} else if (lv_dropdown_get_selected(obj)==1) {
lv_obj_clear_flag(ui_tiraledsrpmcontainer, LV_OBJ_FLAG_HIDDEN);
rpm_display=1; // Leds
} else if (lv_dropdown_get_selected(obj)==2){
lv_obj_clear_flag(ui_barcontainer, LV_OBJ_FLAG_HIDDEN);
rpm_display=2; // Barra lineal
} else {
lv_obj_clear_flag(ui_tiraledsrpmcontainer, LV_OBJ_FLAG_HIDDEN);
rpm_display=3; // Leds lineal
}
update_all();
}
void lessdiffrpm(lv_event_t * e)
{
set();
if(diff_rpm<=0){
return;
} else {
diff_rpm=modify_value(diff_rpm, -100);
}
CrowPanelController::set_value_to_label(ui_diffrpmvalue, diff_rpm);
update_all();
}
void morediffrpm(lv_event_t * e)
{
set();
diff_rpm=modify_value(diff_rpm, 100);
CrowPanelController::set_value_to_label(ui_diffrpmvalue, diff_rpm);
update_all();
}
void lessvbatttoohigh(lv_event_t * e)
{
set();
float nuevo=modify_value(vbatt_too_high, -0.1f);
if(nuevo<=vbatt_high){
return;
} else {
vbatt_too_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_vbatttoohighvalue, vbatt_too_high);
update_all();
}
void morevbatttoohigh(lv_event_t * e)
{
set();
vbatt_too_high=modify_value(vbatt_too_high, 0.1f);
CrowPanelController::set_value_to_label(ui_vbatttoohighvalue, vbatt_too_high);
update_all();
}
void lessvbatthigh(lv_event_t * e)
{
set();
float nuevo=modify_value(vbatt_high, -0.1f);
if(nuevo<=vbatt_low){
return;
} else {
vbatt_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_vbatthighvalue, vbatt_high);
update_all();
}
void morebvbatthigh(lv_event_t * e)
{
set();
float nuevo=modify_value(vbatt_high, 0.1f);
if(nuevo>=vbatt_too_high){
return;
} else {
vbatt_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_vbatthighvalue, vbatt_high);
update_all();
}
void lessvbattlow(lv_event_t * e)
{
set();
if(vbatt_low<=0){
return;
} else {
vbatt_low=modify_value(vbatt_low, -0.1f);
}
CrowPanelController::set_value_to_label(ui_vbattlowvalue, vbatt_low);
update_all();
}
void morevbattlow(lv_event_t * e)
{
set();
float nuevo=modify_value(vbatt_low, 0.1f);
if(nuevo>=vbatt_high){
return;
} else {
vbatt_low=nuevo;
}
CrowPanelController::set_value_to_label(ui_vbattlowvalue, vbatt_low);
update_all();
}
void lesswaterhot(lv_event_t * e)
{
set();
int nuevo=modify_value(water_hot, -1);
if(nuevo<=water_mild){
return;
} else {
water_hot=nuevo;
}
CrowPanelController::set_value_to_label(ui_waterhotvalue, water_hot);
update_all();
}
void mroewaterhot(lv_event_t * e)
{
set();
water_hot=modify_value(water_hot, 1);
CrowPanelController::set_value_to_label(ui_waterhotvalue, water_hot);
update_all();
}
void lesswatermild(lv_event_t * e)
{
set();
int nuevo=modify_value(water_mild, -1);
if(nuevo<=water_cold){
return;
} else {
water_mild=nuevo;
}
CrowPanelController::set_value_to_label(ui_watermidvalue, water_mild);
update_all();
}
void morewatermild(lv_event_t * e)
{
set();
int nuevo=modify_value(water_mild, 1);
if(nuevo>=water_hot){
return;
} else {
water_mild=nuevo;
}
CrowPanelController::set_value_to_label(ui_watermidvalue, water_mild);
update_all();
}
void lesswatercold(lv_event_t * e)
{
set();
if(water_cold<=0){
return;
} else {
water_cold=modify_value(water_cold, -1);
}
CrowPanelController::set_value_to_label(ui_watercoldvalue, water_cold);
update_all();
}
void morewatercold(lv_event_t * e)
{
set();
int nuevo=modify_value(water_cold, 1);
if(nuevo>=water_mild){
return;
} else {
water_cold=nuevo;
}
CrowPanelController::set_value_to_label(ui_watercoldvalue, water_cold);
update_all();
}
void lessoilhot(lv_event_t * e)
{
set();
int nuevo=modify_value(oil_hot, -1);
if(nuevo<=oil_mild){
return;
} else {
oil_hot=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilhotvalue, oil_hot);
update_all();
}
void moreoilhot(lv_event_t * e)
{
set();
oil_hot=modify_value(oil_hot, 1);
CrowPanelController::set_value_to_label(ui_oilhotvalue, oil_hot);
update_all();
}
void lessoilmild(lv_event_t * e)
{
set();
int nuevo=modify_value(oil_mild, -1);
if(nuevo<=oil_cold){
return;
} else {
oil_mild=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilmildvalue, oil_mild);
update_all();
}
void moreoilmild(lv_event_t * e)
{
set();
int nuevo=modify_value(oil_mild, 1);
if(nuevo>=oil_hot){
return;
} else {
oil_mild=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilmildvalue, oil_mild);
update_all();
}
void lessoilcold(lv_event_t * e)
{
set();
if(oil_cold<=0){
return;
} else {
oil_cold=modify_value(oil_cold, -1);
}
CrowPanelController::set_value_to_label(ui_oilcoldvalue, oil_cold);
update_all();
}
void moreoilcold(lv_event_t * e)
{
set();
int nuevo=modify_value(oil_cold, 1);
if(nuevo>=oil_mild){
return;
} else {
oil_cold=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilcoldvalue, oil_cold);
update_all();
}
void lessoilptoohigh(lv_event_t * e)
{
set();
float nuevo=modify_value(oil_pressure_too_high, -0.1f);
if(nuevo<=oil_pressure_high){
return;
} else {
oil_pressure_too_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilptoohighvalue, oil_pressure_too_high);
update_all();
}
void moreoilptoohigh(lv_event_t * e)
{
set();
oil_pressure_too_high=modify_value(oil_pressure_too_high, 0.1f);
CrowPanelController::set_value_to_label(ui_oilptoohighvalue, oil_pressure_too_high);
update_all();
}
void lessoilphigh(lv_event_t * e)
{
set();
float nuevo=modify_value(oil_pressure_high, -0.1f);
if(nuevo<=oil_pressure_low){
return;
} else {
oil_pressure_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilphighvalue, oil_pressure_high);
update_all();
}
void moreoilphigh(lv_event_t * e)
{
set();
float nuevo=modify_value(oil_pressure_high, 0.1f);
if(nuevo>=oil_pressure_too_high){
return;
} else {
oil_pressure_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilphighvalue, oil_pressure_high);
update_all();
}
void lessoilplow(lv_event_t * e)
{
set();
if(oil_pressure_low<=0){
return;
} else {
oil_pressure_low=modify_value(oil_pressure_low, -0.1f);
}
CrowPanelController::set_value_to_label(ui_oilplowvalue, oil_pressure_low);
update_all();
}
void moreoilplow(lv_event_t * e)
{
set();
float nuevo=modify_value(oil_pressure_low, 0.1f);
if(nuevo>=oil_pressure_high){
return;
} else {
oil_pressure_low=nuevo;
}
CrowPanelController::set_value_to_label(ui_oilplowvalue, oil_pressure_low);
update_all();
}
void lessfuelptoohigh(lv_event_t * e)
{
set();
float nuevo=modify_value(fuel_pressure_too_high, -0.1f);
if(nuevo<=fuel_pressure_high){
return;
} else {
fuel_pressure_too_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_fuelptoohighvalue, fuel_pressure_too_high);
update_all();
}
void morefuelptoohigh(lv_event_t * e)
{
set();
fuel_pressure_too_high=modify_value(fuel_pressure_too_high, 0.1f);
CrowPanelController::set_value_to_label(ui_fuelptoohighvalue, fuel_pressure_too_high);
update_all();
}
void lessfuelphigh(lv_event_t * e)
{
set();
float nuevo=modify_value(fuel_pressure_high, -0.1f);
if(nuevo<=fuel_pressure_low){
return;
} else {
fuel_pressure_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_fuelphighvalue, fuel_pressure_high);
update_all();
}
void morefuelphigh(lv_event_t * e)
{
set();
float nuevo=modify_value(fuel_pressure_high, 0.1f);
if(nuevo>=fuel_pressure_too_high){
return;
} else {
fuel_pressure_high=nuevo;
}
CrowPanelController::set_value_to_label(ui_fuelphighvalue, fuel_pressure_high);
update_all();
}
void lessfuelp(lv_event_t * e)
{
set();
if(fuel_pressure_low<=0){
return;
} else {
fuel_pressure_low=modify_value(fuel_pressure_low, -0.1f);
}
CrowPanelController::set_value_to_label(ui_fuelplowvalue, fuel_pressure_low);
update_all();
}
void morefuelplow(lv_event_t * e)
{
set();
float nuevo=modify_value(fuel_pressure_low, 0.1f);
if(nuevo>=fuel_pressure_high){
return;
} else {
fuel_pressure_low=nuevo;
}
CrowPanelController::set_value_to_label(ui_fuelplowvalue, fuel_pressure_low);
update_all();
}
void refresh_ui_values(){
CrowPanelController::set_value_to_label(ui_rpmfinalvalue, rpm);
CrowPanelController::set_value_to_label(ui_desplazamientovalue, desp);
CrowPanelController::set_value_to_label(ui_diffrpmvalue, diff_rpm);
CrowPanelController::set_value_to_label(ui_vbatttoohighvalue, vbatt_too_high);
CrowPanelController::set_value_to_label(ui_vbatthighvalue, vbatt_high);
CrowPanelController::set_value_to_label(ui_vbattlowvalue, vbatt_low);
CrowPanelController::set_value_to_label(ui_waterhotvalue, water_hot);
CrowPanelController::set_value_to_label(ui_watermidvalue, water_mild);
CrowPanelController::set_value_to_label(ui_watercoldvalue, water_cold);
CrowPanelController::set_value_to_label(ui_oilhotvalue, oil_hot);
CrowPanelController::set_value_to_label(ui_oilmildvalue, oil_mild);
CrowPanelController::set_value_to_label(ui_oilcoldvalue, oil_cold);
CrowPanelController::set_value_to_label(ui_oilptoohighvalue, oil_pressure_too_high);
CrowPanelController::set_value_to_label(ui_oilphighvalue, oil_pressure_high);
CrowPanelController::set_value_to_label(ui_oilplowvalue, oil_pressure_low);
CrowPanelController::set_value_to_label(ui_fuelptoohighvalue, fuel_pressure_too_high);
CrowPanelController::set_value_to_label(ui_fuelphighvalue, fuel_pressure_high);
CrowPanelController::set_value_to_label(ui_fuelplowvalue, fuel_pressure_low);
if(modo_oscuro){
lv_obj_add_state(ui_modooscuoswitch, LV_STATE_CHECKED);
} else {
lv_obj_clear_state(ui_modooscuoswitch, LV_STATE_CHECKED);
}
lv_dropdown_set_selected(ui_pantalladrop, pantalla);
lv_dropdown_set_selected(ui_rpmdisplaydrop, rpm_display);
lv_dropdown_set_selected(ui_recepciondatosdrop, recepcion_datos);
lv_dropdown_set_selected(ui_opciondrop, 0);
lv_obj_clear_flag(ui_settingsmain, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsrpm, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsvbatt, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingswatert, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsoilt, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsoilp, LV_OBJ_FLAG_HIDDEN);
lv_obj_add_flag(ui_settingsfuelp, LV_OBJ_FLAG_HIDDEN);
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,951 @@
/*******************************************************************************
* Size: 40 px
* Bpp: 1
* Opts: --bpp 1 --size 40 --font C:/Users/Álvaro/Desktop/G26_pantalla_v3/assets/Rajdhani-SemiBold.ttf -o C:/Users/Álvaro/Desktop/G26_pantalla_v3/assets\ui_font_offon.c --format lvgl -r 0x20-0x7f --no-compress --no-prefilter
******************************************************************************/
#include "../../include/ui/ui.h"
#ifndef UI_FONT_OFFON
#define UI_FONT_OFFON 1
#endif
#if UI_FONT_OFFON
/*-----------------
* BITMAPS
*----------------*/
/*Store the image of the glyphs*/
static LV_ATTRIBUTE_LARGE_CONST const uint8_t glyph_bitmap[] = {
/* U+0020 " " */
0x0,
/* U+0021 "!" */
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0x60, 0x0, 0xff, 0xff, 0xff,
/* U+0022 "\"" */
0xf1, 0xfc, 0x7f, 0x1f, 0xc7, 0xf1, 0xd8, 0x76,
0x1d, 0x86, 0x60, 0x80,
/* U+0023 "#" */
0x0, 0x70, 0x38, 0x1, 0xe0, 0xf0, 0x3, 0x81,
0xc0, 0x7, 0x3, 0x80, 0xe, 0x7, 0x0, 0x3c,
0x1e, 0xf, 0xff, 0xff, 0x9f, 0xff, 0xff, 0x3f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 0x7, 0xf, 0x3,
0xc7, 0x81, 0xe7, 0x80, 0xf3, 0xc0, 0x3d, 0xe0,
0x1e, 0xe0, 0xf, 0xf0, 0x3, 0xf8, 0x1, 0xfc,
0x0, 0xfc, 0x0, 0x1e, 0x0, 0xf, 0x0, 0xf,
0x0, 0xf, 0x80, 0x7f, 0x80, 0x3f, 0x80, 0x1f,
0x80, 0x0,
/* U+007A "z" */
0xff, 0xfd, 0xff, 0xfb, 0xff, 0xf0, 0x3, 0xe0,
0xf, 0x80, 0x1f, 0x0, 0x7c, 0x0, 0xf0, 0x3,
0xe0, 0xf, 0x80, 0x1f, 0x0, 0x7c, 0x0, 0xf0,
0x3, 0xe0, 0xf, 0x80, 0x1e, 0x0, 0x7c, 0x1,
0xf0, 0x3, 0xff, 0xff, 0xff, 0xff, 0xff, 0xe0,
/* U+007B "{" */
0x3, 0x81, 0xf0, 0xf8, 0x78, 0x1c, 0x7, 0x1,
0xc0, 0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c,
0xf, 0x7, 0x83, 0xc0, 0x78, 0xf, 0x1, 0xc0,
0x70, 0x1c, 0x7, 0x1, 0xc0, 0x70, 0x1c, 0x7,
0x1, 0xc0, 0x78, 0xf, 0x81, 0xf0, 0x38,
/* U+007C "|" */
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xff,
0xff, 0xfc,
/* U+007D "}" */
0xe0, 0x7c, 0x3e, 0x7, 0x81, 0xc0, 0xe0, 0x70,
0x38, 0x1c, 0xe, 0x7, 0x3, 0x81, 0xc0, 0xf0,
0x3e, 0xf, 0xf, 0x8f, 0x7, 0x3, 0x81, 0xc0,
0xe0, 0x70, 0x38, 0x1c, 0xe, 0x7, 0x7, 0x8f,
0x87, 0xc3, 0x80,
/* U+007E "~" */
0x7f, 0x3, 0xff, 0xff, 0xff, 0xff, 0xc0, 0xfe
};
/*---------------------
* GLYPH DESCRIPTION
*--------------------*/
static const lv_font_fmt_txt_glyph_dsc_t glyph_dsc[] = {
{.bitmap_index = 0, .adv_w = 0, .box_w = 0, .box_h = 0, .ofs_x = 0, .ofs_y = 0} /* id = 0 reserved */,
{.bitmap_index = 0, .adv_w = 152, .box_w = 1, .box_h = 1, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 1, .adv_w = 152, .box_w = 4, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 14, .adv_w = 220, .box_w = 10, .box_h = 9, .ofs_x = 2, .ofs_y = 17},
{.bitmap_index = 26, .adv_w = 430, .box_w = 23, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 101, .adv_w = 332, .box_w = 16, .box_h = 35, .ofs_x = 2, .ofs_y = -4},
{.bitmap_index = 171, .adv_w = 468, .box_w = 25, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 253, .adv_w = 390, .box_w = 20, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 318, .adv_w = 120, .box_w = 4, .box_h = 7, .ofs_x = 2, .ofs_y = 18},
{.bitmap_index = 322, .adv_w = 190, .box_w = 8, .box_h = 31, .ofs_x = 2, .ofs_y = -5},
{.bitmap_index = 353, .adv_w = 190, .box_w = 8, .box_h = 31, .ofs_x = 1, .ofs_y = -5},
{.bitmap_index = 384, .adv_w = 257, .box_w = 13, .box_h = 12, .ofs_x = 2, .ofs_y = 14},
{.bitmap_index = 404, .adv_w = 351, .box_w = 16, .box_h = 17, .ofs_x = 3, .ofs_y = 5},
{.bitmap_index = 438, .adv_w = 127, .box_w = 4, .box_h = 10, .ofs_x = 2, .ofs_y = -4},
{.bitmap_index = 443, .adv_w = 200, .box_w = 9, .box_h = 3, .ofs_x = 2, .ofs_y = 11},
{.bitmap_index = 447, .adv_w = 127, .box_w = 4, .box_h = 6, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 450, .adv_w = 259, .box_w = 14, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 496, .adv_w = 338, .box_w = 16, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 548, .adv_w = 209, .box_w = 9, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 578, .adv_w = 312, .box_w = 15, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 627, .adv_w = 323, .box_w = 16, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 679, .adv_w = 341, .box_w = 19, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 741, .adv_w = 318, .box_w = 16, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 793, .adv_w = 330, .box_w = 16, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 845, .adv_w = 264, .box_w = 15, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 894, .adv_w = 341, .box_w = 17, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 950, .adv_w = 330, .box_w = 16, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1002, .adv_w = 127, .box_w = 4, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1013, .adv_w = 127, .box_w = 4, .box_h = 25, .ofs_x = 2, .ofs_y = -4},
{.bitmap_index = 1026, .adv_w = 348, .box_w = 17, .box_h = 15, .ofs_x = 3, .ofs_y = 6},
{.bitmap_index = 1058, .adv_w = 355, .box_w = 16, .box_h = 11, .ofs_x = 3, .ofs_y = 8},
{.bitmap_index = 1080, .adv_w = 355, .box_w = 17, .box_h = 15, .ofs_x = 3, .ofs_y = 6},
{.bitmap_index = 1112, .adv_w = 300, .box_w = 15, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 1161, .adv_w = 479, .box_w = 25, .box_h = 27, .ofs_x = 3, .ofs_y = -2},
{.bitmap_index = 1246, .adv_w = 351, .box_w = 20, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 1311, .adv_w = 353, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1367, .adv_w = 346, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1423, .adv_w = 355, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1479, .adv_w = 307, .box_w = 14, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1525, .adv_w = 291, .box_w = 14, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1571, .adv_w = 348, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1627, .adv_w = 367, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1683, .adv_w = 162, .box_w = 4, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1696, .adv_w = 328, .box_w = 16, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 1748, .adv_w = 351, .box_w = 19, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1810, .adv_w = 288, .box_w = 15, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1859, .adv_w = 458, .box_w = 23, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1934, .adv_w = 373, .box_w = 18, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 1993, .adv_w = 353, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2049, .adv_w = 338, .box_w = 16, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2101, .adv_w = 361, .box_w = 17, .box_h = 32, .ofs_x = 3, .ofs_y = -6},
{.bitmap_index = 2169, .adv_w = 347, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2225, .adv_w = 351, .box_w = 17, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 2281, .adv_w = 278, .box_w = 16, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 2333, .adv_w = 356, .box_w = 17, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2389, .adv_w = 328, .box_w = 19, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 2451, .adv_w = 513, .box_w = 31, .box_h = 26, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2552, .adv_w = 337, .box_w = 19, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 2614, .adv_w = 325, .box_w = 20, .box_h = 26, .ofs_x = 0, .ofs_y = 0},
{.bitmap_index = 2679, .adv_w = 324, .box_w = 17, .box_h = 26, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 2735, .adv_w = 198, .box_w = 7, .box_h = 31, .ofs_x = 3, .ofs_y = -5},
{.bitmap_index = 2763, .adv_w = 259, .box_w = 14, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 2809, .adv_w = 198, .box_w = 7, .box_h = 31, .ofs_x = 2, .ofs_y = -5},
{.bitmap_index = 2837, .adv_w = 316, .box_w = 16, .box_h = 12, .ofs_x = 2, .ofs_y = 15},
{.bitmap_index = 2861, .adv_w = 238, .box_w = 15, .box_h = 2, .ofs_x = 0, .ofs_y = -4},
{.bitmap_index = 2865, .adv_w = 184, .box_w = 7, .box_h = 5, .ofs_x = 2, .ofs_y = 24},
{.bitmap_index = 2870, .adv_w = 328, .box_w = 16, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 2912, .adv_w = 332, .box_w = 16, .box_h = 29, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 2970, .adv_w = 259, .box_w = 13, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3005, .adv_w = 332, .box_w = 16, .box_h = 29, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3063, .adv_w = 316, .box_w = 16, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3105, .adv_w = 214, .box_w = 12, .box_h = 29, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3149, .adv_w = 329, .box_w = 16, .box_h = 27, .ofs_x = 2, .ofs_y = -6},
{.bitmap_index = 3203, .adv_w = 331, .box_w = 16, .box_h = 29, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3261, .adv_w = 149, .box_w = 4, .box_h = 29, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3276, .adv_w = 149, .box_w = 9, .box_h = 35, .ofs_x = -2, .ofs_y = -6},
{.bitmap_index = 3316, .adv_w = 292, .box_w = 16, .box_h = 29, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3374, .adv_w = 149, .box_w = 4, .box_h = 29, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3389, .adv_w = 504, .box_w = 27, .box_h = 21, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3460, .adv_w = 331, .box_w = 16, .box_h = 21, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3502, .adv_w = 323, .box_w = 16, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3544, .adv_w = 332, .box_w = 16, .box_h = 27, .ofs_x = 3, .ofs_y = -6},
{.bitmap_index = 3598, .adv_w = 328, .box_w = 16, .box_h = 27, .ofs_x = 2, .ofs_y = -6},
{.bitmap_index = 3652, .adv_w = 214, .box_w = 11, .box_h = 21, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 3681, .adv_w = 278, .box_w = 14, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3718, .adv_w = 225, .box_w = 12, .box_h = 26, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3757, .adv_w = 331, .box_w = 16, .box_h = 21, .ofs_x = 2, .ofs_y = 0},
{.bitmap_index = 3799, .adv_w = 287, .box_w = 16, .box_h = 21, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3841, .adv_w = 442, .box_w = 26, .box_h = 21, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3910, .adv_w = 284, .box_w = 16, .box_h = 21, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 3952, .adv_w = 299, .box_w = 17, .box_h = 27, .ofs_x = 1, .ofs_y = -6},
{.bitmap_index = 4010, .adv_w = 276, .box_w = 15, .box_h = 21, .ofs_x = 1, .ofs_y = 0},
{.bitmap_index = 4050, .adv_w = 197, .box_w = 10, .box_h = 31, .ofs_x = 1, .ofs_y = -5},
{.bitmap_index = 4089, .adv_w = 142, .box_w = 3, .box_h = 26, .ofs_x = 3, .ofs_y = 0},
{.bitmap_index = 4099, .adv_w = 197, .box_w = 9, .box_h = 31, .ofs_x = 1, .ofs_y = -5},
{.bitmap_index = 4134, .adv_w = 351, .box_w = 16, .box_h = 4, .ofs_x = 3, .ofs_y = 11}
};
/*---------------------
* CHARACTER MAPPING
*--------------------*/
/*Collect the unicode lists and glyph_id offsets*/
static const lv_font_fmt_txt_cmap_t cmaps[] =
{
{
.range_start = 32, .range_length = 95, .glyph_id_start = 1,
.unicode_list = NULL, .glyph_id_ofs_list = NULL, .list_length = 0, .type = LV_FONT_FMT_TXT_CMAP_FORMAT0_TINY
}
};
/*--------------------
* ALL CUSTOM DATA
*--------------------*/
#if LVGL_VERSION_MAJOR == 8
/*Store all the custom data of the font*/
static lv_font_fmt_txt_glyph_cache_t cache;
#endif
#if LVGL_VERSION_MAJOR >= 8
static const lv_font_fmt_txt_dsc_t font_dsc = {
#else
static lv_font_fmt_txt_dsc_t font_dsc = {
#endif
.glyph_bitmap = glyph_bitmap,
.glyph_dsc = glyph_dsc,
.cmaps = cmaps,
.kern_dsc = NULL,
.kern_scale = 0,
.cmap_num = 1,
.bpp = 1,
.kern_classes = 0,
.bitmap_format = 0,
#if LVGL_VERSION_MAJOR == 8
.cache = &cache
#endif
};
/*-----------------
* PUBLIC FONT
*----------------*/
/*Initialize a public general font descriptor*/
#if LVGL_VERSION_MAJOR >= 8
const lv_font_t ui_font_offon = {
#else
lv_font_t ui_font_offon = {
#endif
.get_glyph_dsc = lv_font_get_glyph_dsc_fmt_txt, /*Function pointer to get glyph's data*/
.get_glyph_bitmap = lv_font_get_bitmap_fmt_txt, /*Function pointer to get glyph's bitmap*/
.line_height = 37, /*The maximum line height required by the font*/
.base_line = 6, /*Baseline measured from the bottom of the line*/
#if !(LVGL_VERSION_MAJOR == 6 && LVGL_VERSION_MINOR == 0)
.subpx = LV_FONT_SUBPX_NONE,
#endif
#if LV_VERSION_CHECK(7, 4, 0) || LVGL_VERSION_MAJOR >= 8
.underline_position = -3,
.underline_thickness = 2,
#endif
.dsc = &font_dsc, /*The custom font data. Will be accessed by `get_glyph_bitmap/dsc` */
#if LV_VERSION_CHECK(8, 2, 0) || LVGL_VERSION_MAJOR >= 9
.fallback = NULL,
#endif
.user_data = NULL,
};
#endif /*#if UI_FONT_OFFON*/

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,353 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3
#include "../../include/ui/ui_helpers.h"
void _ui_bar_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BAR_PROPERTY_VALUE_WITH_ANIM) lv_bar_set_value(target, val, LV_ANIM_ON);
if(id == _UI_BAR_PROPERTY_VALUE) lv_bar_set_value(target, val, LV_ANIM_OFF);
}
void _ui_basic_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_BASIC_PROPERTY_POSITION_X) lv_obj_set_x(target, val);
if(id == _UI_BASIC_PROPERTY_POSITION_Y) lv_obj_set_y(target, val);
if(id == _UI_BASIC_PROPERTY_WIDTH) lv_obj_set_width(target, val);
if(id == _UI_BASIC_PROPERTY_HEIGHT) lv_obj_set_height(target, val);
}
void _ui_dropdown_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_DROPDOWN_PROPERTY_SELECTED) lv_dropdown_set_selected(target, val);
}
void _ui_image_set_property(lv_obj_t * target, int id, uint8_t * val)
{
if(id == _UI_IMAGE_PROPERTY_IMAGE) lv_img_set_src(target, val);
}
void _ui_label_set_property(lv_obj_t * target, int id, const char * val)
{
if(id == _UI_LABEL_PROPERTY_TEXT) lv_label_set_text(target, val);
}
void _ui_roller_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_ROLLER_PROPERTY_SELECTED_WITH_ANIM) lv_roller_set_selected(target, val, LV_ANIM_ON);
if(id == _UI_ROLLER_PROPERTY_SELECTED) lv_roller_set_selected(target, val, LV_ANIM_OFF);
}
void _ui_slider_set_property(lv_obj_t * target, int id, int val)
{
if(id == _UI_SLIDER_PROPERTY_VALUE_WITH_ANIM) lv_slider_set_value(target, val, LV_ANIM_ON);
if(id == _UI_SLIDER_PROPERTY_VALUE) lv_slider_set_value(target, val, LV_ANIM_OFF);
}
void _ui_screen_change(lv_obj_t ** target, lv_scr_load_anim_t fademode, int spd, int delay, void (*target_init)(void))
{
if(*target == NULL)
target_init();
lv_scr_load_anim(*target, fademode, spd, delay, false);
}
void _ui_screen_delete(void (*target)(void))
{
if(target != NULL) {
target();
}
}
void _ui_arc_increment(lv_obj_t * target, int val)
{
int old = lv_arc_get_value(target);
lv_arc_set_value(target, old + val);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_bar_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_bar_get_value(target);
lv_bar_set_value(target, old + val, anm);
}
void _ui_slider_increment(lv_obj_t * target, int val, int anm)
{
int old = lv_slider_get_value(target);
lv_slider_set_value(target, old + val, anm);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_keyboard_set_target(lv_obj_t * keyboard, lv_obj_t * textarea)
{
lv_keyboard_set_textarea(keyboard, textarea);
}
void _ui_flag_modify(lv_obj_t * target, int32_t flag, int value)
{
if(value == _UI_MODIFY_FLAG_TOGGLE) {
if(lv_obj_has_flag(target, flag)) lv_obj_clear_flag(target, flag);
else lv_obj_add_flag(target, flag);
}
else if(value == _UI_MODIFY_FLAG_ADD) lv_obj_add_flag(target, flag);
else lv_obj_clear_flag(target, flag);
}
void _ui_state_modify(lv_obj_t * target, int32_t state, int value)
{
if(value == _UI_MODIFY_STATE_TOGGLE) {
if(lv_obj_has_state(target, state)) lv_obj_clear_state(target, state);
else lv_obj_add_state(target, state);
}
else if(value == _UI_MODIFY_STATE_ADD) lv_obj_add_state(target, state);
else lv_obj_clear_state(target, state);
}
void _ui_textarea_move_cursor(lv_obj_t * target, int val)
{
if(val == UI_MOVE_CURSOR_UP) lv_textarea_cursor_up(target);
if(val == UI_MOVE_CURSOR_RIGHT) lv_textarea_cursor_right(target);
if(val == UI_MOVE_CURSOR_DOWN) lv_textarea_cursor_down(target);
if(val == UI_MOVE_CURSOR_LEFT) lv_textarea_cursor_left(target);
lv_obj_add_state(target, LV_STATE_FOCUSED);
}
typedef void (*screen_destroy_cb_t)(void);
void scr_unloaded_delete_cb(lv_event_t * e)
{
// Get the destroy callback from user_data
screen_destroy_cb_t destroy_cb = lv_event_get_user_data(e);
if(destroy_cb) {
destroy_cb(); // call the specific screen destroy function
}
}
void _ui_opacity_set(lv_obj_t * target, int val)
{
lv_obj_set_style_opa(target, val, 0);
}
void _ui_anim_callback_free_user_data(lv_anim_t * a)
{
lv_mem_free(a->user_data);
a->user_data = NULL;
}
void _ui_anim_callback_set_x(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_x(usr->target, v);
}
void _ui_anim_callback_set_y(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_y(usr->target, v);
}
void _ui_anim_callback_set_width(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_width(usr->target, v);
}
void _ui_anim_callback_set_height(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_height(usr->target, v);
}
void _ui_anim_callback_set_opacity(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_obj_set_style_opa(usr->target, v, 0);
}
void _ui_anim_callback_set_image_zoom(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_zoom(usr->target, v);
}
void _ui_anim_callback_set_image_angle(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
lv_img_set_angle(usr->target, v);
}
void _ui_anim_callback_set_image_frame(lv_anim_t * a, int32_t v)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
usr->val = v;
if(v < 0) v = 0;
if(v >= usr->imgset_size) v = usr->imgset_size - 1;
lv_img_set_src(usr->target, usr->imgset[v]);
}
int32_t _ui_anim_callback_get_x(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_x_aligned(usr->target);
}
int32_t _ui_anim_callback_get_y(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_y_aligned(usr->target);
}
int32_t _ui_anim_callback_get_width(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_width(usr->target);
}
int32_t _ui_anim_callback_get_height(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_height(usr->target);
}
int32_t _ui_anim_callback_get_opacity(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_obj_get_style_opa(usr->target, 0);
}
int32_t _ui_anim_callback_get_image_zoom(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_zoom(usr->target);
}
int32_t _ui_anim_callback_get_image_angle(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return lv_img_get_angle(usr->target);
}
int32_t _ui_anim_callback_get_image_frame(lv_anim_t * a)
{
ui_anim_user_data_t * usr = (ui_anim_user_data_t *)a->user_data;
return usr->val;
}
void _ui_arc_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_arc_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_slider_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * prefix, const char * postfix)
{
char buf[_UI_TEMPORARY_STRING_BUFFER_SIZE];
lv_snprintf(buf, sizeof(buf), "%s%d%s", prefix, (int)lv_slider_get_value(src), postfix);
lv_label_set_text(trg, buf);
}
void _ui_checked_set_text_value(lv_obj_t * trg, lv_obj_t * src, const char * txt_on, const char * txt_off)
{
if(lv_obj_has_state(src, LV_STATE_CHECKED)) lv_label_set_text(trg, txt_on);
else lv_label_set_text(trg, txt_off);
}
void _ui_spinbox_step(lv_obj_t * target, int val)
{
if(val > 0) lv_spinbox_increment(target);
else lv_spinbox_decrement(target);
lv_event_send(target, LV_EVENT_VALUE_CHANGED, 0);
}
void _ui_switch_theme(int val)
{
#ifdef UI_THEME_ACTIVE
ui_theme_set(val);
#endif
}

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,209 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.4.3+
// LVGL version: 8.3.11
// Project name: design
#include "../../include/ui/ui.h"
_ui_local_style_t* _ui_local_styles;
uint32_t _ui_local_style_count = 0;
inline 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 ) {
if ( object_p!=NULL /*&& lv_obj_is_valid(object_p)*/ ) {
lv_obj_set_local_style_prop( object_p, property, _ui_style_value_convert( property, value ), selector );
}
}
//Atomic function to set (and register) an LVGL local style-property for a given part+state (selector) of an object (widget) - can be used in many ways due to being atomic
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) {
static _ui_local_style_t* local_style_p;
static _ui_local_style_property_setting_t* property_setting_p;
if (object_p==NULL /*|| !lv_obj_is_valid(object_p)*/ || theme_variable_p==NULL) return;
local_style_p = _ui_local_style_create( theme_variable_p, true );
if (local_style_p == NULL) return;
property_setting_p = _ui_local_style_property_setting_create( local_style_p, object_p, selector, property );
if (property_setting_p == NULL) return;
lv_obj_set_local_style_prop( object_p, property, _ui_style_value_convert( property, ui_get_theme_value(theme_variable_p) ), selector ); //ui_object_set_local_style_property( object_p, selector, property, ui_get_theme_value(theme_variable_p) );
}
//This function goes through all registered style-property settings and if theme is changed, sets all of them to the theme. (If called periodically, it can follow change of values automatically.)
void _ui_theme_set_variable_styles (uint8_t mode) {
static uint8_t ui_theme_idx_previous = -1;
static uint32_t i, j;
static _ui_local_style_property_setting_t* property_setting_p;
static ui_style_variable_t style_value;
static ui_style_variable_t* style_variable_p;
uint8_t ui_Theme_Changed = (ui_theme_idx != ui_theme_idx_previous); ui_theme_idx_previous = ui_theme_idx;
for (i = 0; i < _ui_local_style_count; ++i) {
style_variable_p = _ui_local_styles[i].style_variable_p;
if (_ui_local_styles[i].is_themeable) style_value = ui_get_theme_value( style_variable_p );
else style_value = *style_variable_p;
if (style_variable_p != _ui_local_styles[i].previous_pointer || style_value != _ui_local_styles[i].previous_value
|| mode == UI_VARIABLE_STYLES_MODE_INIT || ui_Theme_Changed) {
_ui_local_styles[i].previous_pointer = style_variable_p; _ui_local_styles[i].previous_value = style_value;
property_setting_p = _ui_local_styles[i].style_property_settings; //first item of linked list
for (j = 0; j < _ui_local_styles[i].style_property_setting_count; ++j) {
if (property_setting_p->object_p != NULL) {
ui_object_set_local_style_property (
property_setting_p->object_p, property_setting_p->selector, property_setting_p->property, style_value
);
}
if (property_setting_p->next_p != NULL) property_setting_p = (_ui_local_style_property_setting_t*) property_setting_p->next_p; //get next item in linked-list for next round
else break; //this shouldn't happen, but if it does, it's assumed end of the list
}
}
}
}
ui_style_variable_t ui_get_theme_value(const ui_theme_variable_t* var) {
return var[ui_theme_idx];
}
lv_style_value_t _ui_style_value_convert (lv_style_prop_t property, ui_style_variable_t value) {
static lv_style_value_t Style_Value; //LVGL would produce artefacts if both .num and .color were set for the local style to add:
//static lv_style_const_prop_t ValueConvert_Table [_LV_STYLE_NUM_BUILT_IN_PROPS] = { [LV_STYLE_BG_COLOR] = LV_STYLE_CONST_BG_COLOR(1), [LV_STYLE_BG_OPA] = LV_STYLE_CONST_BG_OPA(1) };
if (property==LV_STYLE_BG_COLOR || property==LV_STYLE_BG_GRAD_COLOR || property==LV_STYLE_BG_IMG_RECOLOR || property==LV_STYLE_BORDER_COLOR
|| property==LV_STYLE_OUTLINE_COLOR || property==LV_STYLE_SHADOW_COLOR || property==LV_STYLE_IMG_RECOLOR || property==LV_STYLE_LINE_COLOR
|| property==LV_STYLE_ARC_COLOR || property==LV_STYLE_TEXT_COLOR) {
Style_Value.color = lv_color_hex(value);
}
else if (property==LV_STYLE_BG_GRAD || property==LV_STYLE_BG_IMG_SRC || property==LV_STYLE_ARC_IMG_SRC || property==LV_STYLE_TEXT_FONT
|| property==LV_STYLE_COLOR_FILTER_DSC || property==LV_STYLE_ANIM || property==LV_STYLE_TRANSITION) {
Style_Value.ptr = (void*)(uintptr_t) value;
}
else Style_Value.num = value;
return Style_Value;
}
//auto-update dynamic local style array with existing/new style-variable (1st dimension)
_ui_local_style_t* _ui_local_style_create (const ui_style_variable_t* style_variable_p, bool is_themeable) {
static uint32_t i;
static _ui_local_style_t* local_style_p;
for (i = 0; i < _ui_local_style_count; ++i) { //Find existing local style
if (_ui_local_styles[i].style_variable_p == style_variable_p) return &_ui_local_styles[i];
}
//If not found, create new local style
_ui_local_styles = (_ui_local_style_t*) lv_mem_realloc( _ui_local_styles, (_ui_local_style_count + 1) * sizeof(_ui_local_style_t) );
LV_ASSERT_MALLOC( _ui_local_styles );
if (_ui_local_styles == NULL) return NULL;
//Reset new local style
local_style_p = &_ui_local_styles[ _ui_local_style_count ];
local_style_p->style_variable_p = (ui_style_variable_t*) style_variable_p;
local_style_p->is_themeable = is_themeable;
local_style_p->previous_pointer = NULL;
local_style_p->previous_value = -1;
local_style_p->style_property_setting_count = 0;
local_style_p->style_property_settings = NULL;
/*#ifdef LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD
local_style_p->garbage_collector_couter = 0;
#endif*/
++_ui_local_style_count;
return local_style_p;
}
void _ui_local_style_property_setting_delete (lv_event_t* event) { * (lv_obj_t**) lv_event_get_user_data( event ) = NULL; }
//auto-update dynamic local style-array's 2nd dimension (object part+state style-property settings for a given style-variable)
_ui_local_style_property_setting_t* _ui_local_style_property_setting_create
(_ui_local_style_t* local_style_p, lv_obj_t* object_p, lv_style_selector_t selector, lv_style_prop_t property) {
static uint32_t i; //auto-update
static _ui_local_style_property_setting_t *style_property_setting_p, *empty_style_property_setting_p;
/*#ifdef LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD
style_property_setting_p = local_style_p->style_property_settings; //first item of linked list
if (style_property_setting_p != NULL) { //checking might be unnecessary if count is properly initialized to 0
if (local_style_p->garbage_collector_couter > 0) --local_style_p->garbage_collector_couter; //avoid calling garbage collector every time
else if (LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD > 0) {
local_style_p->garbage_collector_couter = LV_SQUARELINE_THEME__EXPLICIT_GARBAGE_COLLECTOR_PERIOD - 1;
for (i = 0; i < local_style_p->style_property_setting_count; ++i) {
if (style_property_setting_p->object_p != NULL) { //check only valid object entry (skip already emptied positions{
#if ( defined(LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE) && LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE ) //Not recommended inside explicit garbage collector.
if ( style_property_setting_p->validcheck_counter > 0 ) --style_property_setting_p->validcheck_counter; //avoids calling complex lv_obj_is_valid() many times
else { //check objects with expired positive vaidity check
if ( lv_obj_is_valid( style_property_setting_p->object_p ) ) style_property_setting_p->validcheck_counter = LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE;
else style_property_setting_p->object_p = NULL; //free up an entry of a deleted widget
}
#else //this is the recommended variant inside explicit garbage collector:
if ( !lv_obj_is_valid( style_property_setting_p->object_p ) ) style_property_setting_p->object_p = NULL; //free up an entry of a deleted widget
#endif
}
if (style_property_setting_p->next_p != NULL) style_property_setting_p = (_ui_local_style_property_setting_t*) style_property_setting_p->next_p; //get next item in linked-list for next round
else break; //this shouldn't happen
}
}
}
#endif*/
style_property_setting_p = local_style_p->style_property_settings; //first item of linked list
empty_style_property_setting_p = NULL;
if (style_property_setting_p != NULL) { //checking might be unnecessary if count is properly initialized to 0
for (i = 0; i < local_style_p->style_property_setting_count; ++i) {
if (empty_style_property_setting_p == NULL) { //search and register one empty position that might be needed for a newly created entry
if (style_property_setting_p->object_p == NULL) empty_style_property_setting_p = style_property_setting_p; //if found empty position, register it
/*#ifdef LV_SQUARELINE_THEME__IMPLICIT_GARBAGE_COLLECTOR
else { //if not, check for possible empty positions of deleted objects (garbage-collection)
#if ( defined(LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE) && LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE ) //for slow hardware, adding this and setting to 5..10 in lv_conf.h might make it faster
if ( style_property_setting_p->validcheck_counter > 0 ) --style_property_setting_p->validcheck_counter; //avoids calling complex lv_obj_is_valid() many times
else { //check objects with expired positive vaidity check
if ( lv_obj_is_valid( style_property_setting_p->object_p ) ) style_property_setting_p->validcheck_counter = LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE;
else { //free up an entry of a deleted widget
style_property_setting_p->object_p = NULL;
empty_style_property_setting_p = style_property_setting_p;
}
}
#else
if ( !lv_obj_is_valid( style_property_setting_p->object_p ) ) { //free up an entry of a deleted widget
style_property_setting_p->object_p = NULL;
empty_style_property_setting_p = style_property_setting_p;
}
#endif
}
#endif*/
}
if (style_property_setting_p->object_p == object_p && style_property_setting_p->selector == selector
&& style_property_setting_p->property == property) { //setting found in the list (created already), so returning it
return style_property_setting_p;
}
if (style_property_setting_p->next_p != NULL) style_property_setting_p = (_ui_local_style_property_setting_t*) style_property_setting_p->next_p; //get next item in linked-list for next round
else break; //this shouldn't happen, but if it does, create a new element
}
}
//If not found, create new local style-property (can be inside the array at freed-up places of deleted objects too)
if (empty_style_property_setting_p == NULL) { //allocate new
empty_style_property_setting_p = (_ui_local_style_property_setting_t*) lv_mem_alloc( sizeof(_ui_local_style_property_setting_t) );
LV_ASSERT_MALLOC( empty_style_property_setting_p );
if (empty_style_property_setting_p == NULL) return NULL;
if (style_property_setting_p != NULL) style_property_setting_p->next_p = (void*) empty_style_property_setting_p; //create link from last item to the new
else local_style_p->style_property_settings = empty_style_property_setting_p; //(except if creating first item)
style_property_setting_p = empty_style_property_setting_p; //take the new item pointer for initialization
style_property_setting_p->next_p = NULL; //signify the end of the linked list, just in case
++local_style_p->style_property_setting_count;
}
else { //reuse empty
style_property_setting_p = empty_style_property_setting_p;
}
style_property_setting_p->object_p = object_p; lv_obj_add_event_cb( object_p, _ui_local_style_property_setting_delete, LV_EVENT_DELETE, &style_property_setting_p->object_p );
style_property_setting_p->selector = selector;
style_property_setting_p->property = property;
/*#ifdef LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE
style_property_setting_p->validcheck_counter = LV_SQUARELINE_THEME__OBJECT_VALIDITY_CACHE; //0
#endif*/
return style_property_setting_p;
}

View file

@ -0,0 +1,28 @@
// This file was generated by SquareLine Studio
// SquareLine Studio version: SquareLine Studio 1.6.0
// LVGL version: 8.3.11
// Project name: G26_v3
#include "../../include/ui/ui.h"
const ui_theme_variable_t _ui_theme_color_fondo[3] = {0x232323, 0x232323, 0xE9E9E9};
const ui_theme_variable_t _ui_theme_alpha_fondo[3] = {255, 255, 255};
const ui_theme_variable_t _ui_theme_color_texto[3] = {0xD2D2D2, 0xD2D2D2, 0x202020};
const ui_theme_variable_t _ui_theme_alpha_texto[3] = {255, 255, 255};
const ui_theme_variable_t _ui_theme_color_fbarra[3] = {0x3A3A3A, 0x3A3A3A, 0xAAAAAA};
const ui_theme_variable_t _ui_theme_alpha_fbarra[3] = {255, 255, 255};
const ui_theme_variable_t _ui_theme_color_barrar[3] = {0x422727, 0x422727, 0xBC5C5C};
const ui_theme_variable_t _ui_theme_alpha_barrar[3] = {255, 255, 255};
uint8_t ui_theme_idx = UI_THEME_OSCURO;
void ui_theme_set(uint8_t theme_idx)
{
ui_theme_idx = theme_idx;
_ui_theme_set_variable_styles(UI_VARIABLE_STYLES_MODE_FOLLOW);
}

View file

@ -1,17 +1,17 @@
{
"format": 1,
"restore": {
"C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj": {}
"C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj": {}
},
"projects": {
"C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj": {
"C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj",
"projectUniqueName": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj",
"projectName": "App_radio",
"projectPath": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj",
"projectPath": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj",
"packagesPath": "C:\\Users\\alvar\\.nuget\\packages\\",
"outputPath": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\obj\\",
"outputPath": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\alvar\\AppData\\Roaming\\NuGet\\NuGet.Config",

View file

@ -1,10 +1,9 @@
//------------------------------------------------------------------------------
// <auto-generated>
// Este código fue generado por una herramienta.
// Versión de runtime:4.0.30319.42000
// This code was generated by a tool.
//
// Los cambios en este archivo podrían causar un comportamiento incorrecto y se perderán si
// se vuelve a generar el código.
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
@ -14,7 +13,7 @@ using System.Reflection;
[assembly: System.Reflection.AssemblyCompanyAttribute("App_radio")]
[assembly: System.Reflection.AssemblyConfigurationAttribute("Debug")]
[assembly: System.Reflection.AssemblyFileVersionAttribute("1.0.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0")]
[assembly: System.Reflection.AssemblyInformationalVersionAttribute("1.0.0+f0db3a8aebfd0a47378719d953a5be6c066e897f")]
[assembly: System.Reflection.AssemblyProductAttribute("App_radio")]
[assembly: System.Reflection.AssemblyTitleAttribute("App_radio")]
[assembly: System.Reflection.AssemblyVersionAttribute("1.0.0.0")]

View file

@ -1 +1 @@
0b160f71b5bcbec8190dec27628788a44df803979ca593b8f6d546503376aba5
3fea6a691771642f8e2a0b63b006473b73add5ef74fe4839c396f1bdd0743331

View file

@ -17,7 +17,7 @@ build_property.EnforceExtendedAnalyzerRules =
build_property.EntryPointFilePath =
build_property._SupportedPlatformList = Linux,macOS,Windows
build_property.RootNamespace = App_radio
build_property.ProjectDir = C:\Users\alvar\Desktop\Barcelona_software\AARadio_bluetooth\App_radio\
build_property.ProjectDir = C:\Users\alvar\Desktop\hkuobb\G26---Telemetry-Software\Radio\App_radio\
build_property.EnableComHosting =
build_property.EnableGeneratedComInterfaceComImportInterop =
build_property.CsWinRTUseWindowsUIXamlProjections = false

View file

@ -1953,11 +1953,11 @@
"project": {
"version": "1.0.0",
"restore": {
"projectUniqueName": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj",
"projectUniqueName": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj",
"projectName": "App_radio",
"projectPath": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj",
"projectPath": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj",
"packagesPath": "C:\\Users\\alvar\\.nuget\\packages\\",
"outputPath": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\obj\\",
"outputPath": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\obj\\",
"projectStyle": "PackageReference",
"configFilePaths": [
"C:\\Users\\alvar\\AppData\\Roaming\\NuGet\\NuGet.Config",

View file

@ -1,8 +1,8 @@
{
"version": 2,
"dgSpecHash": "7hNv4dUw2/Y=",
"dgSpecHash": "qKvi/iZEV1o=",
"success": true,
"projectFilePath": "C:\\Users\\alvar\\Desktop\\Barcelona_software\\AARadio_bluetooth\\App_radio\\App_radio.csproj",
"projectFilePath": "C:\\Users\\alvar\\Desktop\\hkuobb\\G26---Telemetry-Software\\Radio\\App_radio\\App_radio.csproj",
"expectedPackageFiles": [
"C:\\Users\\alvar\\.nuget\\packages\\naudio\\2.3.0\\naudio.2.3.0.nupkg.sha512",
"C:\\Users\\alvar\\.nuget\\packages\\naudio.asio\\2.3.0\\naudio.asio.2.3.0.nupkg.sha512",

View file

@ -0,0 +1,63 @@
#include <esp_now.h>
#include <WiFi.h>
const int sensorPin = 13;
bool lastState = HIGH;
// MAC de la Master
uint8_t masterAddress[] = {0x28, 0x05, 0xA5, 0xE1, 0xCF, 0x90};
typedef struct struct_message {
bool handshake;
bool trigger;
} struct_message;
struct_message msg;
void onDataReceive(const esp_now_recv_info_t *info, const uint8_t *incomingData, int len){
struct_message incomingMsg;
memcpy(&incomingMsg, incomingData, sizeof(incomingMsg));
if(incomingMsg.handshake){
Serial.println("🔄 Handshake recibido del Master, enviando confirmación");
msg.handshake = true;
esp_now_send(masterAddress, (uint8_t*)&msg, sizeof(msg));
}
}
void setup() {
Serial.begin(115200);
pinMode(sensorPin, INPUT_PULLUP);
WiFi.mode(WIFI_STA);
if(esp_now_init() != ESP_OK){
Serial.println("Error al inicializar ESP-NOW");
return;
}
// Añadir Master como peer
esp_now_peer_info_t peerInfo = {};
memcpy(peerInfo.peer_addr, masterAddress, 6);
peerInfo.channel = 0;
peerInfo.encrypt = false;
esp_now_add_peer(&peerInfo);
esp_now_register_recv_cb(onDataReceive);
Serial.println("Slave listo. Esperando handshake del Master...");
}
void loop() {
bool sensorState = digitalRead(sensorPin);
// Detectar sensor final
if(lastState == HIGH && sensorState == LOW){
delay(100); // debounce / margen para paso de coche
msg.trigger = true;
esp_now_send(masterAddress, (uint8_t*)&msg, sizeof(msg));
Serial.println("🏁 Sensor final activado, mensaje enviado al Master");
msg.trigger = false; // reset para siguiente vuelta
}
lastState = sensorState;
}

View file

@ -0,0 +1,83 @@
#include <Arduino.h>
#include <esp_now.h>
#include "acceleration.hpp"
#include "servicios_pruebas.hpp"
static unsigned long startTime = 0;
static bool counting = false;
static volatile bool handshakeDone = false;
static volatile bool handshakePending = false;
static volatile bool triggerPending = false;
static unsigned long lastHandshake = 0;
static void enviar_handshake() {
paquete_final_acceleration mensaje = {};
mensaje.handshake = true;
mensaje.trigger = false;
esp_err_t resultado = esp_now_send(ESPNOW_MAC_FINAL_ACCELERATION, (uint8_t*)&mensaje, sizeof(mensaje));
if (resultado != ESP_OK) Serial.println("Error enviando handshake al sensor final de Acceleration");
}
void reiniciar_acceleration() {
startTime = 0;
counting = false;
handshakeDone = false;
handshakePending = false;
triggerPending = false;
lastHandshake = 0;
}
void recibir_paquete_acceleration(const paquete_final_acceleration& mensaje) {
if (mensaje.handshake && !handshakeDone) {
handshakeDone = true;
handshakePending = true;
}
if (mensaje.trigger) triggerPending = true;
}
void prueba_acceleration() {
if (!handshakeDone && millis() - lastHandshake >= 500) {
lastHandshake = millis();
enviar_handshake();
Serial.println("Enviando handshake al sensor final de Acceleration...");
}
if (handshakePending) {
handshakePending = false;
Serial.println("Sensor final de Acceleration conectado");
enviar_datos(1);
}
if (triggerPending) {
triggerPending = false;
if (counting) {
unsigned long tiempo = millis() - startTime;
counting = false;
Serial.print("Acceleration terminada: ");
Serial.print(tiempo / 1000.0, 3);
Serial.println(" s");
enviar_datos(3, 0, tiempo);
}
}
if (!detectar_activacion_sensor(SENSOR_ACCELERATION, 1500)) return;
if (!handshakeDone) {
Serial.println("No se inicia: el sensor final de Acceleration no esta conectado");
enviar_datos(4);
return;
}
if (!counting) {
startTime = millis();
counting = true;
Serial.println("Sensor de salida activado: Acceleration iniciada");
enviar_datos(2);
}
}

View file

@ -0,0 +1,7 @@
#pragma once
#include "configuracion.hpp"
void prueba_acceleration();
void reiniciar_acceleration();
void recibir_paquete_acceleration(const paquete_final_acceleration& mensaje);

View file

@ -0,0 +1,58 @@
#include <Arduino.h>
#include "autox_endurance.hpp"
#include "configuracion.hpp"
#include "servicios_pruebas.hpp"
static unsigned long startTime = 0;
static int activationCount = 0;
static int lapCount = 0;
static const int WARMUP_TOTAL = 2;
void reiniciar_autox_endurance() {
startTime = 0;
activationCount = 0;
lapCount = 0;
}
void prueba_autox_endurance() {
if (!detectar_activacion_sensor(SENSOR_AUTOX_ENDURANCE, 2000)) return;
unsigned long now = millis();
activationCount++;
if (activationCount <= WARMUP_TOTAL) {
if (activationCount == 1) {
Serial.println("Calentamiento: vuelta 1 iniciada");
} else {
Serial.print("Calentamiento: vuelta ");
Serial.print(activationCount - 1);
Serial.print(" terminada, vuelta ");
Serial.print(activationCount);
Serial.println(" iniciada");
}
enviar_datos(1, activationCount);
return;
}
if (activationCount == WARMUP_TOTAL + 1) {
startTime = now;
lapCount = 0;
Serial.println("Calentamiento terminado: primera vuelta oficial iniciada");
enviar_datos(2, 1);
return;
}
unsigned long lapTime = now - startTime;
lapCount++;
startTime = now;
Serial.print("Vuelta ");
Serial.print(lapCount);
Serial.print(": ");
Serial.print(lapTime / 1000.0, 3);
Serial.println(" s");
enviar_datos(3, lapCount, lapTime);
}

View file

@ -0,0 +1,4 @@
#pragma once
void prueba_autox_endurance();
void reiniciar_autox_endurance();

View file

@ -0,0 +1,53 @@
#pragma once
#include <Arduino.h>
/* MAC del receptor del box */
static const uint8_t ESPNOW_MAC_RECEPTOR_BOX[6] = {
0x28, 0x05, 0xA5, 0xE1, 0xCA, 0x10
};
/* MAC del ESP32 situado al final de Acceleration */
static const uint8_t ESPNOW_MAC_FINAL_ACCELERATION[6] = {
0x28, 0x05, 0xA5, 0x0B, 0x44, 0xA8
};
/* Pines de los sensores */
static const int SENSOR_ACCELERATION = 26;
static const int SENSOR_SKIDPAD = 26;
static const int SENSOR_AUTOX_ENDURANCE = 26;
enum tipo_prueba : uint8_t {
PRUEBA_NINGUNA = 0,
PRUEBA_ACCELERATION = 1,
PRUEBA_SKIDPAD = 2,
PRUEBA_AUTOX_ENDURANCE = 3
};
enum tipo_comando : uint8_t {
COMANDO_NINGUNO = 0,
COMANDO_SELECCIONAR_PRUEBA = 1,
COMANDO_REINICIAR_PRUEBA = 2
};
struct paquete_control {
uint8_t comando;
uint8_t prueba;
};
struct paquete_datos {
uint8_t prueba;
uint8_t estado;
uint16_t vuelta;
unsigned long tiempo;
unsigned long laptime_derecha;
unsigned long laptime_izquierda;
unsigned long average;
};
/* Compatible con el acel_slave original */
struct paquete_final_acceleration {
bool handshake;
bool trigger;
};

View file

@ -0,0 +1,179 @@
#include <WiFi.h>
#include <esp_now.h>
#include "configuracion.hpp"
#include "servicios_pruebas.hpp"
#include "acceleration.hpp"
#include "skidpad.hpp"
#include "autox_endurance.hpp"
paquete_datos datos;
tipo_prueba prueba_activa = PRUEBA_NINGUNA;
volatile tipo_prueba prueba_pendiente = PRUEBA_NINGUNA;
volatile bool cambio_prueba_pendiente = false;
volatile bool reinicio_pendiente = false;
static bool sensorState = HIGH;
static bool lastSensorState = HIGH;
static unsigned long lastActivationTime = 0;
static const unsigned long DEBOUNCE_DELAY = 50;
void enviar_datos(uint8_t estado, uint16_t vuelta, unsigned long tiempo, unsigned long derecha, unsigned long izquierda, unsigned long media) {
datos.prueba = prueba_activa;
datos.estado = estado;
datos.vuelta = vuelta;
datos.tiempo = tiempo;
datos.laptime_derecha = derecha;
datos.laptime_izquierda = izquierda;
datos.average = media;
esp_err_t resultado = esp_now_send(ESPNOW_MAC_RECEPTOR_BOX, (uint8_t*)&datos, sizeof(datos));
if (resultado != ESP_OK) Serial.println("Error enviando datos al receptor del box");
}
static int pin_sensor_prueba(tipo_prueba prueba) {
switch (prueba) {
case PRUEBA_ACCELERATION: return SENSOR_ACCELERATION;
case PRUEBA_SKIDPAD: return SENSOR_SKIDPAD;
case PRUEBA_AUTOX_ENDURANCE: return SENSOR_AUTOX_ENDURANCE;
default: return SENSOR_SKIDPAD;
}
}
bool detectar_activacion_sensor(int sensorPin, unsigned long minInterval) {
sensorState = digitalRead(sensorPin);
bool activado = false;
if (lastSensorState == HIGH && sensorState == LOW) {
unsigned long now = millis();
if (now - lastActivationTime >= minInterval) {
lastActivationTime = now;
activado = true;
}
delay(DEBOUNCE_DELAY);
}
lastSensorState = sensorState;
return activado;
}
static void reiniciar_variables_comunes() {
lastActivationTime = 0;
sensorState = digitalRead(pin_sensor_prueba(prueba_activa));
lastSensorState = sensorState;
}
static void reiniciar_todas_las_pruebas() {
reiniciar_acceleration();
reiniciar_skidpad();
reiniciar_autox_endurance();
}
static void reiniciar_prueba_actual() {
switch (prueba_activa) {
case PRUEBA_ACCELERATION: reiniciar_acceleration(); break;
case PRUEBA_SKIDPAD: reiniciar_skidpad(); break;
case PRUEBA_AUTOX_ENDURANCE: reiniciar_autox_endurance(); break;
default: break;
}
memset(&datos, 0, sizeof(datos));
reiniciar_variables_comunes();
Serial.println("Prueba reiniciada desde el receptor del box");
enviar_datos(101);
}
static void seleccionar_prueba(tipo_prueba nueva_prueba) {
prueba_activa = nueva_prueba;
reiniciar_todas_las_pruebas();
memset(&datos, 0, sizeof(datos));
reiniciar_variables_comunes();
Serial.println();
switch (prueba_activa) {
case PRUEBA_ACCELERATION: Serial.println("PRUEBA SELECCIONADA: ACCELERATION"); break;
case PRUEBA_SKIDPAD: Serial.println("PRUEBA SELECCIONADA: SKIDPAD"); break;
case PRUEBA_AUTOX_ENDURANCE: Serial.println("PRUEBA SELECCIONADA: AUTOX / ENDURANCE"); break;
default: Serial.println("NINGUNA PRUEBA SELECCIONADA"); break;
}
enviar_datos(100);
}
static void recibir_espnow(const esp_now_recv_info_t *info, const uint8_t *datos_recibidos, int longitud) {
if (memcmp(info->src_addr, ESPNOW_MAC_RECEPTOR_BOX, 6) == 0 && longitud == sizeof(paquete_control)) {
paquete_control control;
memcpy(&control, datos_recibidos, sizeof(control));
if (control.comando == COMANDO_SELECCIONAR_PRUEBA && control.prueba >= PRUEBA_ACCELERATION && control.prueba <= PRUEBA_AUTOX_ENDURANCE) {
prueba_pendiente = (tipo_prueba)control.prueba;
cambio_prueba_pendiente = true;
} else if (control.comando == COMANDO_REINICIAR_PRUEBA) {
reinicio_pendiente = true;
}
return;
}
if (memcmp(info->src_addr, ESPNOW_MAC_FINAL_ACCELERATION, 6) == 0 && longitud == sizeof(paquete_final_acceleration)) {
paquete_final_acceleration mensaje;
memcpy(&mensaje, datos_recibidos, sizeof(mensaje));
recibir_paquete_acceleration(mensaje);
}
}
static bool anadir_peer(const uint8_t *mac) {
esp_now_peer_info_t peer = {};
memcpy(peer.peer_addr, mac, 6);
peer.channel = 0;
peer.encrypt = false;
return esp_now_add_peer(&peer) == ESP_OK;
}
void setup() {
Serial.begin(115200);
pinMode(SENSOR_ACCELERATION, INPUT_PULLUP);
pinMode(SENSOR_SKIDPAD, INPUT_PULLUP);
pinMode(SENSOR_AUTOX_ENDURANCE, INPUT_PULLUP);
WiFi.mode(WIFI_STA);
if (esp_now_init() != ESP_OK) {
Serial.println("Error iniciando ESP-NOW");
return;
}
esp_now_register_recv_cb(recibir_espnow);
if (!anadir_peer(ESPNOW_MAC_RECEPTOR_BOX)) Serial.println("Error anadiendo el receptor del box");
if (!anadir_peer(ESPNOW_MAC_FINAL_ACCELERATION)) Serial.println("Error anadiendo el sensor final de Acceleration");
Serial.println("Emisor de pruebas listo");
Serial.println("Esperando que el receptor del box seleccione una prueba");
}
void loop() {
if (cambio_prueba_pendiente) {
cambio_prueba_pendiente = false;
seleccionar_prueba(prueba_pendiente);
}
if (reinicio_pendiente) {
reinicio_pendiente = false;
reiniciar_prueba_actual();
}
switch (prueba_activa) {
case PRUEBA_ACCELERATION: prueba_acceleration(); break;
case PRUEBA_SKIDPAD: prueba_skidpad(); break;
case PRUEBA_AUTOX_ENDURANCE: prueba_autox_endurance(); break;
default: delay(10); break;
}
}

View file

@ -0,0 +1,6 @@
#pragma once
#include <Arduino.h>
void enviar_datos(uint8_t estado, uint16_t vuelta = 0, unsigned long tiempo = 0, unsigned long derecha = 0, unsigned long izquierda = 0, unsigned long media = 0);
bool detectar_activacion_sensor(int sensorPin, unsigned long minInterval);

View file

@ -0,0 +1,77 @@
#include <Arduino.h>
#include "configuracion.hpp"
#include "servicios_pruebas.hpp"
#include "skidpad.hpp"
static unsigned long startTime = 0;
static unsigned long lapTimeRight = 0;
static unsigned long lapTimeLeft = 0;
static int activationCount = 0;
static int cycleCount = 0;
void reiniciar_skidpad() {
startTime = 0;
lapTimeRight = 0;
lapTimeLeft = 0;
activationCount = 0;
cycleCount = 0;
}
void prueba_skidpad() {
if (!detectar_activacion_sensor(SENSOR_SKIDPAD, 1500)) return;
unsigned long now = millis();
activationCount++;
switch (activationCount) {
case 1:
cycleCount++;
Serial.print("\n===== Ciclo ");
Serial.print(cycleCount);
Serial.println(" =====");
Serial.println("Primera activacion: nada");
enviar_datos(1, cycleCount);
break;
case 2:
startTime = now;
Serial.println("Segunda activacion: inicia vuelta DERECHA");
enviar_datos(2, cycleCount);
break;
case 3:
lapTimeRight = now - startTime;
Serial.print("Vuelta DERECHA terminada: ");
Serial.print(lapTimeRight / 1000.0, 3);
Serial.println(" s");
enviar_datos(3, cycleCount, 0, lapTimeRight);
break;
case 4:
startTime = now;
Serial.println("Cuarta activacion: inicia vuelta IZQUIERDA");
enviar_datos(4, cycleCount, 0, lapTimeRight);
break;
case 5: {
lapTimeLeft = now - startTime;
unsigned long media = (lapTimeRight + lapTimeLeft) / 2;
Serial.print("Vuelta IZQUIERDA terminada: ");
Serial.print(lapTimeLeft / 1000.0, 3);
Serial.println(" s");
Serial.print("Media de ambas vueltas: ");
Serial.print(media / 1000.0, 3);
Serial.println(" s");
enviar_datos(5, cycleCount, 0, lapTimeRight, lapTimeLeft, media);
activationCount = 0;
break;
}
default:
activationCount = 0;
break;
}
}

View file

@ -0,0 +1,4 @@
#pragma once
void prueba_skidpad();
void reiniciar_skidpad();

View file

@ -0,0 +1,33 @@
#include <Arduino.h>
#include "acceleration.hpp"
void reiniciar_receptor_acceleration() {
// Acceleration no necesita variables persistentes en el receptor.
}
void procesar_acceleration(const paquete_datos& datos) {
switch (datos.estado) {
case 1:
Serial.println("Sensor final de Acceleration conectado. Sistema listo");
break;
case 2:
Serial.println("Acceleration iniciada");
break;
case 3:
Serial.print("Acceleration terminada: ");
Serial.print(datos.tiempo / 1000.0, 3);
Serial.println(" s");
break;
case 4:
Serial.println("ERROR: el sensor final de Acceleration no esta conectado");
break;
default:
Serial.println("Estado de Acceleration desconocido");
break;
}
}

View file

@ -0,0 +1,6 @@
#pragma once
#include "configuracion.hpp"
void procesar_acceleration(const paquete_datos& datos);
void reiniciar_receptor_acceleration();

View file

@ -0,0 +1,61 @@
#include <Arduino.h>
#include "autox_endurance.hpp"
unsigned long tiempo_acumulado=0;
int vueltas_total=0;
void reiniciar_receptor_autox_endurance() {
if(tiempo_acumulado!=0 || vueltas_total!=0){
Serial.print("Tiempo total: ");
Serial.print(tiempo_acumulado/1000.0, 3);
Serial.println(" s");
unsigned long media_vueltas=tiempo_acumulado/vueltas_total;
Serial.print("Media de vueltas: ");
Serial.print(media_vueltas/1000.0, 3);
Serial.println(" s");
tiempo_acumulado=0;
vueltas_total=0;
}
}
void procesar_autox_endurance(const paquete_datos& datos) {
switch (datos.estado) {
case 1:
if (datos.vuelta == 1) {
Serial.println("Calentamiento: vuelta 1 iniciada");
} else {
Serial.print("Calentamiento: vuelta ");
Serial.print(datos.vuelta - 1);
Serial.print(" terminada, vuelta ");
Serial.print(datos.vuelta);
Serial.println(" iniciada");
}
break;
case 2:
Serial.println("Calentamiento terminado: primera vuelta oficial iniciada");
break;
case 3:
Serial.print("Vuelta ");
Serial.print(datos.vuelta);
Serial.print(": ");
Serial.print(datos.tiempo / 1000.0, 3);
tiempo_acumulado+=datos.tiempo;
vueltas_total=datos.vuelta;
Serial.println(" s");
break;
default:
Serial.println("Estado de Autocross / Endurance desconocido");
break;
}
}

View file

@ -0,0 +1,6 @@
#pragma once
#include "configuracion.hpp"
void procesar_autox_endurance(const paquete_datos& datos);
void reiniciar_receptor_autox_endurance();

View file

@ -0,0 +1,36 @@
#pragma once
#include <Arduino.h>
/* MAC del emisor de pruebas */
static const uint8_t ESPNOW_MAC_EMISOR_PRUEBAS[6] = {
0x28, 0x05, 0xA5, 0xE1, 0xCF, 0x90
};
enum tipo_prueba : uint8_t {
PRUEBA_NINGUNA = 0,
PRUEBA_ACCELERATION = 1,
PRUEBA_SKIDPAD = 2,
PRUEBA_AUTOX_ENDURANCE = 3
};
enum tipo_comando : uint8_t {
COMANDO_NINGUNO = 0,
COMANDO_SELECCIONAR_PRUEBA = 1,
COMANDO_REINICIAR_PRUEBA = 2
};
struct paquete_control {
uint8_t comando;
uint8_t prueba;
};
struct paquete_datos {
uint8_t prueba;
uint8_t estado;
uint16_t vuelta;
unsigned long tiempo;
unsigned long laptime_derecha;
unsigned long laptime_izquierda;
unsigned long average;
};

View file

@ -0,0 +1,153 @@
#include <WiFi.h>
#include <esp_now.h>
#include "configuracion.hpp"
#include "acceleration.hpp"
#include "skidpad.hpp"
#include "autox_endurance.hpp"
paquete_datos datos;
volatile bool datos_nuevos = false;
tipo_prueba prueba_activa = PRUEBA_NINGUNA;
static void mostrar_menu() {
Serial.println();
Serial.println("========================================");
Serial.println(" SELECCION DE PRUEBA - BOX");
Serial.println("========================================");
Serial.println("1 -> Acceleration");
Serial.println("2 -> Skidpad");
Serial.println("3 -> Autocross / Endurance");
Serial.println("0 -> Reiniciar prueba actual");
Serial.println("m -> Mostrar este menu");
Serial.println("========================================");
}
static void enviar_control(uint8_t comando, tipo_prueba prueba) {
paquete_control control;
control.comando = comando;
control.prueba = prueba;
esp_err_t resultado = esp_now_send(ESPNOW_MAC_EMISOR_PRUEBAS, (uint8_t*)&control, sizeof(control));
if (resultado != ESP_OK) Serial.println("Error enviando el comando al emisor");
}
static void reiniciar_procesadores() {
reiniciar_receptor_acceleration();
reiniciar_receptor_skidpad();
if(prueba_activa==PRUEBA_AUTOX_ENDURANCE) reiniciar_receptor_autox_endurance();
}
static void seleccionar_prueba(tipo_prueba nueva_prueba) {
prueba_activa = nueva_prueba;
memset(&datos, 0, sizeof(datos));
datos_nuevos = false;
reiniciar_procesadores();
Serial.println();
switch (prueba_activa) {
case PRUEBA_ACCELERATION: Serial.println("Seleccionando ACCELERATION..."); break;
case PRUEBA_SKIDPAD: Serial.println("Seleccionando SKIDPAD..."); break;
case PRUEBA_AUTOX_ENDURANCE: Serial.println("Seleccionando AUTOX / ENDURANCE..."); break;
default: return;
}
enviar_control(COMANDO_SELECCIONAR_PRUEBA, prueba_activa);
}
static void reiniciar_prueba() {
if (prueba_activa == PRUEBA_NINGUNA) {
Serial.println("Primero selecciona una prueba");
return;
}
memset(&datos, 0, sizeof(datos));
datos_nuevos = false;
reiniciar_procesadores();
enviar_control(COMANDO_REINICIAR_PRUEBA, prueba_activa);
Serial.println("Orden de reinicio enviada al emisor");
}
static void procesar_datos() {
if (datos.estado == 100) {
Serial.println("Prueba confirmada por el emisor");
return;
}
if (datos.estado == 101) {
Serial.println("El emisor ha reiniciado la prueba");
return;
}
switch ((tipo_prueba)datos.prueba) {
case PRUEBA_ACCELERATION: procesar_acceleration(datos); break;
case PRUEBA_SKIDPAD: procesar_skidpad(datos); break;
case PRUEBA_AUTOX_ENDURANCE: procesar_autox_endurance(datos); break;
default: Serial.println("Paquete recibido sin una prueba valida"); break;
}
}
static void recibir_datos(const esp_now_recv_info_t *info, const uint8_t *datos_emitidos, int longitud) {
if (memcmp(info->src_addr, ESPNOW_MAC_EMISOR_PRUEBAS, 6) != 0) return;
if (longitud != sizeof(paquete_datos)) return;
memcpy(&datos, datos_emitidos, sizeof(datos));
datos_nuevos = true;
}
static void leer_monitor_serie() {
while (Serial.available() > 0) {
char comando = Serial.read();
switch (comando) {
case '1': seleccionar_prueba(PRUEBA_ACCELERATION); break;
case '2': seleccionar_prueba(PRUEBA_SKIDPAD); break;
case '3': seleccionar_prueba(PRUEBA_AUTOX_ENDURANCE); break;
case '0': reiniciar_prueba(); break;
case 'm':
case 'M': mostrar_menu(); break;
case '\n':
case '\r': break;
default: Serial.println("Comando no valido. Escribe m para ver el menu"); break;
}
}
}
void setup() {
Serial.begin(115200);
WiFi.mode(WIFI_STA);
if (esp_now_init() != ESP_OK) {
Serial.println("Error iniciando ESP-NOW");
return;
}
esp_now_peer_info_t emisor = {};
memcpy(emisor.peer_addr, ESPNOW_MAC_EMISOR_PRUEBAS, 6);
emisor.channel = 0;
emisor.encrypt = false;
esp_now_register_recv_cb(recibir_datos);
if (esp_now_add_peer(&emisor) != ESP_OK) {
Serial.println("Error anadiendo el emisor de pruebas");
return;
}
Serial.println("Receptor de pruebas del box listo");
mostrar_menu();
}
void loop() {
leer_monitor_serie();
if (datos_nuevos) {
datos_nuevos = false;
procesar_datos();
}
}

View file

@ -0,0 +1,48 @@
#include <Arduino.h>
#include "skidpad.hpp"
static int ciclo = 0;
void reiniciar_receptor_skidpad() {
ciclo = 0;
}
void procesar_skidpad(const paquete_datos& datos) {
switch (datos.estado) {
case 1:
ciclo = datos.vuelta;
Serial.print("\n===== Ciclo ");
Serial.print(ciclo);
Serial.println(" =====");
Serial.println("Primera activacion: nada");
break;
case 2:
Serial.println("Segunda activacion: inicia vuelta DERECHA");
break;
case 3:
Serial.print("Vuelta DERECHA terminada: ");
Serial.print(datos.laptime_derecha / 1000.0, 3);
Serial.println(" s");
break;
case 4:
Serial.println("Cuarta activacion: inicia vuelta IZQUIERDA");
break;
case 5:
Serial.print("Vuelta IZQUIERDA terminada: ");
Serial.print(datos.laptime_izquierda / 1000.0, 3);
Serial.println(" s");
Serial.print("Media de ambas vueltas: ");
Serial.print(datos.average / 1000.0, 3);
Serial.println(" s");
break;
default:
Serial.println("Estado de Skidpad desconocido");
break;
}
}

View file

@ -0,0 +1,6 @@
#pragma once
#include "configuracion.hpp"
void procesar_skidpad(const paquete_datos& datos);
void reiniciar_receptor_skidpad();

22
Volante/AAVolante.ino Normal file
View file

@ -0,0 +1,22 @@
#include "can.hpp"
#include "led.hpp"
#include "configuracion.hpp"
CAN can;
void setup(){
Serial.begin(115200);
led_startup();
can.start();
can.start_listening_task();
}
void loop(){
}

181
Volante/can.cpp Normal file
View file

@ -0,0 +1,181 @@
#include "can.hpp"
#include "led.hpp"
#include "configuracion.hpp"
#include <Arduino.h>
static bool driver_installed = false;
void CAN::start() {
Serial.println("Starting CAN Controller...");
twai_general_config_t g_config = TWAI_GENERAL_CONFIG_DEFAULT((gpio_num_t)TX_PIN, (gpio_num_t)RX_PIN, TWAI_MODE_NORMAL);
g_config.rx_queue_len = 64;
g_config.tx_queue_len = 16;
twai_timing_config_t t_config = TWAI_TIMING_CONFIG_500KBITS();
twai_filter_config_t f_config = TWAI_FILTER_CONFIG_ACCEPT_ALL();
if (twai_driver_install(&g_config, &t_config, &f_config) != ESP_OK) {
Serial.println("Failed to install TWAI driver");
driver_installed = false;
return;
}
Serial.println("TWAI driver installed");
if (twai_start() != ESP_OK) {
Serial.println("Failed to start TWAI driver");
twai_driver_uninstall();
driver_installed = false;
return;
}
Serial.println("TWAI driver started");
uint32_t alerts_to_enable = TWAI_ALERT_RX_DATA | TWAI_ALERT_ERR_PASS | TWAI_ALERT_BUS_ERROR | TWAI_ALERT_RX_QUEUE_FULL;
if (twai_reconfigure_alerts(alerts_to_enable, nullptr) != ESP_OK) {
Serial.println("Failed to reconfigure alerts");
twai_stop();
twai_driver_uninstall();
driver_installed = false;
return;
}
Serial.println("CAN Alerts reconfigured");
driver_installed = true;
}
CAN::~CAN() {
stop_listening_task();
if (driver_installed) {
twai_stop();
twai_driver_uninstall();
driver_installed = false;
}
}
void CAN::start_listening_task() {
if (_listen_task_handle != nullptr) {
Serial.println("CAN listening task already running");
return;
}
_should_stop_listening = false;
BaseType_t result = xTaskCreate(listenTask, "CAN_Listen_Task", 4096, this, 1, &_listen_task_handle);
if (result == pdPASS) {
Serial.println("CAN listening task created successfully");
} else {
Serial.println("Failed to create CAN listening task");
_listen_task_handle = nullptr;
}
}
void CAN::stop_listening_task() {
if (_listen_task_handle == nullptr) {
return;
}
_should_stop_listening = true;
for (int i = 0; i < 100 && _listen_task_handle != nullptr; i++) {
vTaskDelay(pdMS_TO_TICKS(10));
}
if (_listen_task_handle != nullptr) {
vTaskDelete(_listen_task_handle);
_listen_task_handle = nullptr;
}
Serial.println("CAN listening task stopped");
}
void CAN::listenTask(void *arg) {
CAN *instance = static_cast<CAN *>(arg);
instance->listen_id();
instance->_listen_task_handle = nullptr;
vTaskDelete(nullptr);
}
void CAN::listen_id() {
Serial.println("CAN listening task started");
uint32_t last_can_update = 0;
while (!_should_stop_listening) {
if (!driver_installed) {
vTaskDelay(pdMS_TO_TICKS(1000));
continue;
}
uint32_t alerts_triggered = 0;
twai_read_alerts(&alerts_triggered, 0);
if (alerts_triggered & (TWAI_ALERT_ERR_PASS | TWAI_ALERT_BUS_ERROR | TWAI_ALERT_RX_QUEUE_FULL)) {
twai_status_info_t twai_status;
twai_get_status_info(&twai_status);
if (alerts_triggered & TWAI_ALERT_ERR_PASS) {
Serial.println("Alert: TWAI controller has become error passive.");
}
if (alerts_triggered & TWAI_ALERT_BUS_ERROR) {
Serial.println("Alert: A (Bit, Stuff, CRC, Form, ACK) error has occurred on the bus.");
Serial.printf("Bus error count: %lu\n", twai_status.bus_error_count);
}
if (alerts_triggered & TWAI_ALERT_RX_QUEUE_FULL) {
Serial.println("Alert: The RX queue is full causing a received frame to be lost.");
Serial.printf("RX buffered: %lu\t", twai_status.msgs_to_rx);
Serial.printf("RX missed: %lu\t", twai_status.rx_missed_count);
Serial.printf("RX overrun: %lu\n", twai_status.rx_overrun_count);
}
}
if (alerts_triggered & TWAI_ALERT_RX_DATA) {
twai_message_t message;
while (twai_receive(&message, 0) == ESP_OK && !_should_stop_listening) {
if (message.rtr || message.data_length_code < 3) {
taskYIELD();
continue;
}
switch (message.data[0]) {
case 0:
led_show_rpm(message.data[1], message.data[2]);
break;
case 1:
break;
case 2:
break;
case 3:
break;
case 100:
break;
default:
break;
}
taskYIELD();
}
}
vTaskDelay(pdMS_TO_TICKS(5));
}
Serial.println("CAN listening task ending");
}

25
Volante/can.hpp Normal file
View file

@ -0,0 +1,25 @@
#ifndef CAN_HPP
#define CAN_HPP
#include "driver/twai.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
class CAN {
public:
CAN() : _listen_task_handle(nullptr), _should_stop_listening(false) {}
~CAN();
void start();
void start_listening_task();
void stop_listening_task();
void listen_id();
private:
static void listenTask(void *arg);
TaskHandle_t _listen_task_handle;
volatile bool _should_stop_listening;
};
#endif

28
Volante/configuracion.hpp Normal file
View file

@ -0,0 +1,28 @@
#pragma once
/*
--------------------
LEDS
--------------------
*/
#define PIN_LEDS 23
#define NUM_LEDS 10
/*
--------------------
RPM LEDS
--------------------
*/
#define RPM_MIN_LED 8000
#define RPM_MAX_LED 12200
/*
--------------------
CAN
--------------------
*/
#define RX_PIN 13
#define TX_PIN 38

60
Volante/led.cpp Normal file
View file

@ -0,0 +1,60 @@
#include "led.hpp"
#include "configuracion.hpp"
#include <Adafruit_NeoPixel.h>
Adafruit_NeoPixel tira(NUM_LEDS, PIN_LEDS, NEO_GRB + NEO_KHZ800);
void led_startup() {
tira.begin();
tira.setBrightness(100);
tira.clear();
tira.show();
}
void led_show_rpm(int rpmh, int rpml) {
int rpm=(rpmh * 256) + rpml;
tira.clear();
// Por debajo de las RPM mínimas, todos apagados
if (rpm < RPM_MIN_LED) {
tira.show();
return;
}
// Por encima del máximo, todos azules
if (rpm > RPM_MAX_LED) {
tira.fill(tira.Color(0, 0, 255));
tira.show();
return;
}
// Calcula cuántos LED deben encenderse
int leds_encendidos = map(rpm, RPM_MIN_LED, RPM_MAX_LED, 1, NUM_LEDS);
leds_encendidos = constrain(leds_encendidos, 0, NUM_LEDS);
int primer_tercio = NUM_LEDS / 3;
int segundo_tercio = (NUM_LEDS * 2) / 3;
for (int i = 0; i < leds_encendidos; i++) {
if (i < primer_tercio) {
// Primer tercio: verde
tira.setPixelColor(i, tira.Color(0, 255, 0));
} else if (i < segundo_tercio) {
// Segundo tercio: amarillo
tira.setPixelColor(i, tira.Color(255, 255, 0));
} else {
// Tercer tercio: rojo
tira.setPixelColor(i, tira.Color(255, 0, 0));
}
}
tira.show();
}

4
Volante/led.hpp Normal file
View file

@ -0,0 +1,4 @@
#pragma once
void led_startup();
void led_show_rpm(int rpmh, int rpml);