All of lore.kernel.org
 help / color / mirror / Atom feed
* [rfc] staging:iio:meter: IIO ABI issues
@ 2018-03-16  4:00 John Syne
  2018-03-17 21:14 ` Jonathan Cameron
  0 siblings, 1 reply; 2+ messages in thread
From: John Syne @ 2018-03-16  4:00 UTC (permalink / raw)
  To: linux-iio
  Cc: Jonathan Cameron, Rodrigo Siqueira, Lars-Peter Clausen,
	Peter Meerwald-Stadler, Hartmut Knaack, daniel.baluta

Hi Jonathan,

Since this is probably doing to require a few rounds, I have created a =
new thread for this issue.

I have been looking at the IIO ABI docs and if I understand correctly, =
the idea is to use consistent naming conventions? So for example, =
looking at the ADE7854 datasheet, the naming matching the ADE7854 =
registers would be as follows:

{direction}_{type}_{index}_{modifier}_{info_mask}

AIGAIN	-	In_current_a_gain
AVGAIN	-	in_voltage_a_gain
BIGAIN	-	in_current_b_gain
BVGAIN	-	in_voltage_b_gain
=E2=80=94
How do we represent the rms and offset
AIRMSOS	-	in_current_a_rmsoffset
AVRMSOS	-	in_voltage_a_rmsoffset
=E2=80=94
Here I don=E2=80=99t understand how to represent both the phase and the =
active/reactive/apparent power components. Do we combine the phase and =
quadrature part like this
AVAGAIN		-	in_power_a_gain				/* =
apparent power */
=E2=80=94
AWGAIN		-	in_power_ai_gain				=
/* active power */
=E2=80=94
AVARGAIN	-	in_power_aq_gain				=
/* reactive power */
=E2=80=94
Now here it becomes more complicated. Not sure how this gets handled.=20
AFWATTOS	-	in_power_a_active/fundamental/offset
=E2=80=94
AWATTHR	-	in_energy_ai_accumulation
=E2=80=94


Thinking about this a little more, perhaps only the attributes that =
would be used in a user space app need to be this descriptive. Let me =
explain. Most of the registers on the ADE7878 and even more so on the =
ADE9000, would have nothing to do with the user space app. Most of these =
registers are used purely for configuration, settings and calibration.

For these registers, maybe we should use the register name as the =
modifier. For example:

AIGAIN	-	register_AIGAIN

For measurement registers, we adhere to the traditional naming =
convention:

AIRMS		-	in_current_a_rms
AVRMS		-	in_voltage_a_rms
AWATTHR	-	in_energy_a
AFWATTHR	-	in_energy_a_fundamental
AVARHR		-	in_energy_aq				/* I =
still have a problem with this one */
AFVARHR	-	in_energy_aq_fundamental	/* See the problem here? =
*/
AIMAV		-	in_current_a_mean-abolute-value	/* I=E2=80=99m =
having a difficult time trying to make this work */

When I look at the ADE9000, the functionality is even more complex, so =
I=E2=80=99m hoping everyone can offer suggestions on how to resolve =
this.

Regards,
John


AVARHR		-	in_energy_aq_accumulation
=E2=80=94
IPEAK		-	in_current_peak
=E2=80=94

I=E2=80=99ll leave it there, because there are some even more =
complicated register naming issues.

Regards,
John


Regards,
John

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2018-03-17 21:14 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-03-16  4:00 [rfc] staging:iio:meter: IIO ABI issues John Syne
2018-03-17 21:14 ` Jonathan Cameron

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.