9 static const uint16_t ATM90E32_REGISTER_METEREN = 0x00;
10 static const uint16_t ATM90E32_REGISTER_CHANNELMAPI = 0x01;
11 static const uint16_t ATM90E32_REGISTER_CHANNELMAPU = 0x02;
12 static const uint16_t ATM90E32_REGISTER_SAGPEAKDETCFG = 0x05;
13 static const uint16_t ATM90E32_REGISTER_OVTH = 0x06;
14 static const uint16_t ATM90E32_REGISTER_ZXCONFIG = 0x07;
15 static const uint16_t ATM90E32_REGISTER_SAGTH = 0x08;
16 static const uint16_t ATM90E32_REGISTER_PHASELOSSTH = 0x09;
17 static const uint16_t ATM90E32_REGISTER_INWARNTH = 0x0A;
18 static const uint16_t ATM90E32_REGISTER_OITH = 0x0B;
19 static const uint16_t ATM90E32_REGISTER_FREQLOTH = 0x0C;
20 static const uint16_t ATM90E32_REGISTER_FREQHITH = 0x0D;
21 static const uint16_t ATM90E32_REGISTER_PMPWRCTRL = 0x0E;
22 static const uint16_t ATM90E32_REGISTER_IRQ0MERGECFG = 0x0F;
25 static const uint16_t ATM90E32_REGISTER_SOFTRESET = 0x70;
26 static const uint16_t ATM90E32_REGISTER_EMMSTATE0 = 0x71;
27 static const uint16_t ATM90E32_REGISTER_EMMSTATE1 = 0x72;
28 static const uint16_t ATM90E32_REGISTER_EMMINTSTATE0 = 0x73;
29 static const uint16_t ATM90E32_REGISTER_EMMINTSTATE1 = 0x74;
30 static const uint16_t ATM90E32_REGISTER_EMMINTEN0 = 0x75;
31 static const uint16_t ATM90E32_REGISTER_EMMINTEN1 = 0x76;
32 static const uint16_t ATM90E32_REGISTER_LASTSPIDATA = 0x78;
33 static const uint16_t ATM90E32_REGISTER_CRCERRSTATUS = 0x79;
34 static const uint16_t ATM90E32_REGISTER_CRCDIGEST = 0x7A;
35 static const uint16_t ATM90E32_REGISTER_CFGREGACCEN = 0x7F;
36 static const uint16_t ATM90E32_STATUS_S0_OIPHASEAST = 1 << 15;
37 static const uint16_t ATM90E32_STATUS_S0_OIPHASEBST = 1 << 14;
38 static const uint16_t ATM90E32_STATUS_S0_OIPHASECST = 1 << 13;
39 static const uint16_t ATM90E32_STATUS_S0_OVPHASEAST = 1 << 12;
40 static const uint16_t ATM90E32_STATUS_S0_OVPHASEBST = 1 << 11;
41 static const uint16_t ATM90E32_STATUS_S0_OVPHASECST = 1 << 10;
42 static const uint16_t ATM90E32_STATUS_S0_UREVWNST = 1 << 9;
43 static const uint16_t ATM90E32_STATUS_S0_IREVWNST = 1 << 8;
44 static const uint16_t ATM90E32_STATUS_S0_INOV0ST = 1 << 7;
45 static const uint16_t ATM90E32_STATUS_S0_TQNOLOADST = 1 << 6;
46 static const uint16_t ATM90E32_STATUS_S0_TPNOLOADST = 1 << 5;
47 static const uint16_t ATM90E32_STATUS_S0_TASNOLOADST = 1 << 4;
48 static const uint16_t ATM90E32_STATUS_S0_CF1REVST = 1 << 3;
49 static const uint16_t ATM90E32_STATUS_S0_CF2REVST = 1 << 2;
50 static const uint16_t ATM90E32_STATUS_S0_CF3REVST = 1 << 1;
51 static const uint16_t ATM90E32_STATUS_S0_CF4REVST = 1 << 0;
52 static const uint16_t ATM90E32_STATUS_S1_FREQHIST = 1 << 15;
53 static const uint16_t ATM90E32_STATUS_S1_SAGPHASEAST = 1 << 14;
54 static const uint16_t ATM90E32_STATUS_S1_SAGPHASEBST = 1 << 13;
55 static const uint16_t ATM90E32_STATUS_S1_SAGPHASECST = 1 << 12;
56 static const uint16_t ATM90E32_STATUS_S1_FREQLOST = 1 << 11;
57 static const uint16_t ATM90E32_STATUS_S1_PHASELOSSAST = 1 << 10;
58 static const uint16_t ATM90E32_STATUS_S1_PHASELOSSBST = 1 << 9;
59 static const uint16_t ATM90E32_STATUS_S1_PHASELOSSCST = 1 << 8;
60 static const uint16_t ATM90E32_STATUS_S1_QEREGTPST = 1 << 7;
61 static const uint16_t ATM90E32_STATUS_S1_QEREGAPST = 1 << 6;
62 static const uint16_t ATM90E32_STATUS_S1_QEREGBPST = 1 << 5;
63 static const uint16_t ATM90E32_STATUS_S1_QEREGCPST = 1 << 4;
64 static const uint16_t ATM90E32_STATUS_S1_PEREGTPST = 1 << 3;
65 static const uint16_t ATM90E32_STATUS_S1_PEREGAPST = 1 << 2;
66 static const uint16_t ATM90E32_STATUS_S1_PEREGBPST = 1 << 1;
67 static const uint16_t ATM90E32_STATUS_S1_PEREGCPST = 1 << 0;
70 static const uint16_t ATM90E32_REGISTER_DETECTCTRL = 0x10;
71 static const uint16_t ATM90E32_REGISTER_DETECTTH1 = 0x11;
72 static const uint16_t ATM90E32_REGISTER_DETECTTH2 = 0x12;
73 static const uint16_t ATM90E32_REGISTER_DETECTTH3 = 0x13;
74 static const uint16_t ATM90E32_REGISTER_PMOFFSETA = 0x14;
75 static const uint16_t ATM90E32_REGISTER_PMOFFSETB = 0x15;
76 static const uint16_t ATM90E32_REGISTER_PMOFFSETC = 0x16;
77 static const uint16_t ATM90E32_REGISTER_PMPGA = 0x17;
78 static const uint16_t ATM90E32_REGISTER_PMIRMSA = 0x18;
79 static const uint16_t ATM90E32_REGISTER_PMIRMSB = 0x19;
80 static const uint16_t ATM90E32_REGISTER_PMIRMSC = 0x1A;
81 static const uint16_t ATM90E32_REGISTER_PMCONFIG = 0x10B;
82 static const uint16_t ATM90E32_REGISTER_PMAVGSAMPLES = 0x1C;
83 static const uint16_t ATM90E32_REGISTER_PMIRMSLSB = 0x1D;
86 static const uint16_t ATM90E32_REGISTER_PLCONSTH = 0x31;
87 static const uint16_t ATM90E32_REGISTER_PLCONSTL = 0x32;
88 static const uint16_t ATM90E32_REGISTER_MMODE0 = 0x33;
89 static const uint16_t ATM90E32_REGISTER_MMODE1 = 0x34;
90 static const uint16_t ATM90E32_REGISTER_PSTARTTH = 0x35;
91 static const uint16_t ATM90E32_REGISTER_QSTARTTH = 0x36;
92 static const uint16_t ATM90E32_REGISTER_SSTARTTH = 0x37;
93 static const uint16_t ATM90E32_REGISTER_PPHASETH = 0x38;
94 static const uint16_t ATM90E32_REGISTER_QPHASETH = 0x39;
95 static const uint16_t ATM90E32_REGISTER_SPHASETH = 0x3A;
98 static const uint16_t ATM90E32_REGISTER_POFFSETA = 0x41;
99 static const uint16_t ATM90E32_REGISTER_QOFFSETA = 0x42;
100 static const uint16_t ATM90E32_REGISTER_POFFSETB = 0x43;
101 static const uint16_t ATM90E32_REGISTER_QOFFSETB = 0x44;
102 static const uint16_t ATM90E32_REGISTER_POFFSETC = 0x45;
103 static const uint16_t ATM90E32_REGISTER_QOFFSETC = 0x46;
104 static const uint16_t ATM90E32_REGISTER_PQGAINA = 0x47;
105 static const uint16_t ATM90E32_REGISTER_PHIA = 0x48;
106 static const uint16_t ATM90E32_REGISTER_PQGAINB = 0x49;
107 static const uint16_t ATM90E32_REGISTER_PHIB = 0x4A;
108 static const uint16_t ATM90E32_REGISTER_PQGAINC = 0x4B;
109 static const uint16_t ATM90E32_REGISTER_PHIC = 0x4C;
112 static const uint16_t ATM90E32_REGISTER_POFFSETAF = 0x51;
113 static const uint16_t ATM90E32_REGISTER_POFFSETBF = 0x52;
114 static const uint16_t ATM90E32_REGISTER_POFFSETCF = 0x53;
115 static const uint16_t ATM90E32_REGISTER_PGAINAF = 0x54;
116 static const uint16_t ATM90E32_REGISTER_PGAINBF = 0x55;
117 static const uint16_t ATM90E32_REGISTER_PGAINCF = 0x56;
120 static const uint16_t ATM90E32_REGISTER_UGAINA = 0x61;
121 static const uint16_t ATM90E32_REGISTER_IGAINA = 0x62;
122 static const uint16_t ATM90E32_REGISTER_UOFFSETA = 0x63;
123 static const uint16_t ATM90E32_REGISTER_IOFFSETA = 0x64;
124 static const uint16_t ATM90E32_REGISTER_UGAINB = 0x65;
125 static const uint16_t ATM90E32_REGISTER_IGAINB = 0x66;
126 static const uint16_t ATM90E32_REGISTER_UOFFSETB = 0x67;
127 static const uint16_t ATM90E32_REGISTER_IOFFSETB = 0x68;
128 static const uint16_t ATM90E32_REGISTER_UGAINC = 0x69;
129 static const uint16_t ATM90E32_REGISTER_IGAINC = 0x6A;
130 static const uint16_t ATM90E32_REGISTER_UOFFSETC = 0x6B;
131 static const uint16_t ATM90E32_REGISTER_IOFFSETC = 0x6C;
132 static const uint16_t ATM90E32_REGISTER_IOFFSETN = 0x6E;
135 static const uint16_t ATM90E32_REGISTER_APENERGYT = 0x80;
136 static const uint16_t ATM90E32_REGISTER_APENERGY = 0x81;
137 static const uint16_t ATM90E32_REGISTER_APENERGYA = 0x81;
138 static const uint16_t ATM90E32_REGISTER_APENERGYB = 0x82;
139 static const uint16_t ATM90E32_REGISTER_APENERGYC = 0x83;
140 static const uint16_t ATM90E32_REGISTER_ANENERGYT = 0x84;
141 static const uint16_t ATM90E32_REGISTER_ANENERGY = 0x85;
142 static const uint16_t ATM90E32_REGISTER_ANENERGYA = 0x85;
143 static const uint16_t ATM90E32_REGISTER_ANENERGYB = 0x86;
144 static const uint16_t ATM90E32_REGISTER_ANENERGYC = 0x87;
145 static const uint16_t ATM90E32_REGISTER_RPENERGYT = 0x88;
146 static const uint16_t ATM90E32_REGISTER_RPENERGYA = 0x89;
147 static const uint16_t ATM90E32_REGISTER_RPENERGYB = 0x8A;
148 static const uint16_t ATM90E32_REGISTER_RPENERGYC = 0x8B;
149 static const uint16_t ATM90E32_REGISTER_RNENERGYT = 0x8C;
150 static const uint16_t ATM90E32_REGISTER_RNENERGYA = 0x8D;
151 static const uint16_t ATM90E32_REGISTER_RNENERGYB = 0x8E;
152 static const uint16_t ATM90E32_REGISTER_RNENERGYC = 0x8F;
154 static const uint16_t ATM90E32_REGISTER_SAENERGYT = 0x90;
155 static const uint16_t ATM90E32_REGISTER_SENERGYA = 0x91;
156 static const uint16_t ATM90E32_REGISTER_SENERGYB = 0x92;
157 static const uint16_t ATM90E32_REGISTER_SENERGYC = 0x93;
160 static const uint16_t ATM90E32_REGISTER_APENERGYTF = 0xA0;
161 static const uint16_t ATM90E32_REGISTER_APENERGYAF = 0xA1;
162 static const uint16_t ATM90E32_REGISTER_APENERGYBF = 0xA2;
163 static const uint16_t ATM90E32_REGISTER_APENERGYCF = 0xA3;
164 static const uint16_t ATM90E32_REGISTER_ANENERGYTF = 0xA4;
165 static const uint16_t ATM90E32_REGISTER_ANENERGYAF = 0xA5;
166 static const uint16_t ATM90E32_REGISTER_ANENERGYBF = 0xA6;
167 static const uint16_t ATM90E32_REGISTER_ANENERGYCF = 0xA7;
168 static const uint16_t ATM90E32_REGISTER_APENERGYTH = 0xA8;
169 static const uint16_t ATM90E32_REGISTER_APENERGYAH = 0xA9;
170 static const uint16_t ATM90E32_REGISTER_APENERGYBH = 0xAA;
171 static const uint16_t ATM90E32_REGISTER_APENERGYCH = 0xAB;
172 static const uint16_t ATM90E32_REGISTER_ANENERGYTH = 0xAC;
173 static const uint16_t ATM90E32_REGISTER_ANENERGYAH = 0xAD;
174 static const uint16_t ATM90E32_REGISTER_ANENERGYBH = 0xAE;
175 static const uint16_t ATM90E32_REGISTER_ANENERGYCH = 0xAF;
178 static const uint16_t ATM90E32_REGISTER_PMEANT = 0xB0;
179 static const uint16_t ATM90E32_REGISTER_PMEAN = 0xB1;
180 static const uint16_t ATM90E32_REGISTER_PMEANA = 0xB1;
181 static const uint16_t ATM90E32_REGISTER_PMEANB = 0xB2;
182 static const uint16_t ATM90E32_REGISTER_PMEANC = 0xB3;
183 static const uint16_t ATM90E32_REGISTER_QMEANT = 0xB4;
184 static const uint16_t ATM90E32_REGISTER_QMEAN = 0xB5;
185 static const uint16_t ATM90E32_REGISTER_QMEANA = 0xB5;
186 static const uint16_t ATM90E32_REGISTER_QMEANB = 0xB6;
187 static const uint16_t ATM90E32_REGISTER_QMEANC = 0xB7;
188 static const uint16_t ATM90E32_REGISTER_SMEANT = 0xB8;
189 static const uint16_t ATM90E32_REGISTER_SMEANA = 0xB9;
190 static const uint16_t ATM90E32_REGISTER_SMEANB = 0xBA;
191 static const uint16_t ATM90E32_REGISTER_SMEANC = 0xBB;
192 static const uint16_t ATM90E32_REGISTER_PFMEANT = 0xBC;
193 static const uint16_t ATM90E32_REGISTER_PFMEAN = 0xBD;
194 static const uint16_t ATM90E32_REGISTER_PFMEANA = 0xBD;
195 static const uint16_t ATM90E32_REGISTER_PFMEANB = 0xBE;
196 static const uint16_t ATM90E32_REGISTER_PFMEANC = 0xBF;
198 static const uint16_t ATM90E32_REGISTER_PMEANTLSB = 0xC0;
199 static const uint16_t ATM90E32_REGISTER_PMEANLSB = 0xC1;
200 static const uint16_t ATM90E32_REGISTER_PMEANALSB = 0xC1;
201 static const uint16_t ATM90E32_REGISTER_PMEANBLSB = 0xC2;
202 static const uint16_t ATM90E32_REGISTER_PMEANCLSB = 0xC3;
203 static const uint16_t ATM90E32_REGISTER_QMEANTLSB = 0xC4;
204 static const uint16_t ATM90E32_REGISTER_QMEANLSB = 0xC5;
205 static const uint16_t ATM90E32_REGISTER_QMEANALSB = 0xC5;
206 static const uint16_t ATM90E32_REGISTER_QMEANBLSB = 0xC6;
207 static const uint16_t ATM90E32_REGISTER_QMEANCLSB = 0xC7;
208 static const uint16_t ATM90E32_REGISTER_SAMEANTLSB = 0xC8;
209 static const uint16_t ATM90E32_REGISTER_SMEANALSB = 0xC9;
210 static const uint16_t ATM90E32_REGISTER_SMEANBLSB = 0xCA;
211 static const uint16_t ATM90E32_REGISTER_SMEANCLSB = 0xCB;
214 static const uint16_t ATM90E32_REGISTER_PMEANTF = 0xD0;
215 static const uint16_t ATM90E32_REGISTER_PMEANAF = 0xD1;
216 static const uint16_t ATM90E32_REGISTER_PMEANBF = 0xD2;
217 static const uint16_t ATM90E32_REGISTER_PMEANCF = 0xD3;
218 static const uint16_t ATM90E32_REGISTER_PMEANTH = 0xD4;
219 static const uint16_t ATM90E32_REGISTER_PMEANH = 0xD5;
220 static const uint16_t ATM90E32_REGISTER_PMEANAH = 0xD5;
221 static const uint16_t ATM90E32_REGISTER_PMEANBH = 0xD6;
222 static const uint16_t ATM90E32_REGISTER_PMEANCH = 0xD7;
223 static const uint16_t ATM90E32_REGISTER_URMS = 0xD9;
224 static const uint16_t ATM90E32_REGISTER_URMSA = 0xD9;
225 static const uint16_t ATM90E32_REGISTER_URMSB = 0xDA;
226 static const uint16_t ATM90E32_REGISTER_URMSC = 0xDB;
227 static const uint16_t ATM90E32_REGISTER_IRMS = 0xDD;
228 static const uint16_t ATM90E32_REGISTER_IRMSA = 0xDD;
229 static const uint16_t ATM90E32_REGISTER_IRMSB = 0xDE;
230 static const uint16_t ATM90E32_REGISTER_IRMSC = 0xDF;
231 static const uint16_t ATM90E32_REGISTER_IRMSN = 0xD8;
233 static const uint16_t ATM90E32_REGISTER_PMEANTFLSB = 0xE0;
234 static const uint16_t ATM90E32_REGISTER_PMEANAFLSB = 0xE1;
235 static const uint16_t ATM90E32_REGISTER_PMEANBFLSB = 0xE2;
236 static const uint16_t ATM90E32_REGISTER_PMEANCFLSB = 0xE3;
237 static const uint16_t ATM90E32_REGISTER_PMEANTHLSB = 0xE4;
238 static const uint16_t ATM90E32_REGISTER_PMEANHLSB = 0xE5;
239 static const uint16_t ATM90E32_REGISTER_PMEANAHLSB = 0xE5;
240 static const uint16_t ATM90E32_REGISTER_PMEANBHLSB = 0xE6;
241 static const uint16_t ATM90E32_REGISTER_PMEANCHLSB = 0xE7;
242 static const uint16_t ATM90E32_REGISTER_URMSLSB = 0xE9;
243 static const uint16_t ATM90E32_REGISTER_URMSALSB = 0xE9;
244 static const uint16_t ATM90E32_REGISTER_URMSBLSB = 0xEA;
245 static const uint16_t ATM90E32_REGISTER_URMSCLSB = 0xEB;
246 static const uint16_t ATM90E32_REGISTER_IRMSLSB = 0xED;
247 static const uint16_t ATM90E32_REGISTER_IRMSALSB = 0xED;
248 static const uint16_t ATM90E32_REGISTER_IRMSBLSB = 0xEE;
249 static const uint16_t ATM90E32_REGISTER_IRMSCLSB = 0xEF;
252 static const uint16_t ATM90E32_REGISTER_UPEAKA = 0xF1;
253 static const uint16_t ATM90E32_REGISTER_UPEAKB = 0xF2;
254 static const uint16_t ATM90E32_REGISTER_UPEAKC = 0xF3;
255 static const uint16_t ATM90E32_REGISTER_IPEAK = 0xF5;
256 static const uint16_t ATM90E32_REGISTER_IPEAKA = 0xF5;
257 static const uint16_t ATM90E32_REGISTER_IPEAKB = 0xF6;
258 static const uint16_t ATM90E32_REGISTER_IPEAKC = 0xF7;
259 static const uint16_t ATM90E32_REGISTER_FREQ = 0xF8;
260 static const uint16_t ATM90E32_REGISTER_PANGLE = 0xF9;
261 static const uint16_t ATM90E32_REGISTER_PANGLEA = 0xF9;
262 static const uint16_t ATM90E32_REGISTER_PANGLEB = 0xFA;
263 static const uint16_t ATM90E32_REGISTER_PANGLEC = 0xFB;
264 static const uint16_t ATM90E32_REGISTER_TEMP = 0xFC;
265 static const uint16_t ATM90E32_REGISTER_UANGLEA = 0xFD;
266 static const uint16_t ATM90E32_REGISTER_UANGLEB = 0xFE;
267 static const uint16_t ATM90E32_REGISTER_UANGLEC = 0xFF;
Implementation of SPI Controller mode.