forked from laamaa/m8c
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathcommand.h
56 lines (44 loc) · 1009 Bytes
/
command.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
// Copyright 2021 Jonne Kokkonen
// Released under the MIT licence, https://opensource.org/licenses/MIT
#ifndef COMMAND_H_
#define COMMAND_H_
#include <stdint.h>
struct position {
uint16_t x;
uint16_t y;
};
struct size {
uint16_t width;
uint16_t height;
};
struct color {
uint8_t r;
uint8_t g;
uint8_t b;
};
struct draw_rectangle_command {
struct position pos;
struct size size;
struct color color;
};
struct draw_character_command {
int c;
struct position pos;
struct color foreground;
struct color background;
};
struct draw_oscilloscope_waveform_command {
struct color color;
uint8_t waveform[320];
uint16_t waveform_size;
};
struct command_queues {
struct draw_rectangle_command rectangles[128];
uint8_t rectangles_queue_size;
struct draw_character_command characters[128];
uint8_t characters_queue_size;
struct draw_oscilloscope_waveform_command waveform;
uint8_t waveforms_queue_size;
};
int process_command(uint8_t *data, uint32_t size);
#endif