-
Notifications
You must be signed in to change notification settings - Fork 107
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
Adpd2140 get sensor #313
Adpd2140 get sensor #313
Conversation
adi/adpd1080.py
Outdated
def rx(self): | ||
buff = super().rx() | ||
del self._rx__rxbuf | ||
return buff |
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 really need to delete the buffer between calls?
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 was done because in an application we needed to read a few samples and then take the average and write it into the offset register of the device. But writes to the device did not work anymore after buffer reads, unless the buffer was deleted first.
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.
Hmm that seems really strange. Is this a bug in the driver or the desired behavior?
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.
I don't know, exactly. I experienced an issue a while ago and @scuciurean helped me with this workaround. I think he experienced the issue 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.
I can leave it up to you and @scuciurean about if this is proper. Just let me know and we'll merge.
228e938
to
bef7256
Compare
V1:
|
610b725
to
155c02f
Compare
V2:
|
155c02f
to
dc55a68
Compare
V3:
|
41fc252
to
907b1e7
Compare
Add pyadi-iio class for the adpd1080 device. Signed-off-by: Andrei Drimbarean <[email protected]>
907b1e7
to
9da4e58
Compare
Codacy complaints that there should be no blank lines before class docstring, but there are none. Seems like a false positive. |
9da4e58
to
7ddca2a
Compare
V4:
|
b87703d
to
862193c
Compare
V5:
|
examples/adpd1080.py
Outdated
adpd1080 = adi.adpd1080(uri="serial:COM23") | ||
adpd1080.rx_buffer_size = 40 | ||
# commented on adicup3029 platform, may work on others | ||
# todo: undomment when uart issue on adicup is fixed |
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.
Maybe we can remove this type of comments and add them as issues or tickets
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.
Apart from the 2 code analysis issues, it looks good to me. |
These seem like false positives to me. The issue is that blank lines are not allowed before class docstring, but there are no blank lines here. |
Add an example of instantiating the ADPD1080 class and reading one sample from every channel using the buffer. Signed-off-by: Andrei Drimbarean <[email protected]>
862193c
to
0137eb3
Compare
V6:
|
Initial commit for the gesture sensor/theremin example for the ADPD1080/ADPD2140 PMOD. Signed-off-by: Andrei Drimbarean <[email protected]>
0137eb3
to
8c1d3b0
Compare
Description
Add adpd1080 pyadi-iio class, basic example and gesture sensor/theremin example.
Type of change
Please delete options that are not relevant.
How has this been tested?
Class and examples tested with hardware system. The first and second pins of the PMOD are not connected to the board by default in rev A and a wire needs to connect pin 1 of the PMOD to IO13 of the ADICUP3029.
Test Configuration:
Checklist: