GPIO Registers: Difference between revisions
Rewrite page |
|||
Line 4: | Line 4: | ||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! Old3DS | |||
! Name | ! Name | ||
! Address | ! Address | ||
! Width | ! Width | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_DATA|GPIO1_DATA]] | |||
| 0x10147000 | | 0x10147000 | ||
| | | 1 | ||
| | |- | ||
| style="background: green" | Yes | |||
| [[#GPIOn_DATA|GPIO2_DATA]] | |||
| 0x10147010 | |||
| 1 | |||
|- | |||
| style="background: green" | Yes | |||
| [[#GPIOn_DIR|GPIO2_DIR]] | |||
| 0x10147011 | |||
| 1 | |||
|- | |||
| style="background: green" | Yes | |||
| [[#GPIOn_INTCFG|GPIO2_INTCFG]] | |||
| 0x10147012 | |||
| 1 | |||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[# | | [[#GPIOn_INTEN|GPIO2_INTEN]] | ||
| | | 0x10147013 | ||
| | | 1 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_DATA2|GPIO2_DATA2]] | |||
| 0x10147014 | | 0x10147014 | ||
| 2 | | 2 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_DATA|GPIO3_DATA]] | |||
| 0x10147020 | | 0x10147020 | ||
| 2 | | 2 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_DIR|GPIO3_DIR]] | |||
| 0x10147022 | | 0x10147022 | ||
| 2 | | 2 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_INTCFG|GPIO3_INTCFG]] | |||
| 0x10147024 | | 0x10147024 | ||
| 2 | | 2 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[# | | [[#GPIOn_INTEN|GPIO3_INTEN]] | ||
| 0x10147026 | |||
| 2 | | 2 | ||
|- | |- | ||
| | | style="background: green" | Yes | ||
| [[#GPIOn_DATA2|GPIO2_DATA2]] | |||
| 0x10147028 | | 0x10147028 | ||
| 2 | | 2 | ||
| | |- | ||
|} | |} | ||
Line 131: | Line 147: | ||
= Descriptions = | = Descriptions = | ||
== | == GPIO == | ||
=== GPIO pins === | |||
[[GPIO services]] bitmasks use this table, in that order: | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! Bit | ! Bit | ||
! IRQ ID | |||
! Description | ! Description | ||
|- | |- | ||
| 0 | | 0 | ||
| ? | | ? | ||
| GPIO1_0 (?) | |||
|- | |- | ||
| | | 1 | ||
| | | 0x63 | ||
| Touch Pen down | |||
|- | |- | ||
| | | 2 | ||
| | | 0x60 | ||
| | | Shell closed | ||
|-style="border-top: double" | |||
| 0 | |||
| 0x64 | |||
| Headphones inserted | |||
|- | |- | ||
| 0- | | 1 | ||
| | | 0x66 | ||
| GPIO2_1 (?) | |||
|-style="border-top: double" | |||
| DATA2.0 | |||
| - | |||
| GPIO2_DATA2_0 (wifi related?) | |||
|-style="border-top: double" | |||
| 0 | |||
| 0x68 | |||
| C-stick | |||
|- | |- | ||
| 1 | | 1 | ||
| | | 0x69 | ||
| IrDA | |||
|- | |||
| 2 | |||
| 0x6A | |||
| Gyro | |||
|- | |- | ||
| 3 | | 3 | ||
| | | 0x6B | ||
| GPIO3_3 (?) | |||
|- | |- | ||
| 4 | | 4 | ||
| | | 0x6C | ||
| GPIO3_4 (?) | |||
|- | |- | ||
| 5- | | 5 | ||
| | | 0x6D | ||
| GPIO3_5 (?) | |||
|- | |||
| 6 | |||
| 0x6E | |||
| GPIO3_6 (?) | |||
|- | |||
| 7 | |||
| 0x6F | |||
| GPIO3_7 (?) | |||
|- | |||
| 8 | |||
| 0x70 | |||
| GPIO3_8 (?) | |||
|- | |||
| 9 | |||
| 0x71 | |||
| MCU | |||
|- | |||
| 10 | |||
| 0x72 | |||
| NFC | |||
|- | |||
| 11 | |||
| 0x73 | |||
| GPIO3_11 (?) | |||
|- | |||
|-style="border-top: double" | |||
| DATA2.0 | |||
| - | |||
| GPIO3_DATA2_0 (wifi related?) | |||
|} | |} | ||
=== | === GPIOn_DATA === | ||
Pin values, one bit per pin. | |||
=== GPIOn_DIR === | |||
Pin directions for GPIO2 and GPIO3, one bit per pin. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! | ! Value | ||
! Description | ! Description | ||
|- | |- | ||
| 0 | | 0 | ||
| | | Input | ||
|- | |- | ||
| | | 1 | ||
| | | Output | ||
|} | |} | ||
=== | === GPIOn_INTCFG === | ||
Interrupt configuration for GPIO2 and GPIO3 pins (not the extra ones), one bit per pin. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! | ! Value | ||
! Description | ! Description | ||
|- | |- | ||
| 0 | | 0 | ||
| | | Falling edge | ||
|- | |- | ||
| 1 | | 1 | ||
| | | Rising edge | ||
|} | |} | ||
=== | === GPIOn_INTEN === | ||
Interrupt enable bits for GPIO2 and GPIO3 pins (not the extra ones), one bit per pin. | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! | ! Value | ||
! Description | ! Description | ||
|- | |- | ||
| 0 | | 0 | ||
| | | Interrupt disabled | ||
|- | |- | ||
| | | 1 | ||
| | | Interrupt enabled | ||
|} | |} | ||
=== | === GPIOn_DATA2 === | ||
Extra pins for GPIO2 and GPIO3 (one bit each). These two pins, in total, are not bound to any IRQ and are not configurable. | |||
=== Default values === | |||
After bootrom initialization, these are the values of the registers: | |||
{| class="wikitable" border="1" | {| class="wikitable" border="1" | ||
! | ! Address | ||
! | ! Value | ||
|- | |||
| 0x10147000 | |||
| 0x0003 | |||
|- | |||
| 0x10147010 | |||
| 0x00000002 | |||
|- | |||
| 0x10147014 | |||
| 0x0000 | |||
|- | |||
| 0x10147020 | |||
| 0x00000DFB | |||
|- | |- | ||
| | | 0x10147024 | ||
| | | 0x00000000 | ||
|- | |- | ||
| | | 0x10147028 | ||
| | | 0x0000 | ||
|} | |} | ||
Line 284: | Line 362: | ||
| 15 | | 15 | ||
| DS SIO SI pin (rtc irq pin) | | DS SIO SI pin (rtc irq pin) | ||
|} | |} |