mirror of
https://github.com/adrigongv23/G26---Telemetry-Software.git
synced 2026-08-25 19:43:16 +02:00
48 lines
1.7 KiB
C++
48 lines
1.7 KiB
C++
#ifndef DATAPROCESSOR_HPP
|
|
#define DATAPROCESSOR_HPP
|
|
|
|
#include "common_libraries.hpp"
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/semphr.h"
|
|
|
|
|
|
class DataProcessor {
|
|
public:
|
|
DataProcessor() = default;
|
|
|
|
//Variables publicas para el CAN
|
|
//Confirmadas: llegan en la trama 0
|
|
volatile int current_ect_value = 0;
|
|
volatile int current_rpm_value = 0;
|
|
volatile float current_vbatt_value = 0.0;
|
|
|
|
volatile float current_tps_value = 0.0;
|
|
volatile float current_freno_del_value = 0.0; // presion freno delantero, bar (instalado)
|
|
volatile float current_pcomb_value = 0.0; // bar
|
|
volatile float current_taceite_value = 0.0; // grados C
|
|
volatile float current_paceite_value = 0.0; // bar
|
|
volatile float current_map_value = 0.0; // kPa
|
|
volatile float current_lambda_value = 0.0;
|
|
volatile float current_lambda_obj_value = 0.0;
|
|
|
|
// Pendientes de montar/configurar en el coche
|
|
volatile float current_freno_tra_value = 0.0; // presion freno trasero, bar
|
|
volatile float current_velocidad_value = 0.0; // km/h
|
|
|
|
//Métodos de recepción de CAN
|
|
|
|
void send_serial_frame_0(int rpmh, int rpml, int tpsh, int tpsl, int vbatth, int vbattl, int ect);
|
|
void send_serial_frame_1(int lmbh, int lmbl, int lmbth, int lmbtl, int fuelh, int fuell, int gear);
|
|
void send_serial_frame_2(int shut, int fan, int lmbch, int lmbcl, int brakeh, int brakel, int aux1);
|
|
void send_serial_frame_3(int oilth, int oiltl, int oilph, int oilpl, int maph, int mapl, int dig1);
|
|
void send_serial_frame_4(int dig3, int dig4, int dig5, int dig6, int dig7, int dig8, int dig9);
|
|
|
|
//Métodos extras
|
|
void send_serial(byte type, unsigned int value);
|
|
|
|
char* process(std::vector<float> data);
|
|
|
|
private:
|
|
};
|
|
|
|
#endif
|