ALE Peripherals MMIO Manual

Canvas

AddressSizeDescription
base+0x00byteStoring “1” triggers the canvas to write an array of up to 504 bytes representing up to 126 pixels to the screen. The register is set to 0 when writing is completed.
base+0x02halfArray size (in bytes).
base+0x04wordThe initial position to write the array on the canvas. The canvas is represented as a 512x512x4-byte one-dimensional array representing 512x512 pixels.
base+0x08
to
base+0x200
word504-byte array representing up to 126 pixels. Each pixel takes 4 bytes, one byte for each value: Red, Green, Blue, and Alpha (in this order).

General Purpose Timer

AddressSizeDescription
base+0x00byteStoring “1” triggers the GPT device to start reading the current system time. The register is set to 0 when the reading is completed.
base+0x04wordStores the time (in milliseconds) at the moment of the last reading by the GPT.
base+0x08wordStoring v > 0 programs the GPT to generate an external interruption after v milliseconds. It also sets this register to 0 after v milliseconds (immediately before generating the interruption).

MIDI Synthesizer

AddressSizeDescription
base+0x00byteStoring ch ≥ 0 triggers the synthesizer to start playing a MIDI note in the channel ch.
base+0x02shortInstrument ID.
base+0x04byteNote.
base+0x05byteNote velocity.
base+0x06shortNote duration.

Self Driving Car

AddressSizeDescription
base+0x00byteStoring “1” triggers the GPS device to start reading the coordinates and rotation of the car. The register is set to 0 when the reading is completed.
base+0x01byteStoring “1” triggers the Line Camera device to capture an image. The register is set to 0 when the capture is completed.
base+0x02byteStoring “1” triggers the Ultrasonic Sensor device to measure the distance in front of the car. The register is set to 0 when the measurement is completed.
base+0x04wordStores the Euler angle X of the car rotation at the moment of the last reading by the GPS.
base+0x08wordStores the Euler angle Y of the car rotation at the moment of the last reading by the GPS.
base+0x0CwordStores the Euler angle Z of the car rotation at the moment of the last reading by the GPS.
base+0x10wordStores the X-axis of the car position at the moment of the last reading by the GPS.
base+0x14wordStores the Y-axis of the car position at the moment of the last reading by the GPS.
base+0x18wordStores the Z-axis of the car position at the moment of the last reading by the GPS.
base+0x1CwordStores the distance (in centimeters) between the Ultrasonic sensor and the nearest obstacle. Returns -1 if there’s no obstacle within 20m.
base+0x20byteSets the steering wheel direction. Negative values indicate steering to the left, positive values indicate steering to the right.
base+0x21byteSets the engine direction.
1: forward.
0: off.
-1: backward.
base+0x22byteSets the hand break. (1 = enabled)
base+0x24256-byte arrayStores the image captured by the Line Camera. Each byte represents the luminance of a pixel.

Serial Port

The serial port is connected to the terminal (stdout and stdin).

AddressSizeDescription
base+0x00byteStoring “1” triggers the serial port to write (to the stdout) the byte stored at base+0x01. The register is set to 0 when writing is completed.
base+0x01byteByte to be written. ID
base+0x02byteStoring “1” triggers the serial port to read (from the stdin) a byte and store it at base+0x03. The register is set to 0 when reading is completed.
base+0x03byteByte read. Null when stdin is empty.