Sming Framework API
()
Toggle main menu visibility
Sming
Libraries
Graphics
src
include
Graphics
Drawing
Header.h
Go to the documentation of this file.
1
/****
2
* Header.h
3
*
4
* Copyright 2021 mikee47 <mike@sillyhouse.net>
5
*
6
* This file is part of the Sming-Graphics Library
7
*
8
* This library is free software: you can redistribute it and/or modify it under the terms of the
9
* GNU General Public License as published by the Free Software Foundation, version 3 or later.
10
*
11
* This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY;
12
* without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
13
* See the GNU General Public License for more details.
14
*
15
* You should have received a copy of the GNU General Public License along with this library.
16
* If not, see <https://www.gnu.org/licenses/>.
17
*
18
* @author: May 2021 - mikee47 <mike@sillyhouse.net>
19
*
20
****/
21
22
#pragma once
23
24
#include "
Command.h
"
25
#include "
Registers.h
"
26
27
namespace
Graphics
28
{
29
namespace
Drawing
30
{
34
#pragma pack(1)
35
union
Header
{
36
enum class
Type
: uint8_t {
37
uint8
,
38
uint16
,
39
uint32
,
40
resource
,
41
};
42
enum class
DataType
: uint8_t {
43
charArray
,
44
};
45
enum class
ResourceKind
: uint8_t {
46
text
,
47
image
,
48
};
49
// type = uint8, uint16, uint32
50
struct
{
51
uint8_t
index
: 4;
52
Type
type
: 2;
53
OpCode
opcode
: 2;
54
uint32_t
param
;
55
};
57
enum class
LengthSize
: uint8_t {
58
uint8
,
59
uint16
,
60
};
61
// type = resource
62
struct
{
63
ResourceKind
kind
: 1;
64
LengthSize
lengthSize
: 1;
65
DataType
dataType
: 2;
66
Type
type
: 2;
67
OpCode
opcode
: 2;
68
}
resource
;
69
Command
cmd
: 6;
70
};
71
#pragma pack()
72
73
static_assert(
sizeof
(
Header
) == 5,
"Header wrong size"
);
74
75
}
// namespace Drawing
76
}
// namespace Graphics
Command.h
Registers.h
Graphics::Drawing::Command
Command
Definition:
Graphics/src/include/Graphics/Drawing/Command.h:84
Graphics::Drawing::OpCode
OpCode
Definition:
Registers.h:51
Graphics
Definition:
Virtual.h:31
Graphics::Drawing::Header
Command header structure.
Definition:
Header.h:35
Graphics::Drawing::Header::index
uint8_t index
Register index.
Definition:
Header.h:51
Graphics::Drawing::Header::kind
ResourceKind kind
Definition:
Header.h:63
Graphics::Drawing::Header::dataType
DataType dataType
Definition:
Header.h:65
Graphics::Drawing::Header::Type
Type
Definition:
Header.h:36
Graphics::Drawing::Header::Type::uint32
@ uint32
Graphics::Drawing::Header::Type::uint8
@ uint8
Graphics::Drawing::Header::Type::resource
@ resource
Graphics::Drawing::Header::Type::uint16
@ uint16
Graphics::Drawing::Header::ResourceKind
ResourceKind
Definition:
Header.h:45
Graphics::Drawing::Header::ResourceKind::text
@ text
Graphics::Drawing::Header::ResourceKind::image
@ image
Graphics::Drawing::Header::cmd
Command cmd
Definition:
Header.h:69
Graphics::Drawing::Header::DataType
DataType
Definition:
Header.h:42
Graphics::Drawing::Header::DataType::charArray
@ charArray
Graphics::Drawing::Header::opcode
OpCode opcode
Operation to perform.
Definition:
Header.h:53
Graphics::Drawing::Header::LengthSize
LengthSize
Definition:
Header.h:57
Graphics::Drawing::Header::LengthSize::uint8
@ uint8
Graphics::Drawing::Header::LengthSize::uint16
@ uint16
Graphics::Drawing::Header::resource
struct Graphics::Drawing::Header::@69 resource
Graphics::Drawing::Header::type
Type type
Definition:
Header.h:52
Graphics::Drawing::Header::lengthSize
LengthSize lengthSize
Definition:
Header.h:64
Graphics::Drawing::Header::param
uint32_t param
Definition:
Header.h:54
Generated by
1.9.1