@@ -55,14 +55,17 @@ an ordinal pin number:
55
55
You can set ``pyb.Pin.debug(True) `` to get some debug information about
56
56
how a particular object gets mapped to a pin.
57
57
58
+ When a pin has the ``Pin.PULL_UP `` or ``Pin.PULL_DOWN `` pull-mode enabled,
59
+ that pin has an effective 40k Ohm resistor pulling it to 3V3 or GND
60
+ respectively (except pin Y5 which has 11k Ohm resistors).
58
61
59
62
Constructors
60
63
------------
61
64
62
65
.. class :: pyb.Pin(id, ...)
63
66
64
67
Create a new Pin object associated with the id. If additional arguments are given,
65
- they are used to initialise the pin. See `` init ` `.
68
+ they are used to initialise the pin. See :meth: ` pin. init `.
66
69
67
70
68
71
Class methods
@@ -88,24 +91,6 @@ Class methods
88
91
Methods
89
92
-------
90
93
91
- .. method :: pin.__str__()
92
-
93
- Return a string describing the pin object.
94
-
95
- .. method :: pin.af()
96
-
97
- Returns the currently configured alternate-function of the pin. The
98
- integer returned will match one of the allowed constants for the af
99
- argument to the init function.
100
-
101
- .. method :: pin.gpio()
102
-
103
- Returns the base address of the GPIO block associated with this pin.
104
-
105
- .. method :: pin.high()
106
-
107
- Set the pin to a high logic level.
108
-
109
94
.. method :: pin.init(mode, pull=Pin.PULL_NONE, af=-1)
110
95
111
96
Initialise the pin:
@@ -126,10 +111,37 @@ Methods
126
111
127
112
Returns: ``None ``.
128
113
114
+ .. method :: pin.high()
115
+
116
+ Set the pin to a high logic level.
117
+
129
118
.. method :: pin.low()
130
119
131
120
Set the pin to a low logic level.
132
121
122
+ .. method :: pin.value([value])
123
+
124
+ Get or set the digital logic level of the pin:
125
+
126
+ - With no argument, return 0 or 1 depending on the logic level of the pin.
127
+ - With ``value `` given, set the logic level of the pin. ``value `` can be
128
+ anything that converts to a boolean. If it converts to ``True ``, the pin
129
+ is set high, otherwise it is set low.
130
+
131
+ .. method :: pin.__str__()
132
+
133
+ Return a string describing the pin object.
134
+
135
+ .. method :: pin.af()
136
+
137
+ Returns the currently configured alternate-function of the pin. The
138
+ integer returned will match one of the allowed constants for the af
139
+ argument to the init function.
140
+
141
+ .. method :: pin.gpio()
142
+
143
+ Returns the base address of the GPIO block associated with this pin.
144
+
133
145
.. method :: pin.mode()
134
146
135
147
Returns the currently configured mode of the pin. The integer returned
@@ -158,15 +170,6 @@ Methods
158
170
will match one of the allowed constants for the pull argument to the init
159
171
function.
160
172
161
- .. method :: pin.value([value])
162
-
163
- Get or set the digital logic level of the pin:
164
-
165
- - With no argument, return 0 or 1 depending on the logic level of the pin.
166
- - With ``value `` given, set the logic level of the pin. ``value `` can be
167
- anything that converts to a boolean. If it converts to ``True ``, the pin
168
- is set high, otherwise it is set low.
169
-
170
173
171
174
Constants
172
175
---------
0 commit comments