Skip to content

Commit f8bce13

Browse files
committed
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.
1 parent 0df20da commit f8bce13

1 file changed

Lines changed: 10 additions & 9 deletions

File tree

docs/library/uctypes.rst

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,11 @@ Following are encoding examples for various field types:
9696
Module contents
9797
---------------
9898

99-
.. class:: struct(descriptor, layout_type)
99+
.. class:: struct(descriptor, addr, layout_type-NATIVE)
100100

101-
Create a "foreign data structure" class based on its descriptor (encoded
102-
as a dictionary) and layout type (see below).
101+
Instantiate a "foreign data structure" object based on structure descriptor
102+
(encoded as a dictionary), layout type (see below), and actual structure
103+
address.
103104

104105
.. data:: LITTLE_ENDIAN
105106

@@ -140,16 +141,16 @@ Module contents
140141
so it can be both written too, and you will access current value
141142
at the given memory address.
142143

143-
Structure classes and instantiating structure objects
144+
Structure descriptors and instantiating structure objects
144145
-----------------------------------------------------
145146

146-
Given structure descriptor and layout type, you can instantiate a
147-
"structure class" using uctypes.struct() factory function. From it,
148-
you can instantiate a specific structure instance at a given
149-
memory address. Memory address usually comes from following sources:
147+
Given a structure descriptor dictionary and its layout type, you can
148+
instantiate a specific structure instance at a given memory address
149+
using uctypes.struct() constructor. Memory address usually comes from
150+
following sources:
150151

151152
* Predefined address, when accessing hardware registers on a baremetal
152-
port. Lookup these addresses in datasheet for a particular MCU/SoC.
153+
system. Lookup these addresses in datasheet for a particular MCU/SoC.
153154
* As return value from a call to some FFI (Foreign Function Interface)
154155
function.
155156
* From uctypes.addressof(), when you want to pass arguments to FFI

0 commit comments

Comments
 (0)