2022-07-18 12:31:09 -07:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include <stdint.h>
|
|
|
|
|
2022-12-01 13:50:21 -08:00
|
|
|
#include <rusefi/fragments.h>
|
|
|
|
|
2022-08-29 17:19:30 -07:00
|
|
|
#include "wideband_config.h"
|
|
|
|
|
2022-07-18 12:31:09 -07:00
|
|
|
/* +0 offset */
|
|
|
|
struct livedata_common_s {
|
|
|
|
union {
|
|
|
|
struct {
|
|
|
|
float vbatt;
|
|
|
|
};
|
|
|
|
uint8_t pad0[32];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/* +32 offset */
|
|
|
|
struct livedata_afr_s {
|
|
|
|
union {
|
|
|
|
struct {
|
2022-12-06 16:46:07 -08:00
|
|
|
// lambda also displayed by TS as AFR, same data with different scale factor
|
|
|
|
float lambda;
|
2023-05-29 13:11:55 -07:00
|
|
|
uint16_t temperature;
|
|
|
|
uint16_t padding;
|
2023-05-03 14:51:34 -07:00
|
|
|
uint16_t nernstDc;
|
|
|
|
uint16_t nernstAc;
|
2022-07-18 12:31:09 -07:00
|
|
|
float pumpCurrentTarget;
|
|
|
|
float pumpCurrentMeasured;
|
2023-04-17 14:10:38 -07:00
|
|
|
uint16_t heaterDuty;
|
|
|
|
uint16_t heaterEffectiveVoltage;
|
2022-12-06 17:05:49 -08:00
|
|
|
float esr;
|
2022-09-20 14:50:06 -07:00
|
|
|
uint8_t fault; // See wbo::Fault
|
|
|
|
uint8_t heaterState;
|
|
|
|
} __attribute__((packed));
|
2022-07-18 12:31:09 -07:00
|
|
|
uint8_t pad[32];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
/* update functions */
|
|
|
|
void SamplingUpdateLiveData();
|