mirror of
https://github.com/dalathegreat/Battery-Emulator.git
synced 2025-10-06 03:50:13 +02:00
Documentation in comments, clarifications of origin and intent
This commit is contained in:
parent
c01744edc8
commit
e952c50849
1 changed files with 21 additions and 14 deletions
|
@ -1,15 +1,18 @@
|
||||||
/* This library supports ISA Scale IVT Modular current/voltage sensor device. These devices measure current, up to three voltages, and provide temperature compensation.
|
/* Portions of this file are an adaptation of the SimpleISA library, originally authored by Jack Rickard.
|
||||||
|
*
|
||||||
|
* At present, this code supports the Scale IVT Modular current/voltage sensor device.
|
||||||
|
* These devices measure current, up to three voltages, and provide temperature compensation.
|
||||||
This library was written by Jack Rickard of EVtv - http://www.evtv.me
|
* Additional sensors are planned to provide flexibility/lower BOM costs.
|
||||||
copyright 2014
|
*
|
||||||
You are licensed to use this library for any purpose, commercial or private,
|
* Original license/copyright header of SimpleISA is shown below:
|
||||||
without restriction.
|
* This library was written by Jack Rickard of EVtv - http://www.evtv.me
|
||||||
|
* copyright 2014
|
||||||
2024 - Modified to make use of ESP32-Arduino-CAN by miwagner
|
* You are licensed to use this library for any purpose, commercial or private,
|
||||||
|
* without restriction.
|
||||||
*/
|
*
|
||||||
|
* 2024 - Modified to make use of ESP32-Arduino-CAN by miwagner
|
||||||
|
*
|
||||||
|
*/
|
||||||
#include "../include.h"
|
#include "../include.h"
|
||||||
#ifdef CHADEMO_BATTERY
|
#ifdef CHADEMO_BATTERY
|
||||||
#include "../datalayer/datalayer.h"
|
#include "../datalayer/datalayer.h"
|
||||||
|
@ -20,8 +23,10 @@
|
||||||
#include "CHADEMO-BATTERY.h"
|
#include "CHADEMO-BATTERY.h"
|
||||||
#include "CHADEMO-SHUNTS.h"
|
#include "CHADEMO-SHUNTS.h"
|
||||||
|
|
||||||
|
/* Initial frames received from ISA shunts provide invalid during initialization */
|
||||||
static int framecount = 0;
|
static int framecount = 0;
|
||||||
|
|
||||||
|
/* original variables/names/types from SimpleISA. These warrant refinement */
|
||||||
float Amperes; // Floating point with current in Amperes
|
float Amperes; // Floating point with current in Amperes
|
||||||
double AH; //Floating point with accumulated ampere-hours
|
double AH; //Floating point with accumulated ampere-hours
|
||||||
double KW;
|
double KW;
|
||||||
|
@ -43,15 +48,17 @@ double Voltage3LO;
|
||||||
double Temperature;
|
double Temperature;
|
||||||
|
|
||||||
bool firstframe;
|
bool firstframe;
|
||||||
unsigned long timestamp;
|
|
||||||
double milliamps;
|
double milliamps;
|
||||||
long watt;
|
long watt;
|
||||||
long As;
|
long As;
|
||||||
long lastAs;
|
long lastAs;
|
||||||
long wh;
|
long wh;
|
||||||
long lastWh;
|
long lastWh;
|
||||||
uint8_t page;
|
|
||||||
|
|
||||||
|
/* Output command frame used to alter or initialize ISA shunt behavior
|
||||||
|
* Please note that all delay/sleep operations are solely in this section of code,
|
||||||
|
* not used during normal operation. Such delays are currently commented out.
|
||||||
|
*/
|
||||||
CAN_frame_t outframe = {.FIR = {.B =
|
CAN_frame_t outframe = {.FIR = {.B =
|
||||||
{
|
{
|
||||||
.DLC = 8,
|
.DLC = 8,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue