Skip to content

Commit 0d83886

Browse files
pdg137dpgeorge
authored andcommitted
docs/esp32: Update pin access example with addresses for ESP32-S3.
Signed-off-by: Paul Grayson <[email protected]> Signed-off-by: Angus Gratton <[email protected]>
1 parent 7953089 commit 0d83886

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

docs/esp32/tutorial/peripheral_access.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,18 @@ the prescaler of the MCPWM0 peripheral.
3232
mem32[MCPWM0] = 0x55 # change PWM_CLK_PRESCALE
3333
print(hex(mem32[MCPWM0])) # read PWM_CLK_CFG_REG
3434
35+
The specific addresses will be different on different ESP32
36+
models. For example, ESP32-S3 uses these values:
37+
38+
.. code-block:: python3
39+
40+
DR_REG_DPORT_BASE = const(0x600C_0000)
41+
DPORT_PERIP_CLK_EN0_REG = const(DR_REG_DPORT_BASE + 0x0018)
42+
DPORT_PERIP_RST_EN0_REG = const(DR_REG_DPORT_BASE + 0x0020)
43+
DPORT_PWM0_CLK_EN = const(1 << 17)
44+
MCPWM0 = const(0x6001_E000 + 0x0004)
45+
...
46+
3547
Note that before a peripheral can be used its clock must be enabled and it must
3648
be taken out of reset. In the above example the following registers are used
3749
for this:

0 commit comments

Comments
 (0)