Emulators and GPIO Pins: Difference between pages

From Hackspire
(Difference between pages)
Jump to navigation Jump to search
m (typo + rephrasing Qt)
 
(Add port 20 for CX)
 
Line 1: Line 1:
=Current programs=
This section describes the GPIO interface and known GPIO pins.
==nspire_emu==
'''nspire_emu''' is a TI-Nspire Clickpad/TouchPad/LabStation/CX (CAS) emulator, and was the first one made. It only supports Windows, but is compatible with [http://www.winehq.org/ Wine] on other OSes. You can download it [https://tiplanet.org/modules/archives/download.php?id=10068 here] or [https://www.omnimaga.org/ti-nspire-projects/ti-nspire-emulator/?action=dlattach;attach=14364 here]. Its official discussion thread is on [http://www.omnimaga.org/ti-nspire-projects/ti-nspire-emulator/ Omnimaga].


Most TI-Nspire emulators derive from ''nspire_emu''. Note that these custom versions are not always kept up-to-date with the latest version of ''nspire_emu''.
==Memory Mapped I/O registers==


'''Setup:'''
The GPIO registers are separated into sections:
*Use [https://tiplanet.org/forum/archives_voir.php?id=3829 PolyDumper] to dump the ''boot1.img.tns'' and ''boot2.img.tns'' from your TI-Nspire.
*Open a DOS console
*Follow [http://www.omnimaga.org/ti-nspire-projects/ti-nspire-emulator/msg279905/#msg279905 these instructions]


==Firebird==
* Section 0: 90000000-9000003F
'''Firebird''' is a fork of nspire_emu. It runs natively on Windows, Linux, Mac, Android, and iOS, thanks to a Qt-based GUI. It is still in development, but is available [https://github.com/nspire-emus/firebird/releases/latest on GitHub].<br/>
* Section 1: 90000040-9000007F
Added/Changed features compared to nspire_emu are mainly improvements to the emulator core to make it more powerful as well as a fully-featured GUI to go along more user-friendly additions.<br/>
* Section 2: 90000080-900000BF
Like nspire_emu, use [https://tiplanet.org/forum/archives_voir.php?id=3829 PolyDumper] to dump the ''boot1.img.tns'' and ''boot2.img.tns'' from your TI-Nspire. Diags and Manuf can also be dumped and used in Firebird (see the flash creation feature)
* Section 3: 900000C0-900000FF
* Section 5: 90000140-9000017F


=Obsolete programs=
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.


==Ncubate==
===Section registers===
'''[http://www.omnimaga.org/other-calculator-discussion-and-news/ncubate-enhanced-ti-nspire-emulator/ Ncubate]''' is a derived version of ''nspire_emu'' enhanced with features useful to developers, such as state saving/reloading, additional debugger commands and [[Debugging programs#Ncubate's GDB support|support for the GDB debugger]].


It is not compatible with OS v3.x.
The following addresses are offsets from the beginning of the GPIO section:


==Xspire==
* +00 (R): Masked interrupt status ([+04] & [+08])
'''Xspire''' is a port of ''nspire_emu'' for the GTK+ GUI library, compatible with Windows and Linux. This port also supports skins. You can download it from the [http://www.unitedti.org/forum/index.php?showtopic=8191&st=720 United-TI thread] (account required). Note that a more recent version may be available further in the thread. The GDK/GTK+ libraries are required for it to work (Windows users should use the [http://sourceforge.net/projects/gtk-win/ Windows port]).
* +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)


==Nspire Memory Editor==
The following addresses should be changed with a read-modify-write pattern so as to not disturb other bits in the register.
The '''Nspire Memory Editor''' plugs itself into ''nspire_emu'' to offer advanced memory-related features, such as hexadecimal memory edition, string and binary search, memory chunks read and write, and string or instruction-based breakpoints. Download it from the [http://www.unitedti.org/forum/index.php?showtopic=8191&st=720 United-TI thread] (account required). Note that a more recent version may be available further in the thread.
 
* +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==
 
{|class="wikitable"
|+ 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
|}
 
 
{|class="wikitable" style="text-align: center;"
! scope="col" width="20px" |
! scope="col" width="160px" | Classic
! scope="col" width="160px" | 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
| colspan="2" | 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
| colspan="2" | Input is 0 if WLAN Cradle attached
|-
! 20
|  || High if USB micro B plug attached
|-
! 21
|  ||
|-
! 22
|  ||
|-
! 23
| colspan="2" | 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
|  ||
|}

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