Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dev/ade9078 #2372

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open

Dev/ade9078 #2372

wants to merge 2 commits into from

Conversation

raezt
Copy link
Collaborator

@raezt raezt commented Nov 21, 2024

Pull Request Description

Please replace this with a detailed description and motivation of the changes.
You can tick the checkboxes below with an 'x' between square brackets or just check them after publishing the PR.
If this PR contains a breaking change, list dependent PRs and try to push all related PRs at the same time.

PR Type

  • Bug fix (change that fixes an issue)
  • New feature (change that adds new functionality)
  • Breaking change (has dependencies in other repos or will cause CI to fail)

PR Checklist

  • I have followed the Coding style guidelines
  • I have performed a self-review of the changes
  • I have commented my code, at least hard-to-understand parts
  • I have build all projects affected by the changes in this PR
  • I have tested in hardware affected projects, at the relevant boards
  • I have signed off all commits from this PR
  • I have updated the documentation (wiki pages, ReadMe etc), if applies

@raezt raezt marked this pull request as ready for review November 22, 2024 08:42
if (!reg_data)
return -EINVAL;

addr = (uint16_t) no_os_field_prep(NO_OS_GENMASK(16, 4), reg_addr);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the mask should be [15:4], otherwise you'll clip bit 16 since you also cast to uint16_t.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

solved

The ADE9078 is a high performance, multiphase energy
and power quality monitoring IC.
This is a basic driver implementation with communication
done on SPI.

Signed-off-by: Radu Etz <[email protected]>
Example project for ADE9078.
Tested using the ADE9078 Arduion Shield.
This example includes measurements of
the rms values. The example is tested with the
AD-APARD32690-SL.

Signed-off-by: Radu Etz <[email protected]>
@raezt
Copy link
Collaborator Author

raezt commented Nov 29, 2024

Change log v1 -> v2:

  • all comments addressed
  • additionally corrected the following comments in ade9078.h: l719 "transformer ratio of 3000:1" changed to "transformer ratio of 1000:1"
    l723 "Assuming a voltage divider with Rlow 1k and Rup 800k" to "Assuming a voltage divider with Rlow 1k and Rup 990k"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants