PETRONE_V2 / Protocol / Structs / Display

Modified : 2018.3.6


Display 제어와 관련된 정의 및 구조체들을 소개합니다.




Definitions



Display::Pixel::Type

픽셀 색상

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



Display::Font::Type

폰트

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



Display::Align::Type

문자열 정렬

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



Display::Line::Type

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



Structs



Protocol::Display::ClearAll

화면 전체 지우기

namespace Protocol
{
    namespace Display
    {
        struct ClearAll
        {
            u8      pixel;    
        };
    }
}
변수 이름 형식 범위 크기 설명
pixel Display::Pixel::Type - 1 Byte 채울 색상



Protocol::Display::Clear

선택 영역 지우기

namespace Protocol
{
    namespace Display
    {
        struct Clear
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
            u8      pixel;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 시작 위치
y int16_t -2000 ~ 2000 2 Byte Y축 시작 위치
width int16_t -2000 ~ 2000 2 Byte 너비
height int16_t -2000 ~ 2000 2 Byte 높이
pixel Display::Pixel::Type - 1 Byte 채울 색상



Protocol::Display::Invert

선택 영역 반전

namespace Protocol
{
    namespace Display
    {
        struct Invert
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 시작 위치
y int16_t -2000 ~ 2000 2 Byte Y축 시작 위치
width int16_t -2000 ~ 2000 2 Byte 너비
height int16_t -2000 ~ 2000 2 Byte 높이



Protocol::Display::DrawPoint

점 찍기

namespace Protocol
{
    namespace Display
    {
        struct DrawPoint
        {
            s16     x;
            s16     y;
            u8      pixel;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 위치
y int16_t -2000 ~ 2000 2 Byte Y축 위치
pixel Display::Pixel::Type - 1 Byte 점 색상



Protocol::Display::DrawLine

선 그리기

namespace Protocol
{
    namespace Display
    {
        struct DrawLine
        {
            s16     x1;
            s16     y1;
            s16     x2;
            s16     y2;
            u8      pixel;
            u8      line;
        };
    }
}
변수 이름 형식 범위 크기 설명
x1 int16_t -2000 ~ 2000 2 Byte X축 시작 위치
y1 int16_t -2000 ~ 2000 2 Byte Y축 시작 위치
x2 int16_t -2000 ~ 2000 2 Byte X축 끝 위치
y2 int16_t -2000 ~ 2000 2 Byte Y축 끝 위치
pixel Display::Pixel::Type - 1 Byte 선 색상
line Display::Line::Type - 1 Byte 선 형태



Protocol::Display::DrawRect

네모 상자 그리기

namespace Protocol
{
    namespace Display
    {
        struct DrawRect
        {
            s16     x;
            s16     y;
            s16     width;
            s16     height;
            u8      pixel;
            u8      flagFill;
            u8      line;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 시작 위치
y int16_t -2000 ~ 2000 2 Byte Y축 시작 위치
width int16_t -2000 ~ 2000 2 Byte 너비
height int16_t -2000 ~ 2000 2 Byte 높이
pixel Display::Pixel::Type - 1 Byte 색상
flagFill uint8_t - 1 Byte 0(채우지 않음), 1(채움)
line Display::Line::Type - 1 Byte 선 형태



Protocol::Display::DrawCircle

원 그리기

namespace Protocol
{
    namespace Display
    {
        struct DrawCircle
        {
            s16     x;
            s16     y;
            s16     radius;
            u8      pixel;
            u8      flagFill;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 중심점 위치
y int16_t -2000 ~ 2000 2 Byte Y축 중심점 위치
radius int16_t 1 ~ 2000 2 Byte 반지름
pixel Display::Pixel::Type - 1 Byte 색상
flagFill uint8_t - 1 Byte 0(채우지 않음), 1(채움)



Protocol::Display::DrawString

문자열 그리기

화면에 표시할 문자열은 DrawString 구조체 뒤에 이어서 ASCII 문자열을 붙여서 전송.

헤더의 length는 (Protocol::Display::DrawString의 길이 + 화면에 표시할 문자열의 길이) 값을 넣어야 합니다.

namespace Protocol
{
    namespace Display
    {
        struct DrawString
        {
            s16     x;
            s16     y;
            u8      font;
            u8      pixel;
        };
    }
}
변수 이름 형식 범위 크기 설명
x int16_t -2000 ~ 2000 2 Byte X축 위치
y int16_t -2000 ~ 2000 2 Byte Y축 위치
font Display::Font::Type - 1 Byte 폰트
pixel Display::Pixel::Type - 1 Byte 색상
message ASCII String - 30 Byte 이하 표시할 문자열



Protocol::Display::DrawStringAlign

문자열 정렬하여 그리기

화면에 문자열 쓰기. 문자열은 xStart와 xEnd 사이에서 align으로 지정한 위치에 놓인다.

화면에 표시할 문자열은 DrawStringAlign 구조체 뒤에 이어서 ASCII 문자열을 붙여서 전송.

헤더의 length는 (Protocol::Display::DrawStringAlign 길이 + 화면에 표시할 문자열의 길이) 값을 넣어야 합니다.

namespace Protocol
{
    namespace Display
    {
        struct DrawStringAlign
        {
            s16     xStart;
            s16     xEnd;
            s16     y;
            u8      align;
            u8      font;
            u8      pixel;
        };
    }
}
변수 이름 형식 범위 크기 설명
xStart int16_t -2000 ~ 2000 2 Byte X축 시작 위치
xEnd int16_t -2000 ~ 2000 2 Byte X축 끝 위치
y int16_t -2000 ~ 2000 2 Byte Y축 위치
align Display::Align::Type - 1 Byte 정렬
font Display::Font::Type - 1 Byte 폰트
pixel Display::Pixel::Type - 1 Byte 색상
message ASCII String - 30 Byte 이하 표시할 문자열




PETRONE V2

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


Index