Analog Devices / Mbed OS EVAL-AD4110

Dependencies:   tempsensors sdp_k1_sdram

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers ad4110_xattr.py Source File

ad4110_xattr.py

00001 # @file    ad4110_xattr.py
00002 # @brief   Extended attributes for the AD4110
00003 #
00004 # Copyright (c) 2022 Analog Devices, Inc.
00005 # All rights reserved.
00006 # 
00007 # This software is proprietary to Analog Devices, Inc. and its licensors.
00008 # By using this software you agree to the terms of the associated
00009 # Analog Devices Software License Agreement.
00010 #
00011 
00012 import adi.ad4110 
00013 from adi.ad4110 import ad4110
00014 from adi.attribute import attribute
00015 from decimal import Decimal
00016 
00017 # Create a child class of ad4110 parent class for defining extended iio attributes (the ones which
00018 # are not part of original linux iio drivers and created for non-linux iio applications)
00019 class ad4110_xattr(ad4110):
00020 
00021     #------------------------------------------------
00022     # Device extended attributes
00023     #------------------------------------------------
00024     
00025     @property
00026     def demo_config(self):
00027         """AD4110 demo mode config"""
00028         return self._get_iio_dev_attr_str("demo_config")
00029 
00030     @property
00031     def sample_rate(self):
00032         """AD4110 device sample_rate"""
00033         return int(self._get_iio_dev_attr_str("sampling_frequency"))