Commit | Line | Data |
---|---|---|
b2441318 | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
37e3be9d CO |
2 | #ifndef _METER_H |
3 | #define _METER_H | |
4 | ||
06458e27 | 5 | #include <linux/iio/sysfs.h> |
09434ef7 BS |
6 | |
7 | /* metering ic types of attribute */ | |
8 | ||
9 | #define IIO_DEV_ATTR_CURRENT_A_OFFSET(_mode, _show, _store, _addr) \ | |
10 | IIO_DEVICE_ATTR(current_a_offset, _mode, _show, _store, _addr) | |
11 | ||
12 | #define IIO_DEV_ATTR_CURRENT_B_OFFSET(_mode, _show, _store, _addr) \ | |
13 | IIO_DEVICE_ATTR(current_b_offset, _mode, _show, _store, _addr) | |
14 | ||
15 | #define IIO_DEV_ATTR_CURRENT_C_OFFSET(_mode, _show, _store, _addr) \ | |
16 | IIO_DEVICE_ATTR(current_c_offset, _mode, _show, _store, _addr) | |
17 | ||
18 | #define IIO_DEV_ATTR_VOLT_A_OFFSET(_mode, _show, _store, _addr) \ | |
19 | IIO_DEVICE_ATTR(volt_a_offset, _mode, _show, _store, _addr) | |
20 | ||
21 | #define IIO_DEV_ATTR_VOLT_B_OFFSET(_mode, _show, _store, _addr) \ | |
22 | IIO_DEVICE_ATTR(volt_b_offset, _mode, _show, _store, _addr) | |
23 | ||
24 | #define IIO_DEV_ATTR_VOLT_C_OFFSET(_mode, _show, _store, _addr) \ | |
25 | IIO_DEVICE_ATTR(volt_c_offset, _mode, _show, _store, _addr) | |
26 | ||
8594e07c | 27 | #define IIO_DEV_ATTR_REACTIVE_POWER_A_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
28 | IIO_DEVICE_ATTR(reactive_power_a_offset, _mode, _show, _store, _addr) |
29 | ||
8594e07c | 30 | #define IIO_DEV_ATTR_REACTIVE_POWER_B_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
31 | IIO_DEVICE_ATTR(reactive_power_b_offset, _mode, _show, _store, _addr) |
32 | ||
8594e07c | 33 | #define IIO_DEV_ATTR_REACTIVE_POWER_C_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
34 | IIO_DEVICE_ATTR(reactive_power_c_offset, _mode, _show, _store, _addr) |
35 | ||
8594e07c | 36 | #define IIO_DEV_ATTR_ACTIVE_POWER_A_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
37 | IIO_DEVICE_ATTR(active_power_a_offset, _mode, _show, _store, _addr) |
38 | ||
8594e07c | 39 | #define IIO_DEV_ATTR_ACTIVE_POWER_B_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
40 | IIO_DEVICE_ATTR(active_power_b_offset, _mode, _show, _store, _addr) |
41 | ||
8594e07c | 42 | #define IIO_DEV_ATTR_ACTIVE_POWER_C_OFFSET(_mode, _show, _store, _addr) \ |
09434ef7 BS |
43 | IIO_DEVICE_ATTR(active_power_c_offset, _mode, _show, _store, _addr) |
44 | ||
8594e07c | 45 | #define IIO_DEV_ATTR_CURRENT_A_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
46 | IIO_DEVICE_ATTR(current_a_gain, _mode, _show, _store, _addr) |
47 | ||
8594e07c | 48 | #define IIO_DEV_ATTR_CURRENT_B_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
49 | IIO_DEVICE_ATTR(current_b_gain, _mode, _show, _store, _addr) |
50 | ||
8594e07c | 51 | #define IIO_DEV_ATTR_CURRENT_C_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
52 | IIO_DEVICE_ATTR(current_c_gain, _mode, _show, _store, _addr) |
53 | ||
8594e07c | 54 | #define IIO_DEV_ATTR_APPARENT_POWER_A_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
55 | IIO_DEVICE_ATTR(apparent_power_a_gain, _mode, _show, _store, _addr) |
56 | ||
8594e07c | 57 | #define IIO_DEV_ATTR_APPARENT_POWER_B_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
58 | IIO_DEVICE_ATTR(apparent_power_b_gain, _mode, _show, _store, _addr) |
59 | ||
8594e07c | 60 | #define IIO_DEV_ATTR_APPARENT_POWER_C_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
61 | IIO_DEVICE_ATTR(apparent_power_c_gain, _mode, _show, _store, _addr) |
62 | ||
8594e07c | 63 | #define IIO_DEV_ATTR_ACTIVE_POWER_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
64 | IIO_DEVICE_ATTR(active_power_gain, _mode, _show, _store, _addr) |
65 | ||
8594e07c | 66 | #define IIO_DEV_ATTR_ACTIVE_POWER_A_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
67 | IIO_DEVICE_ATTR(active_power_a_gain, _mode, _show, _store, _addr) |
68 | ||
8594e07c | 69 | #define IIO_DEV_ATTR_ACTIVE_POWER_B_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
70 | IIO_DEVICE_ATTR(active_power_b_gain, _mode, _show, _store, _addr) |
71 | ||
8594e07c | 72 | #define IIO_DEV_ATTR_ACTIVE_POWER_C_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
73 | IIO_DEVICE_ATTR(active_power_c_gain, _mode, _show, _store, _addr) |
74 | ||
8594e07c | 75 | #define IIO_DEV_ATTR_REACTIVE_POWER_A_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
76 | IIO_DEVICE_ATTR(reactive_power_a_gain, _mode, _show, _store, _addr) |
77 | ||
8594e07c | 78 | #define IIO_DEV_ATTR_REACTIVE_POWER_B_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
79 | IIO_DEVICE_ATTR(reactive_power_b_gain, _mode, _show, _store, _addr) |
80 | ||
8594e07c | 81 | #define IIO_DEV_ATTR_REACTIVE_POWER_C_GAIN(_mode, _show, _store, _addr) \ |
09434ef7 BS |
82 | IIO_DEVICE_ATTR(reactive_power_c_gain, _mode, _show, _store, _addr) |
83 | ||
84 | #define IIO_DEV_ATTR_CURRENT_A(_show, _addr) \ | |
92196732 | 85 | IIO_DEVICE_ATTR(current_a, 0444, _show, NULL, _addr) |
09434ef7 BS |
86 | |
87 | #define IIO_DEV_ATTR_CURRENT_B(_show, _addr) \ | |
92196732 | 88 | IIO_DEVICE_ATTR(current_b, 0444, _show, NULL, _addr) |
09434ef7 BS |
89 | |
90 | #define IIO_DEV_ATTR_CURRENT_C(_show, _addr) \ | |
92196732 | 91 | IIO_DEVICE_ATTR(current_c, 0444, _show, NULL, _addr) |
09434ef7 BS |
92 | |
93 | #define IIO_DEV_ATTR_VOLT_A(_show, _addr) \ | |
92196732 | 94 | IIO_DEVICE_ATTR(volt_a, 0444, _show, NULL, _addr) |
09434ef7 BS |
95 | |
96 | #define IIO_DEV_ATTR_VOLT_B(_show, _addr) \ | |
92196732 | 97 | IIO_DEVICE_ATTR(volt_b, 0444, _show, NULL, _addr) |
09434ef7 BS |
98 | |
99 | #define IIO_DEV_ATTR_VOLT_C(_show, _addr) \ | |
92196732 | 100 | IIO_DEVICE_ATTR(volt_c, 0444, _show, NULL, _addr) |
09434ef7 BS |
101 | |
102 | #define IIO_DEV_ATTR_AENERGY(_show, _addr) \ | |
92196732 | 103 | IIO_DEVICE_ATTR(aenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
104 | |
105 | #define IIO_DEV_ATTR_LENERGY(_show, _addr) \ | |
92196732 | 106 | IIO_DEVICE_ATTR(lenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
107 | |
108 | #define IIO_DEV_ATTR_RAENERGY(_show, _addr) \ | |
92196732 | 109 | IIO_DEVICE_ATTR(raenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
110 | |
111 | #define IIO_DEV_ATTR_LAENERGY(_show, _addr) \ | |
92196732 | 112 | IIO_DEVICE_ATTR(laenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
113 | |
114 | #define IIO_DEV_ATTR_VAENERGY(_show, _addr) \ | |
92196732 | 115 | IIO_DEVICE_ATTR(vaenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
116 | |
117 | #define IIO_DEV_ATTR_LVAENERGY(_show, _addr) \ | |
92196732 | 118 | IIO_DEVICE_ATTR(lvaenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
119 | |
120 | #define IIO_DEV_ATTR_RVAENERGY(_show, _addr) \ | |
92196732 | 121 | IIO_DEVICE_ATTR(rvaenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
122 | |
123 | #define IIO_DEV_ATTR_LVARENERGY(_show, _addr) \ | |
92196732 | 124 | IIO_DEVICE_ATTR(lvarenergy, 0444, _show, NULL, _addr) |
09434ef7 BS |
125 | |
126 | #define IIO_DEV_ATTR_CHKSUM(_show, _addr) \ | |
92196732 | 127 | IIO_DEVICE_ATTR(chksum, 0444, _show, NULL, _addr) |
09434ef7 BS |
128 | |
129 | #define IIO_DEV_ATTR_ANGLE0(_show, _addr) \ | |
92196732 | 130 | IIO_DEVICE_ATTR(angle0, 0444, _show, NULL, _addr) |
09434ef7 BS |
131 | |
132 | #define IIO_DEV_ATTR_ANGLE1(_show, _addr) \ | |
92196732 | 133 | IIO_DEVICE_ATTR(angle1, 0444, _show, NULL, _addr) |
09434ef7 BS |
134 | |
135 | #define IIO_DEV_ATTR_ANGLE2(_show, _addr) \ | |
92196732 | 136 | IIO_DEVICE_ATTR(angle2, 0444, _show, NULL, _addr) |
09434ef7 BS |
137 | |
138 | #define IIO_DEV_ATTR_AWATTHR(_show, _addr) \ | |
92196732 | 139 | IIO_DEVICE_ATTR(awatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
140 | |
141 | #define IIO_DEV_ATTR_BWATTHR(_show, _addr) \ | |
92196732 | 142 | IIO_DEVICE_ATTR(bwatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
143 | |
144 | #define IIO_DEV_ATTR_CWATTHR(_show, _addr) \ | |
92196732 | 145 | IIO_DEVICE_ATTR(cwatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
146 | |
147 | #define IIO_DEV_ATTR_AFWATTHR(_show, _addr) \ | |
92196732 | 148 | IIO_DEVICE_ATTR(afwatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
149 | |
150 | #define IIO_DEV_ATTR_BFWATTHR(_show, _addr) \ | |
92196732 | 151 | IIO_DEVICE_ATTR(bfwatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
152 | |
153 | #define IIO_DEV_ATTR_CFWATTHR(_show, _addr) \ | |
92196732 | 154 | IIO_DEVICE_ATTR(cfwatthr, 0444, _show, NULL, _addr) |
09434ef7 BS |
155 | |
156 | #define IIO_DEV_ATTR_AVARHR(_show, _addr) \ | |
92196732 | 157 | IIO_DEVICE_ATTR(avarhr, 0444, _show, NULL, _addr) |
09434ef7 BS |
158 | |
159 | #define IIO_DEV_ATTR_BVARHR(_show, _addr) \ | |
92196732 | 160 | IIO_DEVICE_ATTR(bvarhr, 0444, _show, NULL, _addr) |
09434ef7 BS |
161 | |
162 | #define IIO_DEV_ATTR_CVARHR(_show, _addr) \ | |
92196732 | 163 | IIO_DEVICE_ATTR(cvarhr, 0444, _show, NULL, _addr) |
09434ef7 BS |
164 | |
165 | #define IIO_DEV_ATTR_AVAHR(_show, _addr) \ | |
92196732 | 166 | IIO_DEVICE_ATTR(avahr, 0444, _show, NULL, _addr) |
09434ef7 BS |
167 | |
168 | #define IIO_DEV_ATTR_BVAHR(_show, _addr) \ | |
92196732 | 169 | IIO_DEVICE_ATTR(bvahr, 0444, _show, NULL, _addr) |
09434ef7 BS |
170 | |
171 | #define IIO_DEV_ATTR_CVAHR(_show, _addr) \ | |
92196732 | 172 | IIO_DEVICE_ATTR(cvahr, 0444, _show, NULL, _addr) |
09434ef7 BS |
173 | |
174 | #define IIO_DEV_ATTR_IOS(_mode, _show, _store, _addr) \ | |
175 | IIO_DEVICE_ATTR(ios, _mode, _show, _store, _addr) | |
176 | ||
177 | #define IIO_DEV_ATTR_VOS(_mode, _show, _store, _addr) \ | |
178 | IIO_DEVICE_ATTR(vos, _mode, _show, _store, _addr) | |
179 | ||
180 | #define IIO_DEV_ATTR_PHCAL(_mode, _show, _store, _addr) \ | |
181 | IIO_DEVICE_ATTR(phcal, _mode, _show, _store, _addr) | |
182 | ||
183 | #define IIO_DEV_ATTR_APHCAL(_mode, _show, _store, _addr) \ | |
184 | IIO_DEVICE_ATTR(aphcal, _mode, _show, _store, _addr) | |
185 | ||
186 | #define IIO_DEV_ATTR_BPHCAL(_mode, _show, _store, _addr) \ | |
187 | IIO_DEVICE_ATTR(bphcal, _mode, _show, _store, _addr) | |
188 | ||
189 | #define IIO_DEV_ATTR_CPHCAL(_mode, _show, _store, _addr) \ | |
190 | IIO_DEVICE_ATTR(cphcal, _mode, _show, _store, _addr) | |
191 | ||
192 | #define IIO_DEV_ATTR_APOS(_mode, _show, _store, _addr) \ | |
193 | IIO_DEVICE_ATTR(apos, _mode, _show, _store, _addr) | |
194 | ||
195 | #define IIO_DEV_ATTR_AAPOS(_mode, _show, _store, _addr) \ | |
196 | IIO_DEVICE_ATTR(aapos, _mode, _show, _store, _addr) | |
197 | ||
198 | #define IIO_DEV_ATTR_BAPOS(_mode, _show, _store, _addr) \ | |
199 | IIO_DEVICE_ATTR(bapos, _mode, _show, _store, _addr) | |
200 | ||
201 | #define IIO_DEV_ATTR_CAPOS(_mode, _show, _store, _addr) \ | |
202 | IIO_DEVICE_ATTR(capos, _mode, _show, _store, _addr) | |
203 | ||
204 | #define IIO_DEV_ATTR_AVRMSGAIN(_mode, _show, _store, _addr) \ | |
205 | IIO_DEVICE_ATTR(avrmsgain, _mode, _show, _store, _addr) | |
206 | ||
207 | #define IIO_DEV_ATTR_BVRMSGAIN(_mode, _show, _store, _addr) \ | |
208 | IIO_DEVICE_ATTR(bvrmsgain, _mode, _show, _store, _addr) | |
209 | ||
210 | #define IIO_DEV_ATTR_CVRMSGAIN(_mode, _show, _store, _addr) \ | |
211 | IIO_DEVICE_ATTR(cvrmsgain, _mode, _show, _store, _addr) | |
212 | ||
213 | #define IIO_DEV_ATTR_AIGAIN(_mode, _show, _store, _addr) \ | |
214 | IIO_DEVICE_ATTR(aigain, _mode, _show, _store, _addr) | |
215 | ||
216 | #define IIO_DEV_ATTR_BIGAIN(_mode, _show, _store, _addr) \ | |
217 | IIO_DEVICE_ATTR(bigain, _mode, _show, _store, _addr) | |
218 | ||
219 | #define IIO_DEV_ATTR_CIGAIN(_mode, _show, _store, _addr) \ | |
220 | IIO_DEVICE_ATTR(cigain, _mode, _show, _store, _addr) | |
221 | ||
222 | #define IIO_DEV_ATTR_NIGAIN(_mode, _show, _store, _addr) \ | |
223 | IIO_DEVICE_ATTR(nigain, _mode, _show, _store, _addr) | |
224 | ||
225 | #define IIO_DEV_ATTR_AVGAIN(_mode, _show, _store, _addr) \ | |
226 | IIO_DEVICE_ATTR(avgain, _mode, _show, _store, _addr) | |
227 | ||
228 | #define IIO_DEV_ATTR_BVGAIN(_mode, _show, _store, _addr) \ | |
229 | IIO_DEVICE_ATTR(bvgain, _mode, _show, _store, _addr) | |
230 | ||
231 | #define IIO_DEV_ATTR_CVGAIN(_mode, _show, _store, _addr) \ | |
232 | IIO_DEVICE_ATTR(cvgain, _mode, _show, _store, _addr) | |
233 | ||
234 | #define IIO_DEV_ATTR_WGAIN(_mode, _show, _store, _addr) \ | |
235 | IIO_DEVICE_ATTR(wgain, _mode, _show, _store, _addr) | |
236 | ||
237 | #define IIO_DEV_ATTR_WDIV(_mode, _show, _store, _addr) \ | |
238 | IIO_DEVICE_ATTR(wdiv, _mode, _show, _store, _addr) | |
239 | ||
240 | #define IIO_DEV_ATTR_CFNUM(_mode, _show, _store, _addr) \ | |
241 | IIO_DEVICE_ATTR(cfnum, _mode, _show, _store, _addr) | |
242 | ||
243 | #define IIO_DEV_ATTR_CFDEN(_mode, _show, _store, _addr) \ | |
244 | IIO_DEVICE_ATTR(cfden, _mode, _show, _store, _addr) | |
245 | ||
246 | #define IIO_DEV_ATTR_CF1DEN(_mode, _show, _store, _addr) \ | |
247 | IIO_DEVICE_ATTR(cf1den, _mode, _show, _store, _addr) | |
248 | ||
249 | #define IIO_DEV_ATTR_CF2DEN(_mode, _show, _store, _addr) \ | |
250 | IIO_DEVICE_ATTR(cf2den, _mode, _show, _store, _addr) | |
251 | ||
252 | #define IIO_DEV_ATTR_CF3DEN(_mode, _show, _store, _addr) \ | |
253 | IIO_DEVICE_ATTR(cf3den, _mode, _show, _store, _addr) | |
254 | ||
255 | #define IIO_DEV_ATTR_IRMS(_mode, _show, _store, _addr) \ | |
256 | IIO_DEVICE_ATTR(irms, _mode, _show, _store, _addr) | |
257 | ||
258 | #define IIO_DEV_ATTR_VRMS(_mode, _show, _store, _addr) \ | |
259 | IIO_DEVICE_ATTR(vrms, _mode, _show, _store, _addr) | |
260 | ||
261 | #define IIO_DEV_ATTR_AIRMS(_mode, _show, _store, _addr) \ | |
262 | IIO_DEVICE_ATTR(airms, _mode, _show, _store, _addr) | |
263 | ||
264 | #define IIO_DEV_ATTR_BIRMS(_mode, _show, _store, _addr) \ | |
265 | IIO_DEVICE_ATTR(birms, _mode, _show, _store, _addr) | |
266 | ||
267 | #define IIO_DEV_ATTR_CIRMS(_mode, _show, _store, _addr) \ | |
268 | IIO_DEVICE_ATTR(cirms, _mode, _show, _store, _addr) | |
269 | ||
270 | #define IIO_DEV_ATTR_NIRMS(_mode, _show, _store, _addr) \ | |
271 | IIO_DEVICE_ATTR(nirms, _mode, _show, _store, _addr) | |
272 | ||
273 | #define IIO_DEV_ATTR_AVRMS(_mode, _show, _store, _addr) \ | |
274 | IIO_DEVICE_ATTR(avrms, _mode, _show, _store, _addr) | |
275 | ||
276 | #define IIO_DEV_ATTR_BVRMS(_mode, _show, _store, _addr) \ | |
277 | IIO_DEVICE_ATTR(bvrms, _mode, _show, _store, _addr) | |
278 | ||
279 | #define IIO_DEV_ATTR_CVRMS(_mode, _show, _store, _addr) \ | |
280 | IIO_DEVICE_ATTR(cvrms, _mode, _show, _store, _addr) | |
281 | ||
282 | #define IIO_DEV_ATTR_IRMSOS(_mode, _show, _store, _addr) \ | |
283 | IIO_DEVICE_ATTR(irmsos, _mode, _show, _store, _addr) | |
284 | ||
285 | #define IIO_DEV_ATTR_VRMSOS(_mode, _show, _store, _addr) \ | |
286 | IIO_DEVICE_ATTR(vrmsos, _mode, _show, _store, _addr) | |
287 | ||
288 | #define IIO_DEV_ATTR_AIRMSOS(_mode, _show, _store, _addr) \ | |
289 | IIO_DEVICE_ATTR(airmsos, _mode, _show, _store, _addr) | |
290 | ||
291 | #define IIO_DEV_ATTR_BIRMSOS(_mode, _show, _store, _addr) \ | |
292 | IIO_DEVICE_ATTR(birmsos, _mode, _show, _store, _addr) | |
293 | ||
294 | #define IIO_DEV_ATTR_CIRMSOS(_mode, _show, _store, _addr) \ | |
295 | IIO_DEVICE_ATTR(cirmsos, _mode, _show, _store, _addr) | |
296 | ||
297 | #define IIO_DEV_ATTR_AVRMSOS(_mode, _show, _store, _addr) \ | |
298 | IIO_DEVICE_ATTR(avrmsos, _mode, _show, _store, _addr) | |
299 | ||
300 | #define IIO_DEV_ATTR_BVRMSOS(_mode, _show, _store, _addr) \ | |
301 | IIO_DEVICE_ATTR(bvrmsos, _mode, _show, _store, _addr) | |
302 | ||
303 | #define IIO_DEV_ATTR_CVRMSOS(_mode, _show, _store, _addr) \ | |
304 | IIO_DEVICE_ATTR(cvrmsos, _mode, _show, _store, _addr) | |
305 | ||
306 | #define IIO_DEV_ATTR_VAGAIN(_mode, _show, _store, _addr) \ | |
307 | IIO_DEVICE_ATTR(vagain, _mode, _show, _store, _addr) | |
308 | ||
309 | #define IIO_DEV_ATTR_PGA_GAIN(_mode, _show, _store, _addr) \ | |
310 | IIO_DEVICE_ATTR(pga_gain, _mode, _show, _store, _addr) | |
311 | ||
312 | #define IIO_DEV_ATTR_VADIV(_mode, _show, _store, _addr) \ | |
313 | IIO_DEVICE_ATTR(vadiv, _mode, _show, _store, _addr) | |
314 | ||
315 | #define IIO_DEV_ATTR_LINECYC(_mode, _show, _store, _addr) \ | |
316 | IIO_DEVICE_ATTR(linecyc, _mode, _show, _store, _addr) | |
317 | ||
318 | #define IIO_DEV_ATTR_SAGCYC(_mode, _show, _store, _addr) \ | |
319 | IIO_DEVICE_ATTR(sagcyc, _mode, _show, _store, _addr) | |
320 | ||
321 | #define IIO_DEV_ATTR_CFCYC(_mode, _show, _store, _addr) \ | |
322 | IIO_DEVICE_ATTR(cfcyc, _mode, _show, _store, _addr) | |
323 | ||
324 | #define IIO_DEV_ATTR_PEAKCYC(_mode, _show, _store, _addr) \ | |
325 | IIO_DEVICE_ATTR(peakcyc, _mode, _show, _store, _addr) | |
326 | ||
327 | #define IIO_DEV_ATTR_SAGLVL(_mode, _show, _store, _addr) \ | |
328 | IIO_DEVICE_ATTR(saglvl, _mode, _show, _store, _addr) | |
329 | ||
330 | #define IIO_DEV_ATTR_IPKLVL(_mode, _show, _store, _addr) \ | |
331 | IIO_DEVICE_ATTR(ipklvl, _mode, _show, _store, _addr) | |
332 | ||
333 | #define IIO_DEV_ATTR_VPKLVL(_mode, _show, _store, _addr) \ | |
334 | IIO_DEVICE_ATTR(vpklvl, _mode, _show, _store, _addr) | |
335 | ||
336 | #define IIO_DEV_ATTR_IPEAK(_mode, _show, _store, _addr) \ | |
337 | IIO_DEVICE_ATTR(ipeak, _mode, _show, _store, _addr) | |
338 | ||
8594e07c | 339 | #define IIO_DEV_ATTR_RIPEAK(_mode, _show, _store, _addr) \ |
09434ef7 BS |
340 | IIO_DEVICE_ATTR(ripeak, _mode, _show, _store, _addr) |
341 | ||
342 | #define IIO_DEV_ATTR_VPEAK(_mode, _show, _store, _addr) \ | |
343 | IIO_DEVICE_ATTR(vpeak, _mode, _show, _store, _addr) | |
344 | ||
8594e07c | 345 | #define IIO_DEV_ATTR_RVPEAK(_mode, _show, _store, _addr) \ |
09434ef7 BS |
346 | IIO_DEVICE_ATTR(rvpeak, _mode, _show, _store, _addr) |
347 | ||
8594e07c | 348 | #define IIO_DEV_ATTR_VPERIOD(_mode, _show, _store, _addr) \ |
09434ef7 BS |
349 | IIO_DEVICE_ATTR(vperiod, _mode, _show, _store, _addr) |
350 | ||
09434ef7 BS |
351 | /* active energy register, AENERGY, is more than half full */ |
352 | #define IIO_EVENT_ATTR_AENERGY_HALF_FULL(_evlist, _show, _store, _mask) \ | |
353 | IIO_EVENT_ATTR_SH(aenergy_half_full, _evlist, _show, _store, _mask) | |
354 | ||
355 | /* a SAG on the line voltage */ | |
356 | #define IIO_EVENT_ATTR_LINE_VOLT_SAG(_evlist, _show, _store, _mask) \ | |
357 | IIO_EVENT_ATTR_SH(line_volt_sag, _evlist, _show, _store, _mask) | |
358 | ||
359 | /* | |
360 | * Indicates the end of energy accumulation over an integer number | |
361 | * of half line cycles | |
362 | */ | |
363 | #define IIO_EVENT_ATTR_CYCEND(_evlist, _show, _store, _mask) \ | |
364 | IIO_EVENT_ATTR_SH(cycend, _evlist, _show, _store, _mask) | |
365 | ||
4abf6f8b | 366 | /* on the rising and falling edge of the voltage waveform */ |
09434ef7 BS |
367 | #define IIO_EVENT_ATTR_ZERO_CROSS(_evlist, _show, _store, _mask) \ |
368 | IIO_EVENT_ATTR_SH(zero_cross, _evlist, _show, _store, _mask) | |
369 | ||
370 | /* the active energy register has overflowed */ | |
371 | #define IIO_EVENT_ATTR_AENERGY_OVERFLOW(_evlist, _show, _store, _mask) \ | |
372 | IIO_EVENT_ATTR_SH(aenergy_overflow, _evlist, _show, _store, _mask) | |
373 | ||
374 | /* the apparent energy register has overflowed */ | |
375 | #define IIO_EVENT_ATTR_VAENERGY_OVERFLOW(_evlist, _show, _store, _mask) \ | |
376 | IIO_EVENT_ATTR_SH(vaenergy_overflow, _evlist, _show, _store, _mask) | |
377 | ||
378 | /* the active energy register, VAENERGY, is more than half full */ | |
379 | #define IIO_EVENT_ATTR_VAENERGY_HALF_FULL(_evlist, _show, _store, _mask) \ | |
380 | IIO_EVENT_ATTR_SH(vaenergy_half_full, _evlist, _show, _store, _mask) | |
381 | ||
382 | /* the power has gone from negative to positive */ | |
383 | #define IIO_EVENT_ATTR_PPOS(_evlist, _show, _store, _mask) \ | |
384 | IIO_EVENT_ATTR_SH(ppos, _evlist, _show, _store, _mask) | |
385 | ||
386 | /* the power has gone from positive to negative */ | |
387 | #define IIO_EVENT_ATTR_PNEG(_evlist, _show, _store, _mask) \ | |
388 | IIO_EVENT_ATTR_SH(pneg, _evlist, _show, _store, _mask) | |
389 | ||
390 | /* waveform sample from Channel 1 has exceeded the IPKLVL value */ | |
391 | #define IIO_EVENT_ATTR_IPKLVL_EXC(_evlist, _show, _store, _mask) \ | |
392 | IIO_EVENT_ATTR_SH(ipklvl_exc, _evlist, _show, _store, _mask) | |
393 | ||
394 | /* waveform sample from Channel 2 has exceeded the VPKLVL value */ | |
395 | #define IIO_EVENT_ATTR_VPKLVL_EXC(_evlist, _show, _store, _mask) \ | |
396 | IIO_EVENT_ATTR_SH(vpklvl_exc, _evlist, _show, _store, _mask) | |
397 | ||
37e3be9d | 398 | #endif /* _METER_H */ |