Skip to content

Commit 4561ed6

Browse files
Documentation update for Pinmux and GPIO
Also update reference manual based on GPIO array. The tables in the pinmux are automatically generated.
1 parent 30f03e2 commit 4561ed6

6 files changed

Lines changed: 270 additions & 82 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
# Licensed under the Apache License, Version 2.0, see LICENSE for details.
33
# SPDX-License-Identifier: Apache-2.0
44
data/xbar_main_generated.hjson linguist-generated=true
5+
doc/ip/pinmux.md linguist-generated=true
56
rtl/bus/sonata_xbar_main.sv linguist-generated=true
67
rtl/bus/tl_main_pkg.sv linguist-generated=true
78
rtl/bus/tl_ifetch_pkg.sv linguist-generated=true

doc/dev/ref-manual.md

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,9 +46,6 @@ For all registers in this section, the functionality is mapped onto the least si
4646
| 0x8000_3000 | 4 KiB | [HyperRAM][] |
4747
| 0x8000_4000 | 4 KiB | Reserved |
4848
| 0x8000_5000 | 4 KiB | [Pinmux][] |
49-
| 0x8000_6000 | 4 KiB | R-Pi Header GPIO |
50-
| 0x8000_7000 | 4 KiB | Arduino GPIO |
51-
| 0x8000_8000 | 4 KiB | PMOD GPIO |
5249
| 0x8000_9000 | 4 KiB | RGB LED controller |
5350
| 0x8000_A000 | 4 KiB | [Hardware revoker][] |
5451
| 0x8000_B000 | 4 KiB | [ADC][] |

doc/ip/gpio.md

Lines changed: 25 additions & 72 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,24 @@ For the input this module provides a raw value as well as a debounced value.
88
Debouncing is useful to avoid counting a single button press multiple times.
99
For more information on contact bounce, see [this Wikipedia page](https://en.wikipedia.org/wiki/Switch#Contact_bounce).
1010

11-
| Offset | Register |
12-
|--------|----------|
13-
| 0x0000 | Output |
14-
| 0x0004 | Input |
15-
| 0x0008 | Debounced input |
16-
| 0x000C | Debounce threshold |
17-
| 0x6000 | R-Pi output |
18-
| 0x6004 | R-Pi input |
19-
| 0x6008 | R-pi debounced input |
20-
| 0x600C | R-pi debounce threshold |
21-
| 0x7000 | Arduino output |
22-
| 0x7004 | Arduino input |
23-
| 0x7008 | Arduino debounced input |
24-
| 0x700C | Arduino debounce threshold |
25-
| 0x8000 | PMOD output |
26-
| 0x8004 | PMOD input |
27-
| 0x8008 | PMOD debounced input |
28-
| 0x800C | PMOD debounce threshold |
11+
| Offset | Register |
12+
|--------|-------------------------|
13+
| 0x0000 | Output |
14+
| 0x0004 | Input |
15+
| 0x0008 | Debounced input |
16+
| 0x000C | Output enable |
17+
| 0x0010 | R-Pi output |
18+
| 0x0014 | R-Pi input |
19+
| 0x0018 | R-pi debounced input |
20+
| 0x001C | R-pi output enable |
21+
| 0x0020 | Arduino output |
22+
| 0x0024 | Arduino input |
23+
| 0x0028 | Arduino debounced input |
24+
| 0x002C | Arduino output enable |
25+
| 0x0030 | PMOD output |
26+
| 0x0034 | PMOD input |
27+
| 0x0038 | PMOD debounced input |
28+
| 0x003C | PMOD output enable |
2929

3030
## Output
3131

@@ -66,69 +66,28 @@ The only difference between the registers is that the latter has debounced signa
6666

6767
The input registers are used to interact with the joystick, the button and the DIP switches that are available on the Sonata board.
6868

69-
## Debounce threshold
70-
71-
**Not implemented yet.**
72-
73-
This register indicates how many clock cycles an input needs to be stable before it shows up on the output.
74-
The same threshold applies to all of the inputs.
75-
76-
| Bit offset | Description |
77-
|------------|-------------|
78-
| 31-0 | Threshold |
79-
8069
## Raspberry Pi HAT
8170

82-
The Raspberry Pi HAT header has 11 GPIO pins.
71+
The Raspberry Pi HAT header has 27 pins that can act as GPIO.
72+
Some can be remapped to other IP blocks (see Pinmux).
8373
When writing, it only writes the bits for which the output is set to enable.
8474
The input and output registers have the same bit mapping.
8575

8676
| Bit offset | Description |
8777
|------------|-------------|
88-
| 10 | GPIO 27 |
89-
| 9 | GPIO 26 |
90-
| 8 | GPIO 25 |
91-
| 7 | GPIO 24 |
92-
| 6 | GPIO 23 |
93-
| 5 | GPIO 22 |
94-
| 4 | GPIO 13 |
95-
| 3 | GPIO 12 |
96-
| 2 | GPIO 6 |
97-
| 1 | GPIO 5 |
98-
| 0 | GPIO 4 |
99-
100-
For the output register it is teh same order as above:
101-
| Bit offset | Description |
102-
|------------|-------------|
103-
| 26-16 | Output enable |
104-
| 10-0 | Output value |
78+
| 27-0 | g27 - g0 |
10579

10680
When the output enable is set to zero it instead acts as an input pin.
10781

10882
## Arduino Shield
10983

110-
The Arduino Shield header has 10 GPIO pins.
84+
The Arduino Shield header has 17 pins that can act as GPIO.
11185
When writing, it only writes the bits for which the output is set to enable.
11286
The input and output registers have the same bit mapping.
11387

114-
| Bit offset | Description |
115-
|------------|-------------|
116-
| 9 | GPIO 9 |
117-
| 8 | GPIO 8 |
118-
| 7 | GPIO 7 |
119-
| 6 | GPIO 6 |
120-
| 5 | GPIO 5 |
121-
| 4 | GPIO 4 |
122-
| 3 | GPIO 3 |
123-
| 2 | GPIO 2 |
124-
| 1 | GPIO 1 |
125-
| 0 | GPIO 0 |
126-
127-
For the output register it is teh same order as above:
128-
| Bit offset | Description |
129-
|------------|-------------|
130-
| 25-16 | Output enable |
131-
| 9-0 | Output value |
88+
| Bit offset | Description |
89+
|------------|--------------|
90+
| 17-0 | GPIO 17 to 0 |
13291

13392
When the output enable is set to zero it instead acts as an input pin.
13493

@@ -143,10 +102,4 @@ The input and output registers have the same bit mapping.
143102
| 15-8 | PMOD 1 |
144103
| 7-0 | PMOD 0 |
145104

146-
For the output register it is teh same order as above:
147-
| Bit offset | Description |
148-
|------------|-------------|
149-
| 31-16 | Output enable |
150-
| 15-0 | Output value |
151-
152105
When the output enable is set to zero it instead acts as an input pin.

doc/ip/pinmux.md

Lines changed: 208 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)