PETRONE_V2 / Protocol / Structs / Light
Modified : 2018.3.6
LED 제어와 관련된 정의 및 구조체들을 소개합니다.
- Definitions
- Structs
- Light::Color
- Protocol::Light::Manual
- Protocol::Light::Mode
- Protocol::Light::ModeColor
- Protocol::Light::ModeColorCommand
- Protocol::Light::ModeColorCommandIr
- Protocol::Light::ModeColors
- Protocol::Light::ModeColorsCommand
- Protocol::Light::ModeColorsCommandIr
- Protocol::Light::Event
- Protocol::Light::EventColor
- Protocol::Light::EventColorCommand
- Protocol::Light::EventColorCommandIr
- Protocol::Light::EventColors
- Protocol::Light::EventColorsCommand
- Protocol::Light::EventColorsCommandIr
Definitions
Light::Drone::Mode::Type
드론 LED 동작 모드
namespace Light
{
namespace Drone
{
namespace Mode
{
enum Type
{
None,
EyeNone = 0x10,
EyeManual, // 수동 제어
EyeHold, // 지정한 색상을 계속 켬
EyeFlicker, // 깜빡임
EyeFlickerDouble, // 깜빡임(두 번 깜빡이고 깜빡인 시간만큼 꺼짐)
EyeDimming, // 밝기 제어하여 천천히 깜빡임
ArmNone = 0x40,
ArmManual, // 수동 제어
ArmHold, // 지정한 색상을 계속 켬
ArmFlicker, // 깜빡임
ArmFlickerDouble, // 깜빡임(두 번 깜빡이고 깜빡인 시간만큼 꺼짐)
ArmDimming, // 밝기 제어하여 천천히 깜빡임
EndOfType
};
}
}
}
Light::Drone::Flags::Type
드론 LED Flag
namespace Light
{
namespace Drone
{
namespace Flags
{
enum Type
{
None = 0x00,
EyeRed = 0x80,
EyeGreen = 0x40,
EyeBlue = 0x20,
ArmRed = 0x10,
ArmGreen = 0x08,
ArmBlue = 0x04
};
}
}
}
Light::Controller::Mode::Type
조종기 LED 동작 모드
namespace Light
{
namespace Controller
{
namespace Mode
{
enum Type
{
None,
// Team
TeamNone = 0x10,
TeamManual, // 수동 조작
TeamHold,
TeamFlicker,
TeamFlickerDouble,
TeamDimming,
EndOfType
};
}
}
}
Light::Controller::Flags::Type
드론 LED Flag
namespace Light
{
namespace Controller
{
namespace Flags
{
enum Type
{
None = 0x00,
Red = 0x80,
Green = 0x40,
Blue = 0x20
};
}
}
}
Light::Colors::Type
LED 팔레트 인덱스
드론과 조종기 내부에 정의된 팔레트의 색상 인덱스입니다. 의도보다 색상이 더 밝게 표현되기 때문에 테스트 후 사용하기를 권해드립니다.
namespace Light
{
namespace Colors
{
enum Type
{
AliceBlue, // 0x00
AntiqueWhite, // 0x01
Aqua, // 0x02
Aquamarine, // 0x03
Azure, // 0x04
Beige, // 0x05
Bisque, // 0x06
Black, // 0x07
BlanchedAlmond, // 0x08
Blue, // 0x09
BlueViolet, // 0x0A
Brown, // 0x0B
BurlyWood, // 0x0C
CadetBlue, // 0x0D
Chartreuse, // 0x0E
Chocolate, // 0x0F
Coral, // 0x10
CornflowerBlue, // 0x11
Cornsilk, // 0x12
Crimson, // 0x13
Cyan, // 0x14
DarkBlue, // 0x15
DarkCyan, // 0x16
DarkGoldenRod, // 0x17
DarkGray, // 0x18
DarkGreen, // 0x19
DarkKhaki, // 0x1A
DarkMagenta, // 0x1B
DarkOliveGreen, // 0x1C
DarkOrange, // 0x1D
DarkOrchid, // 0x1E
DarkRed, // 0x1F
DarkSalmon, // 0x20
DarkSeaGreen, // 0x21
DarkSlateBlue, // 0x22
DarkSlateGray, // 0x23
DarkTurquoise, // 0x24
DarkViolet, // 0x25
DeepPink, // 0x26
DeepSkyBlue, // 0x27
DimGray, // 0x28
DodgerBlue, // 0x29
FireBrick, // 0x2A
FloralWhite, // 0x2B
ForestGreen, // 0x2C
Fuchsia, // 0x2D
Gainsboro, // 0x2E
GhostWhite, // 0x2F
Gold, // 0x30
GoldenRod, // 0x31
Gray, // 0x32
Green, // 0x33
GreenYellow, // 0x34
HoneyDew, // 0x35
HotPink, // 0x36
IndianRed, // 0x37
Indigo, // 0x38
Ivory, // 0x39
Khaki, // 0x3A
Lavender, // 0x3B
LavenderBlush, // 0x3C
LawnGreen, // 0x3D
LemonChiffon, // 0x3E
LightBlue, // 0x3F
LightCoral, // 0x40
LightCyan, // 0x41
LightGoldenRodYellow, // 0x42
LightGray, // 0x43
LightGreen, // 0x44
LightPink, // 0x45
LightSalmon, // 0x46
LightSeaGreen, // 0x47
LightSkyBlue, // 0x48
LightSlateGray, // 0x49
LightSteelBlue, // 0x4A
LightYellow, // 0x4B
Lime, // 0x4C
LimeGreen, // 0x4D
Linen, // 0x4E
Magenta, // 0x4F
Maroon, // 0x50
MediumAquaMarine, // 0x51
MediumBlue, // 0x52
MediumOrchid, // 0x53
MediumPurple, // 0x54
MediumSeaGreen, // 0x55
MediumSlateBlue, // 0x56
MediumSpringGreen, // 0x57
MediumTurquoise, // 0x58
MediumVioletRed, // 0x59
MidnightBlue, // 0x5A
MintCream, // 0x5B
MistyRose, // 0x5C
Moccasin, // 0x5D
NavajoWhite, // 0x5E
Navy, // 0x5F
OldLace, // 0x60
Olive, // 0x61
OliveDrab, // 0x62
Orange, // 0x63
OrangeRed, // 0x64
Orchid, // 0x65
PaleGoldenRod, // 0x66
PaleGreen, // 0x67
PaleTurquoise, // 0x68
PaleVioletRed, // 0x69
PapayaWhip, // 0x6A
PeachPuff, // 0x6B
Peru, // 0x6C
Pink, // 0x6D
Plum, // 0x6E
PowderBlue, // 0x6F
Purple, // 0x70
RebeccaPurple, // 0x71
Red, // 0x72
RosyBrown, // 0x73
RoyalBlue, // 0x74
SaddleBrown, // 0x75
Salmon, // 0x76
SandyBrown, // 0x77
SeaGreen, // 0x78
SeaShell, // 0x79
Sienna, // 0x7A
Silver, // 0x7B
SkyBlue, // 0x7C
SlateBlue, // 0x7D
SlateGray, // 0x7E
Snow, // 0x7F
SpringGreen, // 0x80
SteelBlue, // 0x81
Tan, // 0x82
Teal, // 0x83
Thistle, // 0x84
Tomato, // 0x85
Turquoise, // 0x86
Violet, // 0x87
Wheat, // 0x88
White, // 0x89
WhiteSmoke, // 0x8A
Yellow, // 0x8B
YellowGreen, // 0x8C
EndOfType
};
}
}
Structs
Light::Color
RGB LED 색상 설정
0일 때 꺼지고 255일 때 가장 밝습니다.
namespace Light
{
struct Color
{
u8 r; // Red
u8 g; // Green
u8 b; // Blue
};
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
r | uint8_t | 0 ~ 255 | 1 Byte | Red |
g | uint8_t | 0 ~ 255 | 1 Byte | Green |
b | uint8_t | 0 ~ 255 | 1 Byte | Blue |
Protocol::Light::Manual
LED 수동 제어
flag로 지정한 LED의 밝기를 변경합니다. 지정하지 않은 LED의 밝기는 그대로 유지됩니다. 밝기 값은 0일 때 꺼지며 값이 커질수록 밝아집니다.
namespace Protocol
{
namespace Light
{
struct Manual
{
u8 flags; // Flags 열거형을 조합한 값
u8 brightness; // 밝기
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
flags | Light::Drone::Flags | 0b00000000 ~ 0b11111111 | 1 Byte | 드론 LED 선택 플래그 조합 |
Light::Controller::Flags | 0b00000000 ~ 0b11111111 | 조종기 LED 선택 플래그 조합 | ||
brightness | uint8_t | 0 ~ 255 | 1 Byte | 밝기 |
Protocol::Light::Mode
LED 모드 변경
namespace Protocol
{
namespace Light
{
struct Mode
{
u8 mode; // LED 모드
u16 interval; // LED 모드의 갱신 주기
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Light::Drone::Mode::Type | - | 1 Byte | 드론 LED 동작 모드 |
Light::Controller::Mode::Type | - | 조종기 LED 동작 모드 | ||
interval | uint16_t | 0 ~ 65535 | 2 Byte | 내부 밝기 제어 함수 호출 주기 |
Protocol::Light::ModeColor
LED 모드 변경(RGB)
RGB 색상을 직접 지정하여 LED 동작 모드를 변경합니다.
namespace Protocol
{
namespace Light
{
struct ModeColor
{
Protocol::Light::Mode mode;
Light::Color color;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
Protocol::Light::ModeColorCommand
LED 모드 변경(RGB) + Command
namespace Protocol
{
namespace Light
{
struct ModeColorCommand
{
Protocol::Light::Mode mode;
Light::Color color;
Protocol::Command command;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
command | Protocol::Command | - | 2 Byte | 명령 |
Protocol::Light::ModeColorCommandIr
LED 모드 변경(RGB) + Command + IR
namespace Protocol
{
namespace Light
{
struct ModeColorCommandIr
{
Protocol::Light::Mode mode;
Light::Color color;
Protocol::Command command;
u32 irData;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
command | Protocol::Command | - | 2 Byte | 명령 |
irData | uint32_t | 0x00000000 ~ 0xFFFFFFFF | 4 Byte | 적외선 전송 데이터 |
Protocol::Light::ModeColors
LED 모드 변경(Palette)
namespace Protocol
{
namespace Light
{
struct ModeColors
{
Protocol::Light::Mode mode;
u8 colors;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
Protocol::Light::ModeColorsCommand
LED 모드 변경(Palette) + Command
namespace Protocol
{
namespace Light
{
struct ModeColorsCommand
{
Protocol::Light::Mode mode;
u8 colors;
Protocol::Command command;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
command | Protocol::Command | - | 2 Byte | 명령 |
Protocol::Light::ModeColorsCommandIr
LED 모드 변경(Palette) + Command + IR
namespace Protocol
{
namespace Light
{
struct ModeColorsCommandIr
{
Protocol::Light::Mode mode;
u8 colors;
Protocol::Command command;
u32 irData;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
mode | Protocol::Light::Mode | - | 3 Byte | LED 동작 모드 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
command | Protocol::Command | - | 2 Byte | 명령 |
irData | uint32_t | 0x00000000 ~ 0xFFFFFFFF | 4 Byte | 적외선 전송 데이터 |
Protocol::Light::Event
LED 이벤트
namespace Protocol
{
namespace Light
{
struct Event
{
u8 event; // LED 이벤트
u16 interval; // LED 이벤트 갱신 주기
u8 repeat; // LED 이벤트 반복 횟수
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Light::Drone::Mode::Type | - | 1 Byte | 드론 LED 동작 모드 |
Light::Controller::Mode::Type | - | 조종기 LED 동작 모드 | ||
interval | UInt16 | 0 ~ 65535 | 2 Byte | 내부 색상 변화 함수 호출 주기 |
repeat | UInt8 | 0 ~ 255 | 1 Byte | 반복 횟수 |
Protocol::Light::EventColor
LED 이벤트(RGB)
namespace Protocol
{
namespace Light
{
struct EventColor
{
Protocol::Light::Event event;
Light::Color color;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
Protocol::Light::EventColorCommand
LED 이벤트(RGB) + Command
namespace Protocol
{
namespace Light
{
struct EventColorCommand
{
Protocol::Light::Event event;
Light::Color color;
Protocol::Command command;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
command | Protocol::Command | - | 2 Byte | 명령 |
Protocol::Light::EventColorCommandIr
LED 이벤트(RGB) + Command + IR
namespace Protocol
{
namespace Light
{
struct EventColorCommandIr
{
Protocol::Light::Event event;
Light::Color color;
Protocol::Command command;
u32 irData;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
color | Light::Color | - | 3 Byte | LED RGB 색상 |
command | Protocol::Command | - | 2 Byte | 명령 |
irData | uint32_t | 0x00000000 ~ 0xFFFFFFFF | 4 Byte | 적외선 전송 데이터 |
Protocol::Light::EventColors
LED 이벤트(Palette)
namespace Protocol
{
namespace Light
{
struct EventColors
{
Protocol::Light::Event event;
u8 colors;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
Protocol::Light::EventColorsCommand
LED 이벤트(Palette) + Command
namespace Protocol
{
namespace Light
{
struct EventColorsCommand
{
Protocol::Light::Event event;
u8 colors;
Protocol::Command command;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
command | Protocol::Command | - | 2 Byte | 명령 |
Protocol::Light::EventColorsCommandIr
LED 이벤트(Palette) + Command + IR
namespace Protocol
{
namespace Light
{
struct EventColorsCommandIr
{
Protocol::Light::Event event;
u8 colors;
Protocol::Command command;
u32 irData;
};
}
}
변수 이름 | 형식 | 범위 | 크기 | 설명 |
---|---|---|---|---|
event | Protocol::Light::Event | - | 4 Byte | LED 이벤트 |
colors | Light::Colors::Type | - | 1 Byte | LED 팔레트 인덱스 |
command | Protocol::Command | - | 2 Byte | 명령 |
irData | uint32_t | 0x00000000 ~ 0xFFFFFFFF | 4 Byte | 적외선 전송 데이터 |
PETRONE V2
- Intro
- Typedef
- DataType
- Definitions
- Structs
- Structs - Light
- Structs - Display