Coding Drone Plus / Protocol / Structs / Display

Modified : 2026.1.29


Introduce the display control definitions and structures




Definitions



Display::Pixel::Type

Pixel color

namespace Display
{
    namespace Pixel
    {
        enum Type
        {
            Black,
            White,
            Inverse,
            Outline
        };
    }
}



Display::Font::Type

Font

namespace Display
{
    namespace Font
    {
        enum Type
        {
            LiberationMono5x8,
            LiberationMono10x16,
        };
    }
}



Display::Align::Type

String alignment

namespace Display
{
    namespace Align
    {
        enum Type
        {
            Left,
            Center,
            Right
        };
    }
}



Display::Line::Type

Line

namespace Display
{
    namespace Line
    {
        enum Type
        {
            Solid,
            Dotted,
            Dashed,
        };
    }
}



Structs



Protocol::Display::ClearAll

Clear entire screen

namespace Protocol
{
    namespace Display
    {
        struct ClearAll
        {
            u8      pixel;
        };
    }
}
Name Type Size Range Description
pixel Display::Pixel::Type 1 Byte - Fill color



Protocol::Display::Clear

Clear selected area

namespace Protocol
{
    namespace Display
    {
        struct Clear
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
            u8      pixel;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X start position
y int16_t 2 Byte -2000 ~ 2000 Y start position
width int16_t 2 Byte -2000 ~ 2000 Width
height int16_t 2 Byte -2000 ~ 2000 Height
pixel Display::Pixel::Type 1 Byte - Fill color



Protocol::Display::Invert

Invert selected area

namespace Protocol
{
    namespace Display
    {
        struct Invert
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X start position
y int16_t 2 Byte -2000 ~ 2000 Y start position
width int16_t 2 Byte -2000 ~ 2000 Width
height int16_t 2 Byte -2000 ~ 2000 Height



Protocol::Display::DrawPoint

Draw point

namespace Protocol
{
    namespace Display
    {
        struct DrawPoint
        {
            s16     x;
            s16     y;
            u8      pixel;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X position
y int16_t 2 Byte -2000 ~ 2000 Y position
pixel Display::Pixel::Type 1 Byte - Pixel color



Protocol::Display::DrawLine

Draw line

namespace Protocol
{
    namespace Display
    {
        struct DrawLine
        {
            s16     x1;
            s16     y1;
            s16     x2;
            s16     y2;
            u8      pixel;
            u8      line;
        };
    }
}
Name Type Size Range Description
x1 int16_t 2 Byte -2000 ~ 2000 X start position
y1 int16_t 2 Byte -2000 ~ 2000 Y start position
x2 int16_t 2 Byte -2000 ~ 2000 X end position
y2 int16_t 2 Byte -2000 ~ 2000 Y end position
pixel Display::Pixel::Type 1 Byte - Line color
line Display::Line::Type 1 Byte - Line type



Protocol::Display::DrawRect

Draw rectangle

namespace Protocol
{
    namespace Display
    {
        struct DrawRect
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
            u8      pixel;
            u8      flagFill;
            u8      line;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X start position
y int16_t 2 Byte -2000 ~ 2000 Y start position
width int16_t 2 Byte -2000 ~ 2000 Width
height int16_t 2 Byte -2000 ~ 2000 Height
pixel Display::Pixel::Type 1 Byte - Pixel color
flagFill uint8_t 1 Byte - 0 (no fill), 1 (fill)
line Display::Line::Type 1 Byte - Line type



Protocol::Display::DrawCircle

Draw circle

namespace Protocol
{
    namespace Display
    {
        struct DrawCircle
        {
            s16     x;
            s16     y;
            s16     radius;
            u8      pixel;
            u8      flagFill;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X center position
y int16_t 2 Byte -2000 ~ 2000 Y center position
radius int16_t 2 Byte 1 ~ 2000 Radius
pixel Display::Pixel::Type 1 Byte - Pixel color
flagFill uint8_t 1 Byte - 0 (no fill), 1 (fill)



Protocol::Display::DrawString

Draw string

To display a string, append an ASCII string after the DrawString structure.

The header length must be (size of Protocol::Display::DrawString + length of the ASCII string).

namespace Protocol
{
    namespace Display
    {
        struct DrawString
        {
            s16     x;
            s16     y;
            u8      font;
            u8      pixel;
        };
    }
}
Name Type Size Range Description
x int16_t 2 Byte -2000 ~ 2000 X position
y int16_t 2 Byte -2000 ~ 2000 Y position
font Display::Font::Type 1 Byte - Font
pixel Display::Pixel::Type 1 Byte - Pixel color
message ASCII String Up to 30 Bytes - String to display



Protocol::Display::DrawStringAlign

Draw string with alignment

Write a string on the display. The string is placed between xStart and xEnd based on the align value.

To display a string, append an ASCII string after the DrawStringAlign structure.

The header length must be (size of Protocol::Display::DrawStringAlign + length of the ASCII string).

namespace Protocol
{
    namespace Display
    {
        struct DrawStringAlign
        {
            s16     xStart;
            s16     xEnd;
            s16     y;
            u8      align;
            u8      font;
            u8      pixel;
        };
    }
}
Name Type Size Range Description
xStart int16_t 2 Byte -2000 ~ 2000 X start position
xEnd int16_t 2 Byte -2000 ~ 2000 X end position
y int16_t 2 Byte -2000 ~ 2000 Y position
align Display::Align::Type 1 Byte - Align
font Display::Font::Type 1 Byte - Font
pixel Display::Pixel::Type 1 Byte - Pixel color
message ASCII String Up to 30 Bytes - String to display




Coding Drone Plus

  1. Intro
  2. Typedef
  3. DataType
  4. Definitions
  5. Structs
  6. Structs - Light
  7. Structs - Display


Index