Project:USB Disco Dance Floor/v1/firmware: Difference between revisions
From London Hackspace Wiki
Project:USB Disco Dance Floor/v1/firmware (view source)
Revision as of 08:49, 7 April 2011
, 7 April 2011Finished adding details for all commands
(Updated other table styles) |
(Finished adding details for all commands) |
||
Line 124: | Line 124: | ||
|- | |- | ||
!rowspan="3"|10 | !rowspan="3"|10 | ||
|colspan="2"|'''Clear | |colspan="2"|'''Clear module''' | ||
|rowspan="2"|1.0 | |rowspan="2"|1.0 | ||
|- | |- | ||
Line 130: | Line 130: | ||
|width="42%"|'''Data out:''' ''None'' | |width="42%"|'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Clears the entire module, resetting all pixels to black. | ||
|- | |- | ||
!rowspan="3"|11 | !rowspan="3"|11 | ||
|colspan="2"|'''Write | |colspan="2"|'''Write module''' | ||
|rowspan="2"|1.0 | |rowspan="2"|1.0 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 16 colour specs | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Set the intensities of all pixels on the module. Note: if colour specs contain zero-padding, this should '''not''' be removed in the data for this command. | ||
|- | |- | ||
!rowspan="3"|18 | !rowspan="3"|18 | ||
Line 145: | Line 145: | ||
|rowspan="2"|1.0 | |rowspan="2"|1.0 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: row number | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Clears the given row, resetting all pixels to black. | ||
|- | |- | ||
!rowspan="3"|19 | !rowspan="3"|19 | ||
Line 154: | Line 154: | ||
|rowspan="2"|1.0 | |rowspan="2"|1.0 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: row number, 4 colour specs | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Set the intensities of all pixels in the given row. The data is ordered with increasing X. Note: if colour specs contain zero-padding, this should '''not''' be removed in the data for this command. | ||
|} | |} | ||
Line 171: | Line 171: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|width="42%"|'''Data in:''' | |width="42%"|'''Data in:''' 1 byte: co-ordinate, 1 colour spec | ||
|width="42%"|'''Data out:''' ''None'' | |width="42%"|'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"|''Should only be used very rarely, as it's data-inefficient.'' | |colspan="3"|''Should only be used very rarely, as it's data-inefficient.'' Sets the pixel at (x, y) to the given colour. The low nybble of the co-ordinate is ignored. | ||
|- | |- | ||
!rowspan="3"|51 | !rowspan="3"|51 | ||
Line 180: | Line 180: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: co-ordinate, 1 colour spec | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Draws a 1-pixel-width line in the given colour from absolute co-ordinates (x, y) to absolute co-ordinates (w, h) using Bresenham's algorithm. | ||
|- | |- | ||
!rowspan="3"|52 | !rowspan="3"|52 | ||
Line 189: | Line 189: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: co-ordinate, 1 colour spec | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Draws a hollow rectangle in the given colour, with top-left corner at (x, y) and bottom right corner at (w, h). | ||
|- | |- | ||
!rowspan="3"|53 | !rowspan="3"|53 | ||
Line 198: | Line 198: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: co-ordinate, 1 colour spec | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Draws a filled rectangle in the given colour, with top-left corner at (x, y) and bottom right corner at (w, h). | ||
|- | |- | ||
!rowspan="3"|54 | !rowspan="3"|54 | ||
|colspan="2"|'''Scroll | |colspan="2"|'''Scroll module''' | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: scroll spec | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Scrolls the image on the module according to the given spec. Pixels scrolled off the edge do not wrap, and new pixels will be black. | ||
|- | |- | ||
!rowspan="3"|55 | !rowspan="3"|55 | ||
Line 216: | Line 216: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 2 bytes: co-ordinate (1), scroll spec (1) | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|Scrolls the image within the rectangle from (x, y) to (w, h) according to the given spec. Pixels scrolled off the edge do not wrap, and new pixels will be black. | ||
|- | |||
!rowspan="3"|56 | |||
|colspan="2"|'''Scroll module with data''' | |||
|rowspan="2"|1.2 | |||
|- | |||
|'''Data in:''' 1 byte: scroll spec, 4-16 colour specs | |||
|'''Data out:''' 4-16 colour specs | |||
|- | |||
|colspan="3"|Scrolls the image on the module according to the given spec. Pixels scrolled off the edge do not wrap but will be returned in increasing X/Y co-ordinates, and new pixels will be taken from the colour specs given, in increasing X/Y co-ordinates. | |||
|- | |||
!rowspan="3"|57 | |||
|colspan="2"|'''Scroll rectangle with data''' | |||
|rowspan="2"|1.2 | |||
|- | |||
|'''Data in:''' 2 bytes: co-ordinate (1), scroll spec (1); 1-16 colour specs | |||
|'''Data out:''' 1-16 colour specs | |||
|- | |||
|colspan="3"|Scrolls the image within the rectangle from (x, y) to (w, h) according to the given spec. Pixels scrolled off the edge do not wrap but will be returned in increasing X/Y co-ordinates, and new pixels will be taken from the colour specs given, in increasing X/Y co-ordinates. | |||
|- | |- | ||
!rowspan="3"|5E | !rowspan="3"|5E | ||
Line 225: | Line 243: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 2 bytes: pattern, 1 colour spec | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|The first two bytes define the pattern to be drawn, with the set bits corresponding to a pixel being set to the given colour. The bits are ordered in the usual way, so the highest bit of the pair is (0,0), the highest of the second byte is (0,2), and the lowest of the pair is (3, 3). | ||
|- | |- | ||
!rowspan="3"|5F | !rowspan="3"|5F | ||
Line 234: | Line 252: | ||
|rowspan="2"|1.1 | |rowspan="2"|1.1 | ||
|- | |- | ||
|'''Data in:''' | |'''Data in:''' 1 byte: co-ordinate, 1-16 colour specs | ||
|'''Data out:''' ''None'' | |'''Data out:''' ''None'' | ||
|- | |- | ||
|colspan="3"| | |colspan="3"|The co-ordinate byte defines a rectangle from (x, y) to (w, h), which is filled with the colour specs in the usual ordering. | ||
|} | |} | ||