CT Card now inherit expansion card
This commit is contained in:
parent
e380606742
commit
594ea6bf54
|
@ -8,8 +8,8 @@
|
|||
"args": [],
|
||||
"stopAtEntry": false,
|
||||
"externalConsole": true,
|
||||
"cwd": "d:/Git/ESPMegaPRO-v3-SDK/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO",
|
||||
"program": "d:/Git/ESPMegaPRO-v3-SDK/ESPMegaPRO-OS-SDK/lib/ESPMegaPRO/build/Debug/outDebug",
|
||||
"cwd": "d:/Git/ESPMegaPRO-v3-SDK/ESPMegaPRO-OS-SDK/src",
|
||||
"program": "d:/Git/ESPMegaPRO-v3-SDK/ESPMegaPRO-OS-SDK/src/build/Debug/outDebug",
|
||||
"MIMode": "gdb",
|
||||
"miDebuggerPath": "gdb",
|
||||
"setupCommands": [
|
||||
|
|
|
@ -14,9 +14,14 @@ void CurrentTransformerCard::bindFRAM(FRAM *fram, uint32_t framAddress)
|
|||
this->framAddress = framAddress;
|
||||
}
|
||||
|
||||
void CurrentTransformerCard::begin()
|
||||
bool CurrentTransformerCard::begin()
|
||||
{
|
||||
// Is analogCard a nullptr?
|
||||
if (this->analogCard == nullptr) {
|
||||
return false;
|
||||
}
|
||||
this->beginConversion();
|
||||
return true;
|
||||
}
|
||||
|
||||
void CurrentTransformerCard::loop()
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
#pragma once
|
||||
#include <AnalogCard.hpp>
|
||||
#include <ExpansionCard.hpp>
|
||||
#include <FRAM.h>
|
||||
#include <map>
|
||||
|
||||
|
@ -10,12 +11,12 @@
|
|||
* Also supports storing energy to FRAM.
|
||||
*/
|
||||
|
||||
class CurrentTransformerCard
|
||||
class CurrentTransformerCard : public ExpansionCard
|
||||
{
|
||||
public:
|
||||
CurrentTransformerCard(AnalogCard* analogCard, uint8_t pin, float *voltage, std::function<float(uint16_t)> adcToCurrent, uint32_t conversionInterval);
|
||||
void bindFRAM(FRAM *fram, uint32_t framAddress); // Takes 16 bytes of FRAM (long double energy)
|
||||
void begin();
|
||||
bool begin();
|
||||
void loop();
|
||||
void beginConversion();
|
||||
void setEnergy(float energy);
|
||||
|
|
Loading…
Reference in New Issue