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

AD7124: update code to match newer linux drivers #39

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

Conversation

commodo
Copy link

@commodo commodo commented Nov 1, 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 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 by running /docs/source/reference_api/gen_sysobj_doc.m script locally, if applies.

In newer versions of the AD7124 driver, the sampling_frequency is no longer
a device-level attribute, but a per-channel attribute.

This means that the AD7124 base driver should set this attribute for all
enabled channels.

Signed-off-by: Alexandru Ardelean <[email protected]>
In a newer version of the AD7124 driver, the channels were all made
differential.
That means that the channel names need to be updated.

This change updates the channel names to the new (differential channel
names).

Signed-off-by: Alexandru Ardelean <[email protected]>
channel_names = {'voltage0','voltage1','voltage2','voltage3',...
'voltage4','voltage5','voltage6','voltage7','voltage8','voltage9',...
'voltage10','voltage11','voltage12','voltage13','voltage14','voltage15'};
channel_names = {'voltage0-voltage1','voltage2-voltage3',...
Copy link
Collaborator

Choose a reason for hiding this comment

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

Out of curiosity- why do the channel names look different here? the Shouldn't the differential configuration be considered in the fW?

Copy link
Author

Choose a reason for hiding this comment

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

well, it's how the implementation of the AD7124 driver is, in the Linux IIO framework;
since the inputs on the AD7124 are differential, the IIO framework decided to represented this as 2 channel-pairs (i.e. voltage0-voltage1 and so on); this is how they show up, when a channel is defined as differential;

what puzzles me, is why this was represented as voltage0','voltage1, etc in the first place

the AD7124 driver has been implemented in Linux (as differential) for a number of years;
so, the channels should have looked more like 'voltage0-voltage1','voltage2-voltage3',

unless, the no-OS implementation was used to test this initially;

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