Project:USB Disco Dance Floor/v1/firmware: Difference between revisions

From London Hackspace Wiki
(Formatting updates)
(Added basic status/diagnostic commands)
Line 13: Line 13:
!Action
!Action
!width="100"|Min version
!width="100"|Min version
|-
!colspan="3" style="background: #ddd"|Status/Diagnostic Commands
|-
|-
!rowspan="2"|00
!rowspan="2"|00
|'''Reset display'''
|'''Reset'''
|1.0
|1.0
|-
|-
|colspan="2"|Resets the display, initialising all pixels to black.
|colspan="2"|Resets the board to an initial state, with all pixels off. The board sends four bytes representing its hardware and firmware versions (2 bytes each), followed by 2 bytes for hardware details. This command also resets the board ID to 0xFFFF (i.e. unset).
 
The high nybble of the first hardware info byte is the number of different colours supported (0x1, 0x3, or 0x4) and the low nybble is whether sensors are supported (0x1 for yes). The high nybble of the second byete specifies the number of bits needed to specify LED brightness. If this is different for different colours, the firmware will handle scaling. The low nybble does the same for sensor resolution. Note that, for the time being, resolutions should be a power of 2 (0x1, 0x2, 0x4, 0x8).
|-
|-
!rowspan="2"|01
!rowspan="2"|01
Line 24: Line 28:
|1.0
|1.0
|-
|-
|colspan="2"|Asks the device to identify itself. The controller sends its version number as two data bytes: major and minor version. The device will respond with a two-byte code containing its major and minor version. <!-- position? neighbours? -->
|colspan="2"|Informs the board of its two-byte board ID for this session. Note that board IDs 0x0000 and 0xFFFF are reserved. The board will respond with 0x00 (success).
|-
|-
!rowspan="2"|11
!rowspan="2"|02
|'''Update floor'''
|'''Ping'''
|1.0
|1.0
|-
|-
|colspan="2"|Update the entire floor with the given pattern.
|colspan="2"|Checks connectivity with the board. The board will respond with 0x00 (success)
|}
|}
<!--
10: Clear floor
12: Update floor RLE
13: Update row
14: Update row RLE
-->

Revision as of 17:33, 4 April 2011

USB Disco Dance Floor v1 Firmware
Created 2011-03-31
Members DMI
Project Status Prototyping


Introduction

The firmware will be responsible for listening for serial commands, and then acting upon them. This will primarily involve changing the display.

Commands

Commands start with a one-byte identifier, followed by zero or more data bytes. The number of data bytes is command-specific. The device should not output any data unless specified below.

Command Action Min version
Status/Diagnostic Commands
00 Reset 1.0
Resets the board to an initial state, with all pixels off. The board sends four bytes representing its hardware and firmware versions (2 bytes each), followed by 2 bytes for hardware details. This command also resets the board ID to 0xFFFF (i.e. unset).

The high nybble of the first hardware info byte is the number of different colours supported (0x1, 0x3, or 0x4) and the low nybble is whether sensors are supported (0x1 for yes). The high nybble of the second byete specifies the number of bits needed to specify LED brightness. If this is different for different colours, the firmware will handle scaling. The low nybble does the same for sensor resolution. Note that, for the time being, resolutions should be a power of 2 (0x1, 0x2, 0x4, 0x8).

01 Identify 1.0
Informs the board of its two-byte board ID for this session. Note that board IDs 0x0000 and 0xFFFF are reserved. The board will respond with 0x00 (success).
02 Ping 1.0
Checks connectivity with the board. The board will respond with 0x00 (success)