summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-06-02 10:30:01 +0300
committerPaul Sokolovsky <pfalcon@users.sourceforge.net>2015-06-02 10:30:01 +0300
commitf8bce131c0189895786aabb752f801a401d0ff6d (patch)
treea0d7255a7b94615ef7f319098c74e47d8b456e42
parent0df20da4dd964f0dccc20cef5b2b443f93b33a65 (diff)
downloadmicropython-f8bce131c0189895786aabb752f801a401d0ff6d.tar.gz
micropython-f8bce131c0189895786aabb752f801a401d0ff6d.zip
docs/uctypes: Fix API description errors.
"Structure class" is its descriptor, encoded as a dictionary. Then, uctypes.struct() instantiates an actual object, and thus requires memory address.
-rw-r--r--docs/library/uctypes.rst19
1 files changed, 10 insertions, 9 deletions
diff --git a/docs/library/uctypes.rst b/docs/library/uctypes.rst
index ea5428ad7c..328b968f49 100644
--- a/docs/library/uctypes.rst
+++ b/docs/library/uctypes.rst
@@ -96,10 +96,11 @@ Following are encoding examples for various field types:
Module contents
---------------
-.. class:: struct(descriptor, layout_type)
+.. class:: struct(descriptor, addr, layout_type-NATIVE)
- Create a "foreign data structure" class based on its descriptor (encoded
- as a dictionary) and layout type (see below).
+ Instantiate a "foreign data structure" object based on structure descriptor
+ (encoded as a dictionary), layout type (see below), and actual structure
+ address.
.. data:: LITTLE_ENDIAN
@@ -140,16 +141,16 @@ Module contents
so it can be both written too, and you will access current value
at the given memory address.
-Structure classes and instantiating structure objects
+Structure descriptors and instantiating structure objects
-----------------------------------------------------
-Given structure descriptor and layout type, you can instantiate a
-"structure class" using uctypes.struct() factory function. From it,
-you can instantiate a specific structure instance at a given
-memory address. Memory address usually comes from following sources:
+Given a structure descriptor dictionary and its layout type, you can
+instantiate a specific structure instance at a given memory address
+using uctypes.struct() constructor. Memory address usually comes from
+following sources:
* Predefined address, when accessing hardware registers on a baremetal
- port. Lookup these addresses in datasheet for a particular MCU/SoC.
+ system. Lookup these addresses in datasheet for a particular MCU/SoC.
* As return value from a call to some FFI (Foreign Function Interface)
function.
* From uctypes.addressof(), when you want to pass arguments to FFI