-
Notifications
You must be signed in to change notification settings - Fork 11
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
DRAFT: add AD7173 family #42
base: main
Are you sure you want to change the base?
Conversation
* AD4111 12 channel (8 voltage/4 current) +1 temperature Signed-off-by: Guillaume Ranquet <granquet@baylibre.com>
% SamplesPerFrame Samples Per Frame | ||
% Number of samples per frame, specified as an even positive | ||
% integer. | ||
SamplesPerFrame = 400 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not sure I understand where the SampleRate/SamplesPerFrame default values come from?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This value of 400 has been chosen as a default in iio_oscilloscope, no matter the resolution & sampling rate of the device.
In other examples you may notice other values, that are powers of two, as the DMA only works with those types of widths.
properties (Nontunable, Hidden) | ||
Timeout = Inf | ||
kernelBuffersCount = 1 | ||
dataTypeStr = 'int32' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is int32 the best type available? most devices declare realbits to 24 and ad4113 is 16 bits
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
For 16 bit resolution & less than that, dataTypeStr should be set to int16. For values higher than 16 (eg. 18/24 etc), the dataTypeStr has to be set to int32, which is the next value of powers of two.
%% Check Voltage Scale | ||
function rValue = get.VoltageScale(obj) | ||
if obj.ConnectedToDevice | ||
rValue = obj.getAttributeDouble('voltage0', 'scale', obj.isOutput); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the default of 'voltage0' might not exists depending on how the dtb is written, how to account for that? I see GetChannelAttrValue()
exists in +Generic/Rx.m
but I'm unsure how to get the chnID from the first enabled channel?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If you have access to the hardware, the fastest way to get the channels names & attributes is running iio_info.
function updateBuildInfo(buildInfo, bldCfg) | ||
% Call the matlabshared.libiio.method first | ||
matlabshared.libiio.ExternalDependency.updateBuildInfo(buildInfo, bldCfg); | ||
end |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not sure what all this boilerplate is doing!?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As far as I know, it's purpose is to modify or configure the build information, if neccessary (eg. adding source files, include paths, libraries required for building the Matlab code with external dependencies).
channel_names = {'voltage0','voltage1','voltage2','voltage3',... | ||
'voltage4','voltage5','voltage6','voltage7','current0', ... | ||
'current1','current2','current3','differential0', ... | ||
'differential1','differential2','differential3', 'temp'}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the channels will not be named differentialX
but something like in_voltage3-voltage5_raw
I'm unsure how to translate this here? other devices in the toolbox seems to use differentialX
, not sure how this works?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, as I mentioned above, if you can run iio_info it should ease the naming process. If you're using only the Linux drivers, you can take an example from previous similar scenarios.
In this PR there are both differential and non-differential parts.
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
PR Checklist