All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonathan Cameron <jic23@kernel.org>
To: John Syne <john3909@gmail.com>
Cc: linux-iio@vger.kernel.org,
	Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>,
	Lars-Peter Clausen <lars@metafoo.de>,
	Peter Meerwald-Stadler <pmeerw@pmeerw.net>,
	Hartmut Knaack <knaack.h@gmx.de>,
	daniel.baluta@nxp.com
Subject: Re: [rfc] staging:iio:meter: IIO ABI issues
Date: Sat, 17 Mar 2018 21:14:47 +0000	[thread overview]
Message-ID: <20180317211447.1e91b1c9@archlinux> (raw)
In-Reply-To: <6BD44826-5F90-4377-8C15-230ED4014B27@gmail.com>

On Thu, 15 Mar 2018 21:00:11 -0700
John Syne <john3909@gmail.com> wrote:

> Hi Jonathan,
> 
> Since this is probably doing to require a few rounds, I have created a new thread for this issue.
Oops, I should have read on a few emails. Replied to the previous version in the main
thread.  Sorry about that!

Jonathan

> 
> 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
> —
> How do we represent the rms and offset
> AIRMSOS	-	in_current_a_rmsoffset
> AVRMSOS	-	in_voltage_a_rmsoffset
> —
> Here I don’t 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 */
> —
> AWGAIN		-	in_power_ai_gain				/* active power */
> —
> AVARGAIN	-	in_power_aq_gain				/* reactive power */
> —
> Now here it becomes more complicated. Not sure how this gets handled. 
> AFWATTOS	-	in_power_a_active/fundamental/offset
> —
> AWATTHR	-	in_energy_ai_accumulation
> —
> 
> 
> 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’m having a difficult time trying to make this work */
> 
> When I look at the ADE9000, the functionality is even more complex, so I’m hoping everyone can offer suggestions on how to resolve this.
> 
> Regards,
> John
> 
> 
> AVARHR		-	in_energy_aq_accumulation
> —
> IPEAK		-	in_current_peak
> —
> 
> I’ll leave it there, because there are some even more complicated register naming issues.
> 
> Regards,
> John
> 
> 
> Regards,
> John
> 
> 
> 
> 
> 


      reply	other threads:[~2018-03-17 21:14 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-16  4:00 [rfc] staging:iio:meter: IIO ABI issues John Syne
2018-03-17 21:14 ` Jonathan Cameron [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20180317211447.1e91b1c9@archlinux \
    --to=jic23@kernel.org \
    --cc=daniel.baluta@nxp.com \
    --cc=john3909@gmail.com \
    --cc=knaack.h@gmx.de \
    --cc=lars@metafoo.de \
    --cc=linux-iio@vger.kernel.org \
    --cc=pmeerw@pmeerw.net \
    --cc=rodrigosiqueiramelo@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.