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
Contributor

@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]>
+adi/+AD7124_8/Rx.m Show resolved Hide resolved
@SaikiranGudla SaikiranGudla requested a review from D-Disha January 30, 2025 05:19
@@ -66,7 +66,11 @@ function delete(obj)
% Set device sampling rate
obj.SampleRate = value;
if obj.ConnectedToDevice
obj.setDeviceAttributeRAW('sampling_frequency', value);
for i=1:length(obj.channel_names)
Copy link
Collaborator

Choose a reason for hiding this comment

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

@commodo, Can we update the driver to make sure the no-OS implementation doesn't break with these changes?
In the tinyIIOd-based Firmware implementation, this attribute is treated as a device-level attribute and I see that these changes align with the new Linux drivers.

We can have a new property for channel-sampling-rate attribute naming it as SampleRateCh (or something of that sort or a boolean property that tells if it's a device level or channel level) and this logic can go there (toward its setter function). This way we can have this driver compatible for both the implementations and the attributes can be set accordingly in the example script.

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.

4 participants