-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathembroidery.h
71 lines (54 loc) · 1.96 KB
/
embroidery.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
/*
embroidery.h - plugin for reading and executing embroidery file from SD card.
Part of grblHAL
Copyright (c) 2023 Terje Io
grblHAL is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
grblHAL is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef _EMBROIDERY_H_
#define _EMBROIDERY_H_
#include "driver.h"
typedef enum {
Stitch_Normal,
Stitch_Trim,
Stitch_Jump,
Stitch_Stop,
Stitch_SequinEject
} stich_type_t;
typedef uint8_t embroidery_thread_color_t;
typedef struct {
stich_type_t type;
embroidery_thread_color_t color;
coord_data_t target;
} stitch_t;
typedef bool (*get_stitch_ptr)(stitch_t *stitch, vfs_file_t *file);
typedef const char *(*get_thread_color_ptr)(uint8_t color);
typedef void (*thread_trim_ptr)(void);
typedef void (*thread_change_ptr)(embroidery_thread_color_t color);
typedef struct {
get_stitch_ptr get_stitch;
get_thread_color_ptr get_thread_color;
thread_trim_ptr thread_trim;
thread_change_ptr thread_change;
const char *name;
uint32_t stitches;
uint32_t threads;
uint32_t trims;
uint32_t color_changes;
coord_data_t min;
coord_data_t max;
coord_data_t size;
} embroidery_t;
typedef bool (*open_file_ptr)(vfs_file_t *file, embroidery_t *api);
const char *embroidery_get_thread_color (embroidery_thread_color_t color);
void embroidery_set_thread_trim_handler (thread_trim_ptr handler);
void embroidery_set_thread_change_handler (thread_change_ptr handler);
#endif // _EMBROIDERY_H_