A handler provides one or more callable functions. Before the functions are accessible over the remote procedure call interface the handler must be connected to the system. A handler can be identified by the handler type.
A handler type belongs always to a group with a base type. Functions defined in the base type must be available in all subtypes. This ensures that a client with support for a base type can at least access the basic functionality of a handler even if that specific subtype isn’t supported.
The development process of an API can be classified by three states:
To register a new handler type feel free to open a new request by using the issue tracker on github.
Start | End | Mask | Name | Status |
---|---|---|---|---|
0x0100 | 0x01FF | 8 | Base Pixel Strip | Beta |
0x0180 | 0x01FF | 9 | Extended Pixel Strip | Experimental |
0x0181 | Adafruit_NeoPixel | Experimental | ||
0x0200 | 0x02FF | 8 | Base/Extended Matrix | Beta |
0x0280 | 0x02FF | 9 | Base/Extended Matrix | Beta |
0x0281 | Colorduino_GFX | Experimental | ||
0xFF00 | 0xFFFF | 8 | Custom handlers | n/a |
ID | Function |
---|---|
0x01 | base_pixel_strip::getColorCount() |
0x02 | base_pixel_strip::getPixelCount() |
0x11 | base_pixel_strip::setPixelColor() |
0x12 | base_pixel_strip::setRangeColor() |
Get the number of colors. Return value should be 1, 2 or 3.
Returns: | Number of colors. |
---|
Get the number of available pixels.
Returns: | Number of pixels |
---|
Set the color of a pixel. All color values MUST be given and spare colors will be ignored by the device.
Parameters: |
|
---|
Set the color of a range of pixels.
Parameters: |
|
---|
The Base Matrix handler is inspired by the Adafruit_GFX library and it is intended to be used with libraries based on Adafruit_GFX. But it might also be possible to wrap any other library.
ID | Function | Matrix Type | |
---|---|---|---|
Base | Extended | ||
0x01 | matrix_gfx::getColorCount() | X | X |
0x02 | matrix_gfx::getWidth() | X | X |
0x03 | matrix_gfx::getHeight() | X | X |
0x10 | matrix_gfx::drawPixel() | X | X |
0x20 | matrix_gfx::drawLine() | X | X |
0x21 | matrix_gfx::drawFastVLine() | X | |
0x22 | matrix_gfx::drawFastHLine() | X | |
0x23 | matrix_gfx::drawRect() | X | |
0x24 | matrix_gfx::fillRect() | X | |
0x25 | matrix_gfx::fillScreen() | X | X |
0x26 | matrix_gfx::invertDisplay() | X | |
0x30 | matrix_gfx::drawCircle() | X | |
0x31 | matrix_gfx::fillCircle() | X | |
0x32 | matrix_gfx::drawTriangle() | X | |
0x33 | matrix_gfx::fillTriangle() | X | |
0x34 | matrix_gfx::drawRoundRect() | X | |
0x35 | matrix_gfx::fillRoundRect() | X | |
0x40 | matrix_gfx::drawChar() | X | |
0x41 | matrix_gfx::setCursor() | X | |
0x42 | matrix_gfx::setTextColor() | X | |
0x43 | matrix_gfx::setTextColor() | X | |
0x44 | matrix_gfx::setTextSize() | X | |
0x45 | matrix_gfx::setTextWrap() | X | |
0x46 | matrix_gfx::write() | X | |
0x50 | matrix_gfx::setRotation() | X | |
0x51 | matrix_gfx::drawBitmap() | X |
Get the number of colors. Return value should be 1, 2 or 3.
Returns: | Number of colors. |
---|
Get width in pixels.
Returns: | Number of pixels |
---|
Get height in pixels.
Returns: | Number of pixels |
---|
Draw a pixel.
Parameters: |
|
---|
Draw a line.
Draw a vertical line.
Draw a horizontal line.
Draw the boarder of rectangle.
Draw a filled rectangle.
Fill the screen with the given color.
Invert the display.
Draw the border of a circle.
Draw a filled circle.
Draw the boarder of a triangle.
Draw a filled triangle.
Draw the boarder of a round rectangle.
Draw a filled round rectangle.
Draw a character.
Set the cursor position.
Set the text color.
Set the text color.
Set the text size.
Set the text wrap.
Set the rotation.
Draw a Bitmap.
This handler extends Base/Extended Matrix.
ID | Function |
---|---|
0xA0 | swapBuffers() |
0xA1 | setAutoSwapBuffers() |
Parameters copy: | |
---|---|
0 = False | 1 = True |
Swap buffers and copy new front buffer into the back buffer.
Parameters auto_swap: | |
---|---|
0 = False | 1 = True |
Set option to swap buffers after each command.
This range of IDs is reserved for custom handlers e.g. for testing or prototyping purposes.