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

ad77681 pyadi-iio support #433

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

mphalke
Copy link
Contributor

@mphalke mphalke commented Apr 20, 2023

Description

Implemented ad7768-1 pyadi-iio device driver class and example script

Fixes # (issue)

Type of change

Please delete options that are not relevant.

  • New feature (non-breaking change which adds functionality)

How has this been tested?

Tested with ad7768-1 tinyiiod FW with SDP-K1 MCU platform

Test Configuration:

  • Hardware: SDP-K`
  • OS: Windows

Documentation

NA

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • I have signed off all commits and they contain "Signed-off by: "
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules

adi/ad77681.py Outdated
from adi.rx_tx import rx


class ad77681(rx, context_manager):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Use _ to separate part number and derivative: ad7768_1

@tfcollins
Copy link
Collaborator

Please add the emulation context for the new device

@mphalke
Copy link
Contributor Author

mphalke commented Apr 21, 2023

V1.0: Review comments fixes

  1. Renamed class and files names to 'ad7768_1' as suggested in the review comment
  2. Added emulation context for device

@mphalke mphalke force-pushed the ad77681-support branch from 148360c to 1edc997 Compare May 18, 2023 10:54
@mphalke
Copy link
Contributor Author

mphalke commented May 18, 2023

V2.0: Added iio emu context and minor updates to attributes getter/setters

  1. Updated hardware_map.yml to include ad7768-1 device support
  2. Fixed getter/setter functions for scale and offset attributes

@mphalke
Copy link
Contributor Author

mphalke commented May 25, 2023

@tfcollins Any further review comments?

@mphalke mphalke force-pushed the ad77681-support branch 2 times, most recently from cca31eb to 9be2a37 Compare July 24, 2023 10:42
@mphalke
Copy link
Contributor Author

mphalke commented Jul 24, 2023

@tfcollins I have added the context xml file. Can you please review the changes?

@mphalke
Copy link
Contributor Author

mphalke commented Jul 24, 2023

V3.0: Added xml context file
-Generated and added IIO xml context file for iio emulation

@mphalke mphalke requested a review from tfcollins August 1, 2023 05:10
adi/ad7768_1.py Outdated
Comment on lines 6 to 35
# All rights reserved.
#
# Redistribution and use in source and binary forms, with or without modification,
# are permitted provided that the following conditions are met:
# - Redistributions of source code must retain the above copyright
# notice, this list of conditions and the following disclaimer.
# - Redistributions in binary form must reproduce the above copyright
# notice, this list of conditions and the following disclaimer in
# the documentation and/or other materials provided with the
# distribution.
# - Neither the name of Analog Devices, Inc. nor the names of its
# contributors may be used to endorse or promote products derived
# from this software without specific prior written permission.
# - The use of this software may or may not infringe the patent rights
# of one or more patent holders. This license does not release you
# from the requirement that you obtain separate licenses from these
# patent holders to use this software.
# - Use of the software either in source or binary form, must be run
# on or directly connected to an Analog Devices Inc. component.
#
# THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
# INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A
# PARTICULAR PURPOSE ARE DISCLAIMED.
#
# IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
# EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, INTELLECTUAL PROPERTY
# RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR
# BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
# STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
# THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
Copy link
Collaborator

Choose a reason for hiding this comment

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

This can be removed since you have the SPDX definition at the top

#########################################
@pytest.mark.iio_hardware(hardware)
@pytest.mark.parametrize("classname", [(classname)])
def test_ad7768_1_rx_data(test_dma_rx, iio_uri, classname, channel):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Remove the "channel" argument

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I think I missed out to add channel parameter. This device has 1 channel, so I think we would need channel argument there.

Copy link
Collaborator

@tfcollins tfcollins left a comment

Choose a reason for hiding this comment

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

Test needs fixing

Implemented ad7768-1 pyadi-iio device driver class and example script

Signed-off-by: MPhalke <[email protected]>
@mphalke
Copy link
Contributor Author

mphalke commented Aug 2, 2023

Test needs fixing

Test needs fixing

This is fixed. There was syntax error with hardware parameter in test_ad7768_1.py file

@mphalke
Copy link
Contributor Author

mphalke commented Aug 2, 2023

V2.0: Review comment fixes and resolved test issues

  1. Removed the redundant license header
  2. Fixed issues in the test (all tests are passing now)

@mphalke mphalke requested a review from tfcollins August 2, 2023 05:08
@mphalke
Copy link
Contributor Author

mphalke commented Aug 4, 2023

@tfcollins Can we get this PR merged please if everything is okay?

@mphalke
Copy link
Contributor Author

mphalke commented Aug 9, 2023

@tfcollins Do you think changes are good to merge now into main branch?

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