SPI Demos

# ARM7 Processor Peripheral Sample Demos

## Location

`$TwlSDK/build/demos/spi
$TwlSDK/build/demos.TWL/spi`

## Compilation

Move to the `$TwlSDK/build/demos/spi` (or `$TwlSDK/build/demos.TWL/spi`) directory and enter the following.

> `% make`

The compilation begin, and the SRL executable file and the NEF or TEF files with binary information are generated in `$TwlSDK/build/demos/fs/(sample name)/bin/(platform)/(target)/`.

> `$TwlSDK/build/demos/spi/(sample name)/bin/(platform)/(target)/`
> `$TwlSDK/build/demos.TWL/spi/(sample name)/bin/(platform)/(target)/`

For example:

> `$TwlSDK/build/demos/spi/tp-1/bin/ARM9-TS/Release/main.srl`

is the executable file for the `tp-1` demo.

## Execution

### For NITRO ROMs

If using the Ensata emulator:

- Execute NEF and SRL files with ensata

If using IS-NITRO-DEBUGGER:

- Load and execute an NLF file with IS-NITRO-DEBUGGER
- Execute an SRL file with IS-NITRO-DEBUGGER
- Execute an SRL file with IS-NITRO-DEBUGGER using the `loadrun.exe` tool from a command line

If using IS-TWL-DEBUGGER:

- Load and execute an NLF file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line

### For TWL/NITRO Hybrid ROMs

If using IS-NITRO-DEBUGGER:

- Execute an SRL file with IS-NITRO-DEBUGGER
- Execute an SRL file with IS-NITRO-DEBUGGER using the `loadrun.exe` tool from a command line

If using IS-TWL-DEBUGGER:

- Load and execute a TLF file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line

### For TWL Limited ROMs

If using IS-TWL-DEBUGGER:

- Load and execute a TLF file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER
- Execute an SRL file with IS-TWL-DEBUGGER using the `loadrun.TWL.exe` tool from a command line

## Description

Name | Directory | Operation
--- | --- | ---
`tp-1` | `demos` | Displays touch panel input positions on the screen.
`tp-2` | `demos` | Displays the track of touch panel input positions on the screen.
`mic-1` | `demos` | Displays the microphone voice input status on the screen as a waveform.
`mic-2` | `demos` | Displays microphone voice input status on the screen as a waveform, and outputs text data. The `mic2wav.exe` tool can convert the obtained data into a WAV file.
`mic-3` | `demos.TWL` | Displays a waveform on the screen indicating the state of audio input, based on the TWL's own microphone auto-sampling methods.
`mic-4` | `demos.TWL` | Displays a waveform on the screen indicating the audio input status, based on the TWL's own microphone auto-sampling methods, and outputs it as text data. The `mic2wav.exe` tool can convert the obtained data into a WAV file.
`spiMonkey` | `demos` | Displays touch screen and microphone input status on the screen while playing the background music.
`spiMonkey2` | `demos` | Displays touch screen and microphone input status on the screen while playing BGM. Unlike `spiMonkey`, it uses automatic sampling to sample the microphone.
`spiMonkey3` | `demos.TWL` | Displays touch screen and microphone input status on the screen while playing BGM. Unlike `spiMonkey2`, it uses the TWL's own auto-sampling method to sample the microphone.
`pm-1` | `demos` | Enters sleep mode or power save mode by pressing the power button or closing the cover.
`pm-2` | `demos.TWL` | When the power button is pressed, the system will wait for the user operation to actually exit the application.
`pmAmpGain` | `demos` | Manipulates the gain of the audio input through the microphone. The results of sampling the audio input are displayed on the screen as a waveform, much like with the `mic-1` demo.
`pmAmpGainLevel` | `demos.TWL` | Manipulates the gain of the audio input through the microphone. Unlike `pmAmpGain`, this demo can manipulate the gain with a finer resolution thanks to the TWL's unique features.

## Operation

`mic-1`, `mic-2`, `spiMonkey`, `spiMonkey2`, and `pm-1` do not function properly with `ensata`.
`mic-1` and `mic-2` function normally only when using NITRO ROM.
`tp-1`, `tp-2`, `spiMonkey`, and `spiMonkey2` attempt to read touch panel calibration values from the non-volatile memory (NVRAM) in the DS. If they do not succeed they will terminate with an exception. In this case, use the DS Start menu that is built into the Nintendo DS to store calibration results in NVRAM.

## See Also

SPI Function List

## Revision History

2008/11/13 Added text about `pm-2`.
2008/07/15 Added descriptions about `mic-3`, `mic-4`, `spiMonkey3`, `pmAmpGain`, and `pmAmpGainLevel`.
2008/07/11 Changed notation to correspond with TWL.
2008/04/25 Touched up the table. Changed the lists for TWL.
2005/05/10 Added information about `spiMonkey2`.
2005/03/02 Revised descriptions to reflect current support environment conditions.
2004/08/17 Standardized the notation of IS-NITRO-EMULATOR.
2004/08/03 Added `pm-1`.
2004/07/10 Changed from `.bin` to `.srl`.
2004/06/18 Initial version.

CONFIDENTIAL