IIO firmware for the AD4110

Dependencies:   tempsensors sdp_k1_sdram

Committer:
Janani Sunil
Date:
Mon Aug 01 11:09:48 2022 +0530
Revision:
1:a78dbaa4b05d
Parent:
0:6ca37a8f8ba9
Initial implementation of AD4110 IIO Firmware

Who changed what in which revision?

UserRevisionLine numberNew contents of line
Janani Sunil 0:6ca37a8f8ba9 1 # @file ad4110_xattr.py
Janani Sunil 0:6ca37a8f8ba9 2 # @brief Extended attributes for the AD4110
Janani Sunil 0:6ca37a8f8ba9 3 #
Janani Sunil 0:6ca37a8f8ba9 4 # Copyright (c) 2022 Analog Devices, Inc.
Janani Sunil 0:6ca37a8f8ba9 5 # All rights reserved.
Janani Sunil 0:6ca37a8f8ba9 6 #
Janani Sunil 0:6ca37a8f8ba9 7 # This software is proprietary to Analog Devices, Inc. and its licensors.
Janani Sunil 0:6ca37a8f8ba9 8 # By using this software you agree to the terms of the associated
Janani Sunil 0:6ca37a8f8ba9 9 # Analog Devices Software License Agreement.
Janani Sunil 0:6ca37a8f8ba9 10 #
Janani Sunil 0:6ca37a8f8ba9 11
Janani Sunil 0:6ca37a8f8ba9 12 import adi.ad4110
Janani Sunil 0:6ca37a8f8ba9 13 from adi.ad4110 import ad4110
Janani Sunil 0:6ca37a8f8ba9 14 from adi.attribute import attribute
Janani Sunil 0:6ca37a8f8ba9 15 from decimal import Decimal
Janani Sunil 0:6ca37a8f8ba9 16
Janani Sunil 0:6ca37a8f8ba9 17 # Create a child class of ad4110 parent class for defining extended iio attributes (the ones which
Janani Sunil 0:6ca37a8f8ba9 18 # are not part of original linux iio drivers and created for non-linux iio applications)
Janani Sunil 0:6ca37a8f8ba9 19 class ad4110_xattr(ad4110):
Janani Sunil 0:6ca37a8f8ba9 20
Janani Sunil 0:6ca37a8f8ba9 21 #------------------------------------------------
Janani Sunil 0:6ca37a8f8ba9 22 # Device extended attributes
Janani Sunil 0:6ca37a8f8ba9 23 #------------------------------------------------
Janani Sunil 0:6ca37a8f8ba9 24
Janani Sunil 0:6ca37a8f8ba9 25 @property
Janani Sunil 0:6ca37a8f8ba9 26 def demo_config(self):
Janani Sunil 0:6ca37a8f8ba9 27 """AD4110 demo mode config"""
Janani Sunil 0:6ca37a8f8ba9 28 return self._get_iio_dev_attr_str("demo_config")
Janani Sunil 0:6ca37a8f8ba9 29
Janani Sunil 0:6ca37a8f8ba9 30 @property
Janani Sunil 0:6ca37a8f8ba9 31 def sample_rate(self):
Janani Sunil 0:6ca37a8f8ba9 32 """AD4110 device sample_rate"""
Janani Sunil 0:6ca37a8f8ba9 33 return int(self._get_iio_dev_attr_str("sampling_frequency"))