-
Notifications
You must be signed in to change notification settings - Fork 103
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
Fsylvestre/ad7944 #562
base: main
Are you sure you want to change the base?
Fsylvestre/ad7944 #562
Conversation
a49a8f0
to
f6f8009
Compare
adi/ad7944.py
Outdated
_device_name = "" | ||
_rx_data_type = np.uint16 | ||
|
||
_rx_channel_names = [] |
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 need to be reset to [] in the init or just defined by the init. Class properties act like static properties, so using multiple instances will cause undesired behavior
|
||
if not self._ctrl: | ||
raise Exception(f"Error in selecting matching device {device_name}") | ||
|
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.
Please add a check for self._ctrl as well
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.
Do you mean self._trigger
?
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.
Sorry, meant self._rxadc
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.
In this case I don't get it as self._rxadc = self._ctrl
, so if self._ctrl
is not None
it's the same for self._rxadc
. No?
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.
Generally good :) Just some minor tweaks.
Thanks for the contribution!
- Add adi/ad7944.py module - Add ad7944 to index.rst - Add ad7944 to supported_parts.md - Add ad7944 doc stub - Add test/ad7944.py test, xml file - Add ad7944 to hardware_map.xml Signed-off-by: Trevor Gamblin <[email protected]> Signed-off-by: Florian Sylvestre <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]> Signed-off-by: Florian Sylvestre <[email protected]>
Signed-off-by: Trevor Gamblin <[email protected]>
Signed-off-by: Florian Sylvestre <[email protected]>
f6f8009
to
8370a2a
Compare
|
||
_compatible_parts = ["ad7944"] | ||
_device_name = "" | ||
_rx_data_type = np.uint16 |
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.
FYI, the HDL team has decided to try to standardize on using 32-bit words for SPI offload support.
So this means that the data type will be 16-bit if not using SPI offload but 32-bit if using SPI offload.
Description
Type of change
Please delete options that are not relevant.
How has this been tested?
Tested against AD7944, AD7986 and AD7985 eval boards attached to a zedboard.
Generalized manual test flow:
install pyadi-iio and dependencies in venv
Start Python interpreter
import adi
Instantiate adc object, e.g. adc = adi.ad7944(uri="ip:10.2.5.203")
Check that adc.rx() succeeds with no warnings or errors
Check sampling frequency with adc.sampling_frequency
Set sampling frequency with adc.sampling_frequency =
Check sampling frequency again with adc.sampling_frequency and confirm change successful
pytest --hw=ad7944 -v test/test_ad7944.py --uri=ip:10.2.5.203
and
pytest -v --emu --emu-xml=ad7944.xml test/test_ad7944.py
Test Configuration:
Hardware: Zedboard + EVAL-AD7944FMCZ/EVAL_AD7944_85_86FMCZ
OS:
PRETTY_NAME="Kuiper GNU/Linux 11.2 (bullseye)"
NAME="Kuiper GNU/Linux"
VERSION_ID="11.2"
VERSION="11.2 (bullseye)"
VERSION_CODENAME=bullseye
ID=raspbian
ID_LIKE=debian
HOME_URL="https://github.com/analogdevicesinc/adi-kuiper-gen"
SUPPORT_URL="https://ez.analog.com/linux-software-drivers/"
Documentation
Added:
Updated:
Checklist: