From 4065d4f5d506d7a0e562e98b06d2afd01e529df6 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Fri, 10 Jul 2020 14:53:45 +0200 Subject: add resistive load driver for energy measurement device evaluation --- include/driver/resistive_load.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) create mode 100644 include/driver/resistive_load.h (limited to 'include/driver/resistive_load.h') diff --git a/include/driver/resistive_load.h b/include/driver/resistive_load.h new file mode 100644 index 0000000..74725ac --- /dev/null +++ b/include/driver/resistive_load.h @@ -0,0 +1,35 @@ +#ifndef RESISTIVE_LOAD_H +#define RESISTIVE_LOAD_H + +/* + * Resistance at 25°c + * R1: 986R + * R2: 3K25 + * R3: 46K3 + * R4: 9K86 + */ + +class ResistiveLoad { + private: + ResistiveLoad(const ResistiveLoad ©); + + public: + ResistiveLoad() {} + void setup(); + void switchToNone(); + void switchTo750(); // 576R (R1 || R2) + void switchTo1K0(); // 986R (R1) + void switchTo2K4(); // 2K44 (R2 || 4) + void switchTo3K3(); // 3K25 (R2) + void switchTo10K(); // 9K86 (R4) + void switchTo47K(); // 46K3 (R3) + void nop1K0(unsigned int duration_ms); + void nop2K4(unsigned int duration_ms); + void nop3K3(unsigned int duration_ms); + void nop10K(unsigned int duration_ms); + void nop47K(unsigned int duration_ms); +}; + +extern ResistiveLoad resistiveLoad; + +#endif -- cgit v1.2.3