You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
connect(m, led_gpio.pins[n], platform.request("led", n, dir="io"))
44
45
@@ -84,25 +85,30 @@ class Mode(enum.Enum, shape=unsigned(2)):
84
85
Each `Mode.pin_x` field resets to `INPUT_ONLY`.
85
86
86
87
If `Mode.pin_x` is `INPUT_ONLY`:
87
-
-`pins[x].alt_mode` returns 0.
88
-
-`Input.pin_x` returns the last value of `pins[x].i` sampled on a clock cycle.
89
-
-`pins[x].oe` returns 0 `pins[x].o` return 0.
88
+
-`pins[x].oe` is 0.
89
+
-`pins[x].o` is connected to `Output.pin_x`.
90
+
-`Input.pin_x` is connected to `pins[x].i`.
91
+
-`alt_mode[x]` is 0.
90
92
91
93
If `Mode.pin_x` is `PUSH_PULL`:
92
-
-`pins[x].alt_mode` returns 0.
93
-
-`Input.pin_x` returns the last value of `pins[x].i` sampled on a clock cycle.
94
-
-`pins[x].oe` returns 1 and `pins[x].o` returns `Output.pin_x`.
94
+
-`pins[x].oe` is 1.
95
+
-`pins[x].o` is `Output.pin_x`.
96
+
-`Input.pin_x` is connected to `pins[x].i`.
97
+
-`alt_mode[x]` is 0.
95
98
96
99
If `Mode.pin_x` is `OPEN_DRAIN`:
97
-
-`pins[x].alt_mode` returns 0.
98
-
-`Input.pin_x` returns the last value of `pins[x].i` sampled on a clock cycle.
99
-
-`pins[x].oe` returns `~Output.pin_x` and `pins[x].o` returns 0.
100
+
-`pins[x].oe` is connected to `~Output.pin_x`.
101
+
-`pins[x].o` is 0.
102
+
-`Input.pin_x` is connected to `pins[x].i`.
103
+
-`alt_mode[x]` is 0.
100
104
101
105
If `Mode.pin_x` is `ALTERNATE`:
102
-
-`pins[x].alt_mode` returns 1.
103
-
-`Input.pin_x`, `pins[x].oe` and `pins[x].o` return implementation-specific values.
106
+
-`pins[x].oe` is 0.
107
+
-`pins[x].o` is connected to `Output.pin_x`.
108
+
-`Input.pin_x` is connected to `pins[x].i`.
109
+
-`alt_mode[x]` is 1.
104
110
105
-
If `ALTERNATE` mode is unimplemented, its behavior should be equivalent to `INPUT_ONLY` mode.
111
+
When `alt_mode[x]`is 1, a component connected to the GPIO peripheral (such as a pin multiplexer) may assign implementation-specific functions to `Input.pin_x` and `Output.pin_x`.
106
112
107
113
#### Input (read-only)
108
114
@@ -114,6 +120,8 @@ If `ALTERNATE` mode is unimplemented, its behavior should be equivalent to `INPU
114
120
{name: 'pin_3', bits: 1, attr: 'R'},
115
121
], {bits: 4})">
116
122
123
+
The number of synchronization stages between `pins[x].i` and `Input.pin_x` is defined by the `input_stages` parameter, which defaults to 2. Synchronization is done on rising edges of `ClockSignal("sync")`.
0 commit comments