Prusa MINI Firmware overview
marlin_client.h
Go to the documentation of this file.
1 // marlin_client.h
2 #ifndef _MARLIN_CLIENT_H
3 #define _MARLIN_CLIENT_H
4 
5 #include "marlin_events.h"
6 #include "marlin_vars.h"
7 #include "marlin_errors.h"
8 #include "marlin_host.h"
9 
10 // client flags
11 #define MARLIN_CFLG_STARTED 0x0001 // client started (set in marlin_client_init)
12 #define MARLIN_CFLG_PROCESS 0x0002 // loop processing in main thread is enabled
13 #define MARLIN_CFLG_BUSY 0x0004 // loop is busy
14 #define MARLIN_CFLG_LOWHIGH 0x0008 // receiving low/high part of client message
15 #define MARLIN_CFLG_MESSAGE 0x0010 // receiving status change message
16 
17 #ifdef __cplusplus
18 extern "C" {
19 #endif //__cplusplus
20 
21 //-----------------------------------------------------------------------------
22 //externs from marlin server todo fixme use variables
23 extern int marlin_all_axes_homed(void);
24 
25 extern int marlin_all_axes_known(void);
26 
27 //-----------------------------------------------------------------------------
28 // client side functions (can be called from client thread only)
29 
30 // initialize client side, returns pointer to client structure
31 extern marlin_vars_t *marlin_client_init(void);
32 
33 // shutdown client (notimpl., TODO)
34 extern void marlin_client_shdn(void);
35 
36 // client loop - must be called periodically in client thread
37 extern void marlin_client_loop(void);
38 
39 // returns enabled status of loop processing
40 extern int marlin_processing(void);
41 
42 // returns busy status of marlin
43 extern int marlin_busy(void);
44 
45 // returns currently running command or MARLIN_CMD_NONE
46 extern uint32_t marlin_command(void);
47 
48 // start marlin loop processing in server thread (request '!start')
49 extern void marlin_start_processing(void);
50 
51 // stop marlin loop processing in server thread (request '!stop')
52 extern void marlin_stop_processing(void);
53 
54 // returns motion status of all axes (1: any axis is moving, 0: no motion)
55 extern int marlin_motion(void);
56 
57 // synchronously wait for motion short timeout
58 extern int marlin_wait_motion(uint32_t timeout);
59 
60 // enqueue gcode - thread-safe version (request '!g xxx')
61 extern void marlin_gcode(const char *gcode);
62 
63 // enqueue gcode - printf-like, returns number of chars printed
64 extern int marlin_gcode_printf(const char *format, ...);
65 
66 // inject gcode - thread-safe version (request '!ig xxx')
67 extern void marlin_gcode_push_front(const char *gcode);
68 
69 // returns current event status for evt_id
70 extern int marlin_event(uint8_t evt_id);
71 
72 // returns current event status for evt_id and set event
73 extern int marlin_event_set(uint8_t evt_id);
74 
75 // returns current event status for evt_id and clear event
76 extern int marlin_event_clr(uint8_t evt_id);
77 
78 // returns current event status for all events as 64bit mask
79 extern uint64_t marlin_events(void);
80 
81 // returns current change status for var_id
82 extern int marlin_change(uint8_t var_id);
83 
84 // returns current change status for var_id and set change
85 extern int marlin_change_set(uint8_t var_id);
86 
87 // returns current change status for var_id and clear change
88 extern int marlin_change_clr(uint8_t var_id);
89 
90 // returns current change status for all variables as 64bit mask
91 extern uint64_t marlin_changes(void);
92 
93 // returns current error status for err_id
94 extern int marlin_error(uint8_t err_id);
95 
96 // returns current error status for err_id and set error
97 extern int marlin_error_set(uint8_t err_id);
98 
99 // returns current error status for err_id and clear error
100 extern int marlin_error_clr(uint8_t err_id);
101 
102 // returns current error status for all errors as 64bit mask
103 extern uint64_t marlin_errors(void);
104 
105 // returns variable value from client structure by var_id
106 extern variant8_t marlin_get_var(uint8_t var_id);
107 
108 // request server to set variable, returns previous value or error (notimpl., TODO)
109 extern variant8_t marlin_set_var(uint8_t var_id, variant8_t val);
110 
111 // returns variable structure pointer for calling thread
112 extern marlin_vars_t *marlin_vars(void);
113 
114 // send request to update variables at server side and wait for change notification
115 extern marlin_vars_t *marlin_update_vars(uint64_t msk);
116 
117 // returns number of commands in gcode queue
118 extern uint8_t marlin_get_gqueue(void);
119 
120 // returns maximum number of commands in gcode queue
121 extern uint8_t marlin_get_gqueue_max(void);
122 
123 // returns number of records in planner queue
124 extern uint8_t marlin_get_pqueue(void);
125 
126 // returns maximum number of records in planner queue
127 extern uint8_t marlin_get_pqueue_max(void);
128 
129 // variable setters (internally calls marlin_set_var)
130 extern float marlin_set_target_nozzle(float val);
131 extern float marlin_set_target_bed(float val);
132 extern float marlin_set_z_offset(float val);
134 extern uint16_t marlin_set_print_speed(uint16_t val);
135 extern uint16_t marlin_set_flow_factor(uint16_t val);
138 
139 extern void marlin_do_babysteps_Z(float offs);
140 
141 extern void marlin_settings_save(void);
142 
143 extern void marlin_settings_load(void);
144 
145 extern void marlin_manage_heater(void);
146 
147 extern void marlin_quick_stop(void);
148 
149 extern void marlin_print_abort(void);
150 
151 extern void marlin_print_pause(void);
152 
153 extern void marlin_print_resume(void);
154 
155 extern void marlin_park_head(void);
156 
157 extern uint8_t marlin_message_received(void);
158 
159 // returns current host prompt type
161 
162 // returns number of buttons in current host prompt
163 extern uint8_t marlin_host_button_count(void);
164 
165 // returns button type in current prompt by button index
167 
168 // click host promt button
170 
171 // returns 1 if reheating is in progress, otherwise 0
172 extern int marlin_reheating(void);
173 
174 #ifdef __cplusplus
175 }
176 #endif //__cplusplus
177 
178 #endif //MARLIN_CLIENT_H
SdBaseFile::seekSet
bool seekSet(const uint32_t pos)
Definition: Marlin_CardReader.cpp:505
FAT_FILE_TYPE_NORMAL
const uint8_t FAT_FILE_TYPE_NORMAL
Definition: SdBaseFile.h:81
MARLIN_MAX_CLIENTS
#define MARLIN_MAX_CLIENTS
Definition: config.h:96
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
SdBaseFile::readDir
int8_t readDir(dir_t *dir, char *longFilename)
Definition: Marlin_CardReader.cpp:459
FIL
Definition: ff.h:155
O_APPEND
const uint8_t O_APPEND
Definition: SdBaseFile.h:59
_marlin_client_t::flags
uint16_t flags
Definition: marlin_client.c:41
SdBaseFile::getDosName
bool getDosName(char *const name)
Definition: Marlin_CardReader.cpp:440
marlin_host_button_count
uint8_t marlin_host_button_count(void)
Definition: marlin_client.c:528
marlin_set_fan_speed
uint8_t marlin_set_fan_speed(uint8_t val)
Definition: marlin_client.c:413
marlin_print_resume
void marlin_print_resume(void)
Definition: marlin_client.c:491
marlin_set_target_nozzle
float marlin_set_target_nozzle(float val)
Definition: marlin_client.c:401
FAT_FILE_TYPE_SUBDIR
const uint8_t FAT_FILE_TYPE_SUBDIR
Definition: SdBaseFile.h:84
DIR_ATT_HIDDEN
const uint8_t DIR_ATT_HIDDEN
Definition: SdFatStructs.h:564
marlin_host_button_type
host_prompt_button_t marlin_host_button_type(uint8_t index)
Definition: marlin_client.c:535
FAT_FILE_TYPE_ROOT_FIXED
const uint8_t FAT_FILE_TYPE_ROOT_FIXED
Definition: SdBaseFile.h:82
marlin_wait_motion
int marlin_wait_motion(uint32_t timeout)
Definition: marlin_client.c:187
MARLIN_ERR_MSK
#define MARLIN_ERR_MSK(e_id)
Definition: marlin_errors.h:13
osMessageAvailableSpace
uint32_t osMessageAvailableSpace(osMessageQId queue_id)
Get the available space in a message queue.
Definition: cmsis_os.c:1658
directoryEntry::lastWriteTime
uint16_t lastWriteTime
Definition: SdFatStructs.h:522
variant8_ui8
variant8_t variant8_ui8(uint8_t ui8)
Definition: variant8.c:18
marlin_vars_get_name
const char * marlin_vars_get_name(uint8_t var_id)
Definition: marlin_vars.c:36
marlin_client.h
marlin_change
int marlin_change(uint8_t var_id)
Definition: marlin_client.c:268
marlin_set_wait_heat
uint8_t marlin_set_wait_heat(uint8_t val)
Definition: marlin_client.c:425
_wait_ack_from_server
uint32_t _wait_ack_from_server(uint8_t client_id)
Definition: marlin_client.c:601
marlin_gcode_push_front
void marlin_gcode_push_front(const char *gcode)
Definition: marlin_client.c:222
marlin_event
int marlin_event(uint8_t evt_id)
Definition: marlin_client.c:232
fname_from_8_3
static void fname_from_8_3(char *fn, char *fn83)
Definition: Marlin_CardReader.cpp:418
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
SdBaseFile
Base class for SdFile with Print and C++ streams.
Definition: SdBaseFile.h:166
f_stat
FRESULT f_stat(const TCHAR *path, FILINFO *fno)
Definition: ff.c:4412
osThreadId
TaskHandle_t osThreadId
Definition: cmsis_os.h:283
DBG_VAR
#define DBG_VAR(...)
Definition: marlin_client.c:23
SdVolume
Access FAT16 and FAT32 volumes on SD and SDHC cards.
Definition: SdVolume.h:71
marlin_park_head
void marlin_park_head(void)
Definition: marlin_client.c:499
osSemaphoreWait
int32_t osSemaphoreWait(osSemaphoreId semaphore_id, uint32_t millisec)
Wait until a Semaphore token becomes available.
Definition: cmsis_os.c:822
queue
GCodeQueue queue
Definition: queue.cpp:28
FA_WRITE
#define FA_WRITE
Definition: ff.h:327
marlin_vars_get_var
variant8_t marlin_vars_get_var(marlin_vars_t *vars, uint8_t var_id)
Definition: marlin_vars.c:50
marlin_set_target_bed
float marlin_set_target_bed(float val)
Definition: marlin_client.c:405
marlin_busy
int marlin_busy(void)
Definition: marlin_client.c:152
marlin_event
int marlin_event(uint8_t evt_id)
Definition: marlin_client.c:232
g29_auto.gcode
list gcode
Definition: g29_auto.py:44
_variant8_t::ui16
uint16_t ui16
Definition: variant8.h:34
FILINFO::fattrib
BYTE fattrib
Definition: ff.h:201
MARLIN_VAR_FLOWFACT
#define MARLIN_VAR_FLOWFACT
Definition: marlin_vars.h:26
marlin_print_pause
void marlin_print_pause(void)
Definition: marlin_client.c:483
marlin_message_received
uint8_t marlin_message_received(void)
Definition: marlin_client.c:507
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
Slot::type
Type type
Definition: Marlin_CardReader.cpp:38
MARLIN_VAR_MOTION
#define MARLIN_VAR_MOTION
Definition: marlin_vars.h:8
marlin_processing
int marlin_processing(void)
Definition: marlin_client.c:145
newDir2
static SdFile newDir2
Definition: Marlin_CardReader.cpp:27
marlin_print_resume
void marlin_print_resume(void)
Definition: marlin_client.c:491
pd
#define pd
Definition: screen_filebrowser.cpp:39
f_open
FRESULT f_open(FIL *fp, const TCHAR *path, BYTE mode)
Definition: ff.c:3296
_marlin_host_prompt_t::button
host_prompt_button_t button[HOST_PROMPT_MAX_BUTTONS]
Definition: marlin_host.h:49
marlin_quick_stop
void marlin_quick_stop(void)
Definition: marlin_client.c:467
host_prompt_type_t
host_prompt_type_t
Definition: marlin_host.h:17
marlin_server_task
osThreadId marlin_server_task
Definition: marlin_server.cpp:88
_variant8_t::ui8
uint8_t ui8
Definition: variant8.h:36
MARLIN_VAR_FANSPEED
#define MARLIN_VAR_FANSPEED
Definition: marlin_vars.h:24
marlin_client_shdn
void marlin_client_shdn(void)
Definition: marlin_client.c:114
marlin_events
uint64_t marlin_events(void)
Definition: marlin_client.c:263
Slot::file
FIL file
Definition: Marlin_CardReader.cpp:41
marlin_set_z_offset
float marlin_set_z_offset(float val)
Definition: marlin_client.c:409
bsod.h
marlin_processing
int marlin_processing(void)
Definition: marlin_client.c:145
LONG_FILENAME_LENGTH
#define LONG_FILENAME_LENGTH
Definition: cardreader.h:299
SdBaseFile::close
bool close()
Definition: Marlin_CardReader.cpp:535
FILINFO::fdate
WORD fdate
Definition: ff.h:199
marlin_errors
uint64_t marlin_errors(void)
Definition: marlin_client.c:335
marlin_do_babysteps_Z
void marlin_do_babysteps_Z(float offs)
Definition: marlin_client.c:433
marlin_get_var
variant8_t marlin_get_var(uint8_t var_id)
Definition: marlin_client.c:340
_marlin_mesh_t
Definition: marlin_events.h:102
marlin_set_wait_heat
uint8_t marlin_set_wait_heat(uint8_t val)
Definition: marlin_client.c:425
marlin_gcode_push_front
void marlin_gcode_push_front(const char *gcode)
Definition: marlin_client.c:222
marlin_error
int marlin_error(uint8_t err_id)
Definition: marlin_client.c:304
marlin_vars_value_to_str
void marlin_vars_value_to_str(marlin_vars_t *vars, uint8_t var_id, char *str)
Definition: marlin_vars.c:183
DIR_NAME_DELETED
const uint8_t DIR_NAME_DELETED
Definition: SdFatStructs.h:561
VARIANT8_USER
#define VARIANT8_USER
Definition: variant8.h:16
i
uint8_t i
Definition: screen_test_graph.c:72
_variant8_t::type
uint8_t type
Definition: variant8.h:25
f_rewinddir
#define f_rewinddir(dp)
Definition: ff.h:282
marlin_event_set
int marlin_event_set(uint8_t evt_id)
Definition: marlin_client.c:241
MARLIN_VAR_TTEM_BED
#define MARLIN_VAR_TTEM_BED
Definition: marlin_vars.h:22
marlin_stop_processing
void marlin_stop_processing(void)
Definition: marlin_client.c:166
marlin_client_shdn
void marlin_client_shdn(void)
Definition: marlin_client.c:114
media_is_inserted
bool media_is_inserted()
Definition: Marlin_CardReader.cpp:17
f_getdirpath
FRESULT f_getdirpath(DIR *pd, TCHAR *buff, UINT len)
_marlin_client_t::reheating
uint8_t reheating
Definition: marlin_client.c:51
Slot::directory
DIR directory
Definition: Marlin_CardReader.cpp:42
_marlin_host_prompt_t::type
host_prompt_type_t type
Definition: marlin_host.h:47
marlin_do_babysteps_Z
void marlin_do_babysteps_Z(float offs)
Definition: marlin_client.c:433
DBG_EVT
#define DBG_EVT
Definition: marlin_client.c:18
marlin_client_loop
void marlin_client_loop(void)
Definition: marlin_client.c:118
FSIZE_t
DWORD FSIZE_t
Definition: ff.h:78
marlin_events_get_name
const char * marlin_events_get_name(uint8_t evt_id)
Definition: marlin_events.c:40
marlin_message_received
uint8_t marlin_message_received(void)
Definition: marlin_client.c:507
marlin_change_set
int marlin_change_set(uint8_t var_id)
Definition: marlin_client.c:277
FILENAME_LENGTH
#define FILENAME_LENGTH
Definition: SdFatConfig.h:103
_marlin_client_t::command
uint32_t command
Definition: marlin_client.c:49
_slot_of
#define _slot_of(x)
Definition: Marlin_CardReader.cpp:83
O_WRITE
const uint8_t O_WRITE
Definition: SdBaseFile.h:55
SdBaseFile::isOpen
bool isOpen() const
Definition: SdBaseFile.h:277
SERIAL_ECHO_START
#define SERIAL_ECHO_START()
Definition: serial.h:179
SERIAL_ECHOLN
#define SERIAL_ECHOLN(x)
Definition: serial.h:72
_marlin_host_prompt_t
Definition: marlin_host.h:46
dbg.h
_marlin_mesh_t::xc
uint8_t xc
Definition: marlin_events.h:104
MAX_DIR_DEPTH
#define MAX_DIR_DEPTH
Definition: window_file_list.h:35
_media_inserted
static bool _media_inserted
Definition: Marlin_CardReader.cpp:15
marlin_client_loop
void marlin_client_loop(void)
Definition: marlin_client.c:118
marlin_set_var
variant8_t marlin_set_var(uint8_t var_id, variant8_t val)
Definition: marlin_client.c:345
osThreadGetId
osThreadId osThreadGetId(void)
Return the thread ID of the current running thread.
Definition: cmsis_os.c:283
_variant8_t::usr16
uint16_t usr16
Definition: variant8.h:27
marlin_host_button_click
void marlin_host_button_click(host_prompt_button_t button)
Definition: marlin_client.c:542
NULL
#define NULL
Definition: usbd_def.h:53
marlin_client
marlin_client_t marlin_client[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:62
marlin_error_set
int marlin_error_set(uint8_t err_id)
Definition: marlin_client.c:313
osMessageQId
QueueHandle_t osMessageQId
Definition: cmsis_os.h:303
marlin_error_clr
int marlin_error_clr(uint8_t err_id)
Definition: marlin_client.c:324
MARLIN_USR8_VAR_FLG
#define MARLIN_USR8_VAR_FLG
Definition: marlin_vars.h:59
emergency_parser
EmergencyParser emergency_parser
MARLIN_CFLG_LOWHIGH
#define MARLIN_CFLG_LOWHIGH
Definition: marlin_client.h:14
osMessageGet
osEvent osMessageGet(osMessageQId queue_id, uint32_t millisec)
Get a Message or Wait for a Message from a Queue.
Definition: cmsis_os.c:1145
osDelay
osStatus osDelay(uint32_t millisec)
Wait for Timeout (Time Delay)
Definition: cmsis_os.c:365
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
marlin_start_processing
void marlin_start_processing(void)
Definition: marlin_client.c:174
HOST_PROMPT_None
Definition: marlin_host.h:18
marlin_server_queue
osMessageQId marlin_server_queue
Definition: marlin_server.cpp:89
marlin_host.h
SdBaseFile::read
int16_t read()
Definition: Marlin_CardReader.cpp:523
marlin_events.h
HAL_GetTick
uint32_t HAL_GetTick(void)
Provides a tick value in millisecond.
Definition: stm32f4xx_hal.c:339
variant8_ui16
variant8_t variant8_ui16(uint16_t ui16)
Definition: variant8.c:30
osSemaphoreId
SemaphoreHandle_t osSemaphoreId
Definition: cmsis_os.h:295
MARLIN_VAR_WAITUSER
#define MARLIN_VAR_WAITUSER
Definition: marlin_vars.h:28
ZERO
#define ZERO(a)
Definition: macros.h:201
MARLIN_EVT_Reheat
#define MARLIN_EVT_Reheat
Definition: marlin_events.h:37
marlin_get_gqueue
uint8_t marlin_get_gqueue(void)
Definition: marlin_client.c:381
marlin_manage_heater
void marlin_manage_heater(void)
Definition: marlin_client.c:459
Slot
Definition: Marlin_CardReader.cpp:31
marlin_client_init
marlin_vars_t * marlin_client_init(void)
Definition: marlin_client.c:84
MARLIN_USR8_MSK_ID
#define MARLIN_USR8_MSK_ID
Definition: marlin_vars.h:60
osEvent
Definition: cmsis_os.h:395
_variant8_t
Definition: variant8.h:24
SERIAL_ECHO_MSG
#define SERIAL_ECHO_MSG(S)
Definition: serial.h:183
PSTR
#define PSTR(str)
Definition: pgmspace.h:31
marlin_events
uint64_t marlin_events(void)
Definition: marlin_client.c:263
DBG_REQ
#define DBG_REQ(...)
Definition: marlin_client.c:16
marlin_host_prompt_decode
void marlin_host_prompt_decode(uint32_t ui32, marlin_host_prompt_t *prompt)
Definition: marlin_host.c:56
marlin_motion
int marlin_motion(void)
Definition: marlin_client.c:182
HOST_PROMPT_BTN_None
Definition: marlin_host.h:26
marlin_set_flow_factor
uint16_t marlin_set_flow_factor(uint16_t val)
Definition: marlin_client.c:421
marlin_get_gqueue
uint8_t marlin_get_gqueue(void)
Definition: marlin_client.c:381
_variant8_t::flt
float flt
Definition: variant8.h:31
newDir1
static SdFile newDir1
Definition: Marlin_CardReader.cpp:27
marlin_set_var
variant8_t marlin_set_var(uint8_t var_id, variant8_t val)
Definition: marlin_client.c:345
marlin_client_init
marlin_vars_t * marlin_client_init(void)
Definition: marlin_client.c:84
marlin_host_button_type
host_prompt_button_t marlin_host_button_type(uint8_t index)
Definition: marlin_client.c:535
marlin_wait_motion
int marlin_wait_motion(uint32_t timeout)
Definition: marlin_client.c:187
FA_READ
#define FA_READ
Definition: ff.h:326
MARLIN_EVT_CommandEnd
#define MARLIN_EVT_CommandEnd
Definition: marlin_events.h:34
_marlin_host_prompt_t::button_count
uint8_t button_count
Definition: marlin_host.h:48
marlin_get_pqueue
uint8_t marlin_get_pqueue(void)
Definition: marlin_client.c:391
marlin_event_set
int marlin_event_set(uint8_t evt_id)
Definition: marlin_client.c:241
marlin_vars
marlin_vars_t * marlin_vars(void)
Definition: marlin_client.c:361
MARLIN_MAX_REQUEST
#define MARLIN_MAX_REQUEST
Definition: config.h:97
_marlin_client_t
Definition: marlin_client.c:39
marlin_set_wait_user
uint8_t marlin_set_wait_user(uint8_t val)
Definition: marlin_client.c:429
marlin_reheating
int marlin_reheating(void)
Definition: marlin_client.c:553
MARLIN_VAR_PQUEUE
#define MARLIN_VAR_PQUEUE
Definition: marlin_vars.h:10
dir_t
struct directoryEntry dir_t
Definition: SdFatStructs.h:557
_process_client_message
void _process_client_message(marlin_client_t *client, variant8_t msg)
Definition: marlin_client.c:612
MARLIN_EVT_StopProcessing
#define MARLIN_EVT_StopProcessing
Definition: marlin_events.h:29
Sd2Card::isInserted
static bool isInserted()
Definition: Marlin_CardReader.cpp:629
marlin_changes
uint64_t marlin_changes(void)
Definition: marlin_client.c:299
MARLIN_EVT_CommandBegin
#define MARLIN_EVT_CommandBegin
Definition: marlin_events.h:33
marlin_client_task
osThreadId marlin_client_task[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:59
MARLIN_VAR_GQUEUE
#define MARLIN_VAR_GQUEUE
Definition: marlin_vars.h:9
osMessagePut
osStatus osMessagePut(osMessageQId queue_id, uint32_t info, uint32_t millisec)
Put a Message to a Queue.
Definition: cmsis_os.c:1113
marlin_change_set
int marlin_change_set(uint8_t var_id)
Definition: marlin_client.c:277
f_size
#define f_size(fp)
Definition: ff.h:280
FILINFO::ftime
WORD ftime
Definition: ff.h:200
directoryEntry::lastWriteDate
uint16_t lastWriteDate
Definition: SdFatStructs.h:523
f_opendir
FRESULT f_opendir(DIR *dp, const TCHAR *path)
Definition: ff.c:4221
marlin_all_axes_known
int marlin_all_axes_known(void)
Definition: marlin_server.cpp:377
osEventMessage
function completed; message event occurred.
Definition: cmsis_os.h:237
MARLIN_EVT_Message
#define MARLIN_EVT_Message
Definition: marlin_events.h:36
marlin_vars
marlin_vars_t * marlin_vars(void)
Definition: marlin_client.c:361
directoryEntry::name
uint8_t name[11]
Definition: SdFatStructs.h:486
Slot::Type
Type
Definition: Marlin_CardReader.cpp:33
marlin_manage_heater
void marlin_manage_heater(void)
Definition: marlin_client.c:459
marlin_busy
int marlin_busy(void)
Definition: marlin_client.c:152
MARLIN_VAR_WAITHEAT
#define MARLIN_VAR_WAITHEAT
Definition: marlin_vars.h:27
EmergencyParser::disable
static FORCE_INLINE void disable()
Definition: emergency_parser.h:75
marlin_vars_set_var
void marlin_vars_set_var(marlin_vars_t *vars, uint8_t var_id, variant8_t var)
Definition: marlin_vars.c:105
ffconf.h
marlin_host_button_click
void marlin_host_button_click(host_prompt_button_t button)
Definition: marlin_client.c:542
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
MSG_SD_OPEN_FILE_FAIL
#define MSG_SD_OPEN_FILE_FAIL
Definition: language.h:229
SdFile
SdBaseFile with Print.
Definition: SdFile.h:45
marlin_error_set
int marlin_error_set(uint8_t err_id)
Definition: marlin_client.c:313
DBG
#define DBG
Definition: Marlin_CardReader.cpp:9
marlin_get_gqueue_max
uint8_t marlin_get_gqueue_max(void)
Definition: marlin_client.c:385
_MAX_LFN
#define _MAX_LFN
Definition: ffconf.h:150
ff.h
MARLIN_CFLG_STARTED
#define MARLIN_CFLG_STARTED
Definition: marlin_client.h:11
_client_ptr
marlin_client_t * _client_ptr(void)
Definition: marlin_client.c:703
_marlin_client_t::events
uint64_t events
Definition: marlin_client.c:42
osWaitForever
#define osWaitForever
wait forever timeout value
Definition: cmsis_os.h:230
MARLIN_CFLG_BUSY
#define MARLIN_CFLG_BUSY
Definition: marlin_client.h:13
marlin_error_clr
int marlin_error_clr(uint8_t err_id)
Definition: marlin_client.c:324
_marlin_client_t::errors
uint64_t errors
Definition: marlin_client.c:47
O_TRUNC
const uint8_t O_TRUNC
Definition: SdBaseFile.h:61
marlin_settings_load
void marlin_settings_load(void)
Definition: marlin_client.c:451
f_lseek
FRESULT f_lseek(FIL *fp, FSIZE_t ofs)
Definition: ff.c:4060
SERIAL_ECHOLNPAIR
#define SERIAL_ECHOLNPAIR(V...)
Definition: serial.h:144
marlin_gcode
void marlin_gcode(const char *gcode)
Definition: marlin_client.c:195
host_prompt_button_t
host_prompt_button_t
Definition: marlin_host.h:25
marlin_quick_stop
void marlin_quick_stop(void)
Definition: marlin_client.c:467
Slot::free
static void free(Slot *slot)
Definition: Marlin_CardReader.cpp:62
marlin_update_vars
marlin_vars_t * marlin_update_vars(uint64_t msk)
Definition: marlin_client.c:368
MARLIN_EVT_MeshUpdate
#define MARLIN_EVT_MeshUpdate
Definition: marlin_events.h:24
directoryEntry::attributes
uint8_t attributes
Definition: SdFatStructs.h:494
media_set_inserted
void media_set_inserted(bool inserted)
Definition: Marlin_CardReader.cpp:21
Slot::free_all
static void free_all()
Definition: Marlin_CardReader.cpp:65
marlin_vars.h
marlin_get_gqueue_max
uint8_t marlin_get_gqueue_max(void)
Definition: marlin_client.c:385
marlin_set_wait_user
uint8_t marlin_set_wait_user(uint8_t val)
Definition: marlin_client.c:429
marlin_reheating
int marlin_reheating(void)
Definition: marlin_client.c:553
marlin_errors
uint64_t marlin_errors(void)
Definition: marlin_client.c:335
variant8_empty
variant8_t variant8_empty(void)
Definition: variant8.c:10
MSG_SD_FILE_SELECTED
#define MSG_SD_FILE_SELECTED
Definition: language.h:232
uint8_t
const uint8_t[]
Definition: 404_html.c:3
marlin_get_var
variant8_t marlin_get_var(uint8_t var_id)
Definition: marlin_client.c:340
FILINFO::fname
TCHAR fname[13]
Definition: ff.h:206
_marlin_mesh_t::z
float z[MARLIN_MAX_MESH_POINTS]
Definition: marlin_events.h:103
marlin_changes
uint64_t marlin_changes(void)
Definition: marlin_client.c:299
MARLIN_VAR_MSK
#define MARLIN_VAR_MSK(v_id)
Definition: marlin_vars.h:35
marlin_stop_processing
void marlin_stop_processing(void)
Definition: marlin_client.c:166
_marlin_client_t::prompt
marlin_host_prompt_t prompt
Definition: marlin_client.c:50
Sd2Card::idle
static void idle()
Definition: Marlin_CardReader.cpp:633
Sd2Card
Raw access to SD and SDHC flash memory cards.
Definition: Sd2Card.h:93
marlin_set_print_speed
uint16_t marlin_set_print_speed(uint16_t val)
Definition: marlin_client.c:417
marlin_all_axes_homed
int marlin_all_axes_homed(void)
Definition: marlin_server.cpp:373
FAT_FILE_TYPE_CLOSED
const uint8_t FAT_FILE_TYPE_CLOSED
Definition: SdBaseFile.h:80
Slot::Slot
Slot()
Definition: Marlin_CardReader.cpp:45
marlin_motion
int marlin_motion(void)
Definition: marlin_client.c:182
MARLIN_VAR_PRNSPEED
#define MARLIN_VAR_PRNSPEED
Definition: marlin_vars.h:25
MARLIN_EVT_HostPrompt
#define MARLIN_EVT_HostPrompt
Definition: marlin_events.h:26
marlin_get_pqueue_max
uint8_t marlin_get_pqueue_max(void)
Definition: marlin_client.c:395
marlin_set_flow_factor
uint16_t marlin_set_flow_factor(uint16_t val)
Definition: marlin_client.c:421
marlin_change_clr
int marlin_change_clr(uint8_t var_id)
Definition: marlin_client.c:288
FRESULT
FRESULT
Definition: ff.h:214
DIR_IS_FILE_OR_SUBDIR
static uint8_t DIR_IS_FILE_OR_SUBDIR(const dir_t *dir)
Definition: SdFatStructs.h:612
marlin_command
uint32_t marlin_command(void)
Definition: marlin_client.c:159
_send_request_to_server
void _send_request_to_server(uint8_t client_id, const char *request)
Definition: marlin_client.c:570
AM_DIR
#define AM_DIR
Definition: ff.h:354
marlin_get_pqueue
uint8_t marlin_get_pqueue(void)
Definition: marlin_client.c:391
marlin_park_head
void marlin_park_head(void)
Definition: marlin_client.c:499
read
static int read(struct _reent *_r, void *pv, char *pc, int n)
Definition: gcode_file.cpp:9
marlin_settings_load
void marlin_settings_load(void)
Definition: marlin_client.c:451
FR_OK
Definition: ff.h:215
_marlin_client_t::ack
uint32_t ack
Definition: marlin_client.c:45
MAXPATHNAMELENGTH
#define MAXPATHNAMELENGTH
Definition: screen_filebrowser.cpp:26
marlin_change_clr
int marlin_change_clr(uint8_t var_id)
Definition: marlin_client.c:288
stm32f4xx_hal.h
This file contains all the functions prototypes for the HAL module driver.
_marlin_client_t::changes
uint64_t changes
Definition: marlin_client.c:43
_marlin_mesh_t::yc
uint8_t yc
Definition: marlin_events.h:105
marlin_server_sema
osSemaphoreId marlin_server_sema
Definition: marlin_server.cpp:90
_marlin_client_t::id
uint8_t id
Definition: marlin_client.c:40
status
static status_t status
Definition: filament_sensor.c:37
app.h
_marlin_client_t::vars
marlin_vars_t vars
Definition: marlin_client.c:44
createFilename
static char * createFilename(char *const buffer, const dir_t &p)
Get a DOS 8.3 filename in its useful form.
Definition: Marlin_CardReader.cpp:92
MARLIN_EVT_Ready
#define MARLIN_EVT_Ready
Definition: marlin_events.h:31
DIR
Definition: ff.h:178
marlin_clients
uint8_t marlin_clients
Definition: marlin_client.c:63
bsod
#define bsod(fmt,...)
Definition: bsod.h:20
marlin_print_abort
void marlin_print_abort(void)
Definition: marlin_client.c:475
Slot::File
Definition: Marlin_CardReader.cpp:34
_marlin_vars_t
Definition: marlin_vars.h:77
MARLIN_EVT_StartProcessing
#define MARLIN_EVT_StartProcessing
Definition: marlin_events.h:28
marlin_start_processing
void marlin_start_processing(void)
Definition: marlin_client.c:174
_wait_server_started
void _wait_server_started(void)
Definition: marlin_client.c:564
BYTE
unsigned char BYTE
Definition: onboard_sd.h:13
directoryEntry::fileSize
uint32_t fileSize
Definition: SdFatStructs.h:525
osMessageCreate
osMessageQId osMessageCreate(const osMessageQDef_t *queue_def, osThreadId thread_id)
Create and Initialize a Message Queue.
Definition: cmsis_os.c:1086
marlin_set_z_offset
float marlin_set_z_offset(float val)
Definition: marlin_client.c:409
marlin_errors.h
osMessageQ
#define osMessageQ(name)
Access a Message Queue Definition.
Definition: cmsis_os.h:829
_variant8_t::usr8
uint8_t usr8
Definition: variant8.h:26
marlin_settings_save
void marlin_settings_save(void)
Definition: marlin_client.c:443
marlin_host_button_count
uint8_t marlin_host_button_count(void)
Definition: marlin_client.c:528
marlin_set_fan_speed
uint8_t marlin_set_fan_speed(uint8_t val)
Definition: marlin_client.c:413
MSG_SD_WRITE_TO_FILE
#define MSG_SD_WRITE_TO_FILE
Definition: language.h:233
MARLIN_CMD_NONE
#define MARLIN_CMD_NONE
Definition: marlin_events.h:50
marlin_set_target_nozzle
float marlin_set_target_nozzle(float val)
Definition: marlin_client.c:401
SdBaseFile::open
bool open(SdBaseFile *dirFile, uint16_t index, uint8_t oflag)
marlin_error
int marlin_error(uint8_t err_id)
Definition: marlin_client.c:304
marlin_print_abort
void marlin_print_abort(void)
Definition: marlin_client.c:475
MARLIN_CFLG_MESSAGE
#define MARLIN_CFLG_MESSAGE
Definition: marlin_client.h:15
MARLIN_EVT_Error
#define MARLIN_EVT_Error
Definition: marlin_events.h:32
marlin_command
uint32_t marlin_command(void)
Definition: marlin_client.c:159
MARLIN_EVT_MSK
#define MARLIN_EVT_MSK(e_id)
Definition: marlin_events.h:42
DBG_EVT_MSK
#define DBG_EVT_MSK
Definition: marlin_client.c:20
MARLIN_VAR_TTEM_NOZ
#define MARLIN_VAR_TTEM_NOZ
Definition: marlin_vars.h:21
osEvent::value
union osEvent::@54 value
event value
directoryEntry
FAT short directory entry.
Definition: SdFatStructs.h:479
marlin_settings_save
void marlin_settings_save(void)
Definition: marlin_client.c:443
f_closedir
FRESULT f_closedir(DIR *dp)
Definition: ff.c:4291
DIR_IS_SUBDIR
static uint8_t DIR_IS_SUBDIR(const dir_t *dir)
Definition: SdFatStructs.h:602
_variant8_t::ui32
uint32_t ui32
Definition: variant8.h:32
MARLIN_EVT_Busy
#define MARLIN_EVT_Busy
Definition: marlin_events.h:30
SdBaseFile::isRoot
bool isRoot() const
Definition: SdBaseFile.h:287
MARLIN_EVT_Acknowledge
#define MARLIN_EVT_Acknowledge
Definition: marlin_events.h:38
serialprintPGM
void serialprintPGM(PGM_P str)
Definition: serial.cpp:35
variant8_flt
variant8_t variant8_flt(float flt)
Definition: variant8.c:48
MARLIN_CFLG_PROCESS
#define MARLIN_CFLG_PROCESS
Definition: marlin_client.h:12
MSG_SD_FILE_OPENED
#define MSG_SD_FILE_OPENED
Definition: language.h:230
SERIAL_ECHOLNPGM
#define SERIAL_ECHOLNPGM(S)
Definition: serial.h:174
mode
png_structrp int mode
Definition: png.h:1139
marlin_set_print_speed
uint16_t marlin_set_print_speed(uint16_t val)
Definition: marlin_client.c:417
MSG_SD_SIZE
#define MSG_SD_SIZE
Definition: language.h:231
O_READ
const uint8_t O_READ
Definition: SdBaseFile.h:53
_marlin_client_t::last_count
uint16_t last_count
Definition: marlin_client.c:46
createSpeedLookupTable.b
list b
Definition: createSpeedLookupTable.py:30
osEvent::v
uint32_t v
message as 32-bit value
Definition: cmsis_os.h:398
marlin_get_pqueue_max
uint8_t marlin_get_pqueue_max(void)
Definition: marlin_client.c:395
marlin_set_target_bed
float marlin_set_target_bed(float val)
Definition: marlin_client.c:405
marlin_host_prompt_type
host_prompt_type_t marlin_host_prompt_type(void)
Definition: marlin_client.c:521
Slot::allocate
static Slot * allocate(Type type)
Definition: Marlin_CardReader.cpp:51
cmsis_os.h
Header of cmsis_os.c A new set of APIs are added in addition to existing ones, these APIs are specifi...
marlin_print_pause
void marlin_print_pause(void)
Definition: marlin_client.c:483
marlin_gcode_printf
int marlin_gcode_printf(const char *format,...)
Definition: marlin_client.c:206
FILINFO
Definition: ff.h:197
UINT
unsigned int UINT
Definition: onboard_sd.h:16
_marlin_client_t::mesh
marlin_mesh_t mesh
Definition: marlin_client.c:48
DIR_NAME_FREE
const uint8_t DIR_NAME_FREE
Definition: SdFatStructs.h:562
f_readdir
FRESULT f_readdir(DIR *dp, FILINFO *fno)
Definition: ff.c:4324
f_read
FRESULT f_read(FIL *fp, void *buff, UINT btr, UINT *br)
Definition: ff.c:3499
f_close
FRESULT f_close(FIL *fp)
Definition: ff.c:3801
SdBaseFile::isDir
bool isDir() const
Definition: SdBaseFile.h:267
marlin_client_queue
osMessageQId marlin_client_queue[MARLIN_MAX_CLIENTS]
Definition: marlin_client.c:60
marlin_client_t
struct _marlin_client_t marlin_client_t
marlin_change
int marlin_change(uint8_t var_id)
Definition: marlin_client.c:268
MARLIN_VAR_Z_OFFSET
#define MARLIN_VAR_Z_OFFSET
Definition: marlin_vars.h:23
marlin_host_prompt_type
host_prompt_type_t marlin_host_prompt_type(void)
Definition: marlin_client.c:521
_marlin_vars_t::motion
uint8_t motion
Definition: marlin_vars.h:78
marlin_event_clr
int marlin_event_clr(uint8_t evt_id)
Definition: marlin_client.c:252
osSemaphoreRelease
osStatus osSemaphoreRelease(osSemaphoreId semaphore_id)
Release a Semaphore token.
Definition: cmsis_os.c:862
Slot::Directory
Definition: Marlin_CardReader.cpp:35
FILINFO::fsize
FSIZE_t fsize
Definition: ff.h:198
osMessageQDef
#define osMessageQDef(name, queue_sz, type)
Create a Message Queue Definition.
Definition: cmsis_os.h:818
FAT_FILE_TYPE_ROOT32
const uint8_t FAT_FILE_TYPE_ROOT32
Definition: SdBaseFile.h:83
O_CREAT
const uint8_t O_CREAT
Definition: SdBaseFile.h:63