GPIO Pins: Difference between revisions

From Hackspire
Jump to navigation Jump to search
(Added GPIO page and classic GPIO descriptions)
 
(Add port 20 for CX)
 
(2 intermediate revisions by one other user not shown)
Line 1: Line 1:
This section describes the GPIO interface and known GPIO pins.
==Memory Mapped I/O registers==
==Memory Mapped I/O registers==


Line 60: Line 62:


{|class="wikitable" style="text-align: center;"
{|class="wikitable" style="text-align: center;"
! width="20px" |
! scope="col" width="20px" |
! width="160px" | Classic
! scope="col" width="160px" | Classic
! width="160px" | CX
! scope="col" width="160px" | CX
|-
|-
! 0
! 0
Line 71: Line 73:
|-
|-
! 2
! 2
| Input bit is 0 if battery door open, 1 if closed ||
| Input bit is 0 if battery door open, 1 if closed || Active low - controls USB VBUS 5V output
|-
|-
! 3
! 3
Line 80: Line 82:
|-
|-
! 5
! 5
| ||
| Active low - controls USB VBUS 5V output ||
|-
|-
! 6
! 6
| ||
| colspan="2" | Active low - probably controls charging from USB.
|-
|-
! 7
! 7
Line 125: Line 127:
|-
|-
! 20
! 20
|  ||
|  || High if USB micro B plug attached
|-
|-
! 21
! 21
Line 160: Line 162:
|  ||
|  ||
|}
|}
* GPIO 1 (Section 0, bit 1): Touchpad "clock"
* GPIO 2 (Section 0, bit 2): Input bit is 0 if battery door open, 1 if closed (TI-Nspire CAS)
* GPIO 3 (Section 0, bit 3): Touchpad data
* GPIO 8 (Section 1, bit 0): Input bit is 0 if Reset Button is pressed.
* GPIO 19 (Section 2, bit 3): Input is 0 if WLAN Cradle attached
* GPIO 23 (Section 2, bit 7): Called LCD_OFF in diags mode
* GPIO 24 (Section 3, bit 0): Input bit is 1 if a keypad is not plugged in. (TI-Nspire non-CAS only?)

Latest revision as of 16:08, 31 August 2019

This section describes the GPIO interface and known GPIO pins.

Memory Mapped I/O registers

The GPIO registers are separated into sections:

  • Section 0: 90000000-9000003F
  • Section 1: 90000040-9000007F
  • Section 2: 90000080-900000BF
  • Section 3: 900000C0-900000FF
  • Section 5: 90000140-9000017F

Each register is a word, and only bits 0-7 of each are used. There can be up to 40 devices accessed by this setup, each known as a GPIO. Each GPIO is defined by one of the 8 bits in one of the sections. The number of the GPIO is the section number times 8 plus the bit number. Each GPIO has a status bit and can cause interrupts.

Section registers

The following addresses are offsets from the beginning of the GPIO section:

  • +00 (R): Masked interrupt status ([+04] & [+08])
  • +04 (R): Reads raw interrupt status (directly dependent on the GPIO input) or sticky interrupt status (becomes set when GPIO status changes) depending on bit in [+20]
  • +04 (W): Write 1 to the bit to reset the sticky interrupt status.
  • +08 (R): Reads current interrupt mask bit.
  • +08 (W): Write 1 to the bit to enable interrupt (set mask bit to 1)
  • +0C (W): Write 1 to the bit to disable interrupt (set mask bit to 0)

The following addresses should be changed with a read-modify-write pattern so as to not disturb other bits in the register.

  • +10 (R/W): Direction (set bit to 0 for output, 1 for input)
  • +14 (R/W): GPIO output bit
  • +18 (R): Reads GPIO input bit.
  • +1C (R/W): Setting bit to 1 will invert raw interrupt status (?)
  • +20 (R/W): Setting bit to 1 will use sticky interrupt status in [+04], or setting to 0 will use raw interrupt status.
  • +24 (R/W): (?)

Currently known pins

Bit/section number to GPIO pin
7 6 5 4 3 2 1 0
Section 0 7 6 5 4 3 2 1 0
Section 1 15 14 13 12 11 10 9 8
Section 2 23 22 21 20 19 18 17 16
Section 3 31 30 29 28 27 26 25 24


Classic CX
0
1 I2C clock - for communicating with the Touchpad (see Keypads#Touchpad I²C for details)
2 Input bit is 0 if battery door open, 1 if closed Active low - controls USB VBUS 5V output
3 I2C data - for communicating with the Touchpad (see Keypads#Touchpad I²C for details)
4
5 Active low - controls USB VBUS 5V output
6 Active low - probably controls charging from USB.
7
8 Input bit is 0 if Reset Button is pressed
9
10
11
12
13
14
15
16
17
18
19 Input is 0 if WLAN Cradle attached
20 High if USB micro B plug attached
21
22
23 Called LCD_OFF in diags mode
24 Input bit is 1 if a keypad is not plugged in
25
26
27
28
29
30
31