ESPHome  2024.11.0
atm90e26_reg.h
Go to the documentation of this file.
1 #pragma once
2 
3 namespace esphome {
4 namespace atm90e26 {
5 
6 /* Status and Special Register */
7 static const uint8_t ATM90E26_REGISTER_SOFTRESET = 0x00; // Software Reset
8 static const uint8_t ATM90E26_REGISTER_SYSSTATUS = 0x01; // System Status
9 static const uint8_t ATM90E26_REGISTER_FUNCEN = 0x02; // Function Enable
10 static const uint8_t ATM90E26_REGISTER_SAGTH = 0x03; // Voltage Sag Threshold
11 static const uint8_t ATM90E26_REGISTER_SMALLPMOD = 0x04; // Small-Power Mode
12 static const uint8_t ATM90E26_REGISTER_LASTDATA = 0x06; // Last Read/Write SPI/UART Value
13 
14 /* Metering Calibration and Configuration Register */
15 static const uint8_t ATM90E26_REGISTER_LSB = 0x08; // RMS/Power 16-bit LSB
16 static const uint8_t ATM90E26_REGISTER_CALSTART = 0x20; // Calibration Start Command
17 static const uint8_t ATM90E26_REGISTER_PLCONSTH = 0x21; // High Word of PL_Constant
18 static const uint8_t ATM90E26_REGISTER_PLCONSTL = 0x22; // Low Word of PL_Constant
19 static const uint8_t ATM90E26_REGISTER_LGAIN = 0x23; // L Line Calibration Gain
20 static const uint8_t ATM90E26_REGISTER_LPHI = 0x24; // L Line Calibration Angle
21 static const uint8_t ATM90E26_REGISTER_NGAIN = 0x25; // N Line Calibration Gain
22 static const uint8_t ATM90E26_REGISTER_NPHI = 0x26; // N Line Calibration Angle
23 static const uint8_t ATM90E26_REGISTER_PSTARTTH = 0x27; // Active Startup Power Threshold
24 static const uint8_t ATM90E26_REGISTER_PNOLTH = 0x28; // Active No-Load Power Threshold
25 static const uint8_t ATM90E26_REGISTER_QSTARTTH = 0x29; // Reactive Startup Power Threshold
26 static const uint8_t ATM90E26_REGISTER_QNOLTH = 0x2A; // Reactive No-Load Power Threshold
27 static const uint8_t ATM90E26_REGISTER_MMODE = 0x2B; // Metering Mode Configuration
28 static const uint8_t ATM90E26_REGISTER_CS1 = 0x2C; // Checksum 1
29 
30 /* Measurement Calibration Register */
31 static const uint8_t ATM90E26_REGISTER_ADJSTART = 0x30; // Measurement Calibration Start Command
32 static const uint8_t ATM90E26_REGISTER_UGAIN = 0x31; // Voltage RMS Gain
33 static const uint8_t ATM90E26_REGISTER_IGAINL = 0x32; // L Line Current RMS Gain
34 static const uint8_t ATM90E26_REGISTER_IGAINN = 0x33; // N Line Current RMS Gain
35 static const uint8_t ATM90E26_REGISTER_UOFFSET = 0x34; // Voltage Offset
36 static const uint8_t ATM90E26_REGISTER_IOFFSETL = 0x35; // L Line Current Offset
37 static const uint8_t ATM90E26_REGISTER_IOFFSETN = 0x36; // N Line Current Offse
38 static const uint8_t ATM90E26_REGISTER_POFFSETL = 0x37; // L Line Active Power Offset
39 static const uint8_t ATM90E26_REGISTER_QOFFSETL = 0x38; // L Line Reactive Power Offset
40 static const uint8_t ATM90E26_REGISTER_POFFSETN = 0x39; // N Line Active Power Offset
41 static const uint8_t ATM90E26_REGISTER_QOFFSETN = 0x3A; // N Line Reactive Power Offset
42 static const uint8_t ATM90E26_REGISTER_CS2 = 0x3B; // Checksum 2
43 
44 /* Energy Register */
45 static const uint8_t ATM90E26_REGISTER_APENERGY = 0x40; // Forward Active Energy
46 static const uint8_t ATM90E26_REGISTER_ANENERGY = 0x41; // Reverse Active Energy
47 static const uint8_t ATM90E26_REGISTER_ATENERGY = 0x42; // Absolute Active Energy
48 static const uint8_t ATM90E26_REGISTER_RPENERGY = 0x43; // Forward (Inductive) Reactive Energy
49 static const uint8_t ATM90E26_REGISTER_RNENERG = 0x44; // Reverse (Capacitive) Reactive Energy
50 static const uint8_t ATM90E26_REGISTER_RTENERGY = 0x45; // Absolute Reactive Energy
51 static const uint8_t ATM90E26_REGISTER_ENSTATUS = 0x46; // Metering Status
52 
53 /* Measurement Register */
54 static const uint8_t ATM90E26_REGISTER_IRMS = 0x48; // L Line Current RMS
55 static const uint8_t ATM90E26_REGISTER_URMS = 0x49; // Voltage RMS
56 static const uint8_t ATM90E26_REGISTER_PMEAN = 0x4A; // L Line Mean Active Power
57 static const uint8_t ATM90E26_REGISTER_QMEAN = 0x4B; // L Line Mean Reactive Power
58 static const uint8_t ATM90E26_REGISTER_FREQ = 0x4C; // Voltage Frequency
59 static const uint8_t ATM90E26_REGISTER_POWERF = 0x4D; // L Line Power Factor
60 static const uint8_t ATM90E26_REGISTER_PANGLE = 0x4E; // Phase Angle between Voltage and L Line Current
61 static const uint8_t ATM90E26_REGISTER_SMEAN = 0x4F; // L Line Mean Apparent Power
62 static const uint8_t ATM90E26_REGISTER_IRMS2 = 0x68; // N Line Current rms
63 static const uint8_t ATM90E26_REGISTER_PMEAN2 = 0x6A; // N Line Mean Active Power
64 static const uint8_t ATM90E26_REGISTER_QMEAN2 = 0x6B; // N Line Mean Reactive Power
65 static const uint8_t ATM90E26_REGISTER_POWERF2 = 0x6D; // N Line Power Factor
66 static const uint8_t ATM90E26_REGISTER_PANGLE2 = 0x6E; // Phase Angle between Voltage and N Line Current
67 static const uint8_t ATM90E26_REGISTER_SMEAN2 = 0x6F; // N Line Mean Apparent Power
68 
69 } // namespace atm90e26
70 } // namespace esphome
Implementation of SPI Controller mode.
Definition: a01nyub.cpp:7