Skip to content

Commit 06060b8

Browse files
committed
doc: added DeviceBufferAttr and DeviceDebugAttr in Sphinx.
Added the Sphinx documentation for the DeviceBufferAttr and DeviceDebugAttr classes under the Device menu. Signed-off-by: Cristi Iacob <[email protected]>
1 parent 5d7d176 commit 06060b8

File tree

3 files changed

+58
-8
lines changed

3 files changed

+58
-8
lines changed

bindings/python/doc/channel.rst

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,14 @@ Members
55
--------------
66
.. autoclass:: iio.Channel
77
:members:
8+
9+
--------------------
10+
11+
Channel attributes
12+
--------------------
13+
.. autoclass:: iio.DataFormat
14+
:members:
15+
.. autoclass:: iio.ChannelModifier
16+
:members:
17+
.. autoclass:: iio.ChannelType
18+
:members:

bindings/python/doc/device.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,15 @@ Members
66
.. autoclass:: iio.Device
77
:members:
88
:inherited-members:
9+
10+
------------------
11+
12+
Device attributes
13+
------------------
14+
.. autoclass:: iio.DeviceDebugAttr
15+
:members:
16+
:inherited-members:
17+
.. autoclass:: iio.DeviceBufferAttr
18+
:members:
19+
:inherited-members:
20+

bindings/python/iio.py

Lines changed: 35 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ class DataFormat(Structure):
7575
('repeat', c_uint)]
7676

7777
class ChannelModifier(Enum):
78-
"""Contains the modifier types of an IIO channel."""
78+
"""Contains the modifier type of an IIO channel."""
7979

8080
IIO_NO_MOD = 0
8181
IIO_MOD_X = 1
@@ -526,10 +526,6 @@ class ChannelType(Enum):
526526
_buffer_cancel.restype = c_void_p
527527
_buffer_cancel.argtypes = (_BufferPtr, )
528528

529-
_buffer_get_data = _lib.iio_buffer_get_data
530-
_buffer_get_data.restype = c_void_p
531-
_buffer_get_data.argtypes = (_BufferPtr, )
532-
533529
_buffer_get_device = _lib.iio_buffer_get_device
534530
_buffer_get_device.restype = _DevicePtr
535531
_buffer_get_device.argtypes = (_BufferPtr, )
@@ -811,6 +807,15 @@ def type(self):
811807
return ChannelType(_channel_get_type(self._channel))
812808

813809
def convert(self, dst, src):
810+
"""
811+
Converts src and saves the result in dst, using current channel's data format.
812+
813+
parameters:
814+
dst: type=list
815+
The variable where the result is stored.
816+
src: type=list
817+
Data to be converted.
818+
"""
814819
_channel_convert(self._channel, c_void_p(*dst), c_void_p(*src))
815820

816821
class Buffer(object):
@@ -904,12 +909,22 @@ def write(self, array):
904909
return length
905910

906911
def cancel(self):
912+
"""
913+
Cancels the current buffer.
914+
"""
907915
_buffer_cancel(self._buffer)
908916

909-
def get_data(self):
910-
return _buffer_get_data(self._buffer)
911-
912917
def set_blocking_mode(self, blocking):
918+
"""
919+
Sets the buffer's blocking mode.
920+
921+
parameters:
922+
blocking: type=boolean
923+
True if in blocking_mode else False.
924+
925+
returns: type=int
926+
Return code from the C layer.
927+
"""
913928
return _buffer_set_blocking_mode(self._buffer, c_bool(blocking))
914929

915930
@property
@@ -922,10 +937,18 @@ def device(self):
922937

923938
@property
924939
def poll_fd(self):
940+
"""
941+
This buffer's poll_fd.
942+
type: int
943+
"""
925944
return _buffer_get_poll_fd(self._buffer)
926945

927946
@property
928947
def step(self):
948+
"""
949+
This buffer's step size.
950+
type: int
951+
"""
929952
return _buffer_step(self._buffer)
930953

931954
class _DeviceOrTrigger(object):
@@ -1090,6 +1113,10 @@ def _get_trigger(self):
10901113

10911114
@property
10921115
def context(self):
1116+
"""
1117+
This device's context.
1118+
type: iio.Context
1119+
"""
10931120
return self.ctx()
10941121

10951122
class Context(object):

0 commit comments

Comments
 (0)