grblHAL core  20261015
stream.h
Go to the documentation of this file.
1 /*
2  stream.h - high level (serial) stream handling
3 
4  Part of grblHAL
5 
6  Copyright (c) 2019-2026 Terje Io
7 
8  grblHAL is free software: you can redistribute it and/or modify
9  it under the terms of the GNU General Public License as published by
10  the Free Software Foundation, either version 3 of the License, or
11  (at your option) any later version.
12 
13  grblHAL is distributed in the hope that it will be useful,
14  but WITHOUT ANY WARRANTY; without even the implied warranty of
15  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  GNU General Public License for more details.
17 
18  You should have received a copy of the GNU General Public License
19  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
20 */
21 
28 #ifndef _STREAM_H_
29 #define _STREAM_H_
30 
31 #define ASCII_NUL 0x00
32 #define ASCII_SOH 0x01
33 #define ASCII_STX 0x02
34 #define ASCII_ETX 0x03
35 #define ASCII_EOT 0x04
36 #define ASCII_ENQ 0x05
37 #define ASCII_ACK 0x06
38 #define ASCII_BS 0x08
39 #define ASCII_TAB 0x09
40 #define ASCII_LF 0x0A
41 #define ASCII_CR 0x0D
42 #define ASCII_XON 0x11
43 #define ASCII_XOFF 0x13
44 #define ASCII_NAK 0x15
45 #define ASCII_EOF 0x1A
46 #define ASCII_CAN 0x18
47 #define ASCII_EM 0x19
48 #define ASCII_ESC 0x1B
49 #define ASCII_DEL 0x7F
50 #define ASCII_EOL "\r\n"
51 
52 #ifndef RX_BUFFER_SIZE
53 #define RX_BUFFER_SIZE 1024 // must be a power of 2
54 #endif
55 
56 #ifndef TX_BUFFER_SIZE
57 #define TX_BUFFER_SIZE 512 // must be a power of 2
58 #endif
59 
60 #ifndef BLOCK_TX_BUFFER_SIZE
61 #define BLOCK_TX_BUFFER_SIZE 256
62 #endif
63 
64 // Serial baud rate
65 #ifndef BAUD_RATE
66 #define BAUD_RATE 115200
67 #endif
68 
69 // Value to be returned from input stream when no data is available
70 #ifndef SERIAL_NO_DATA
71 #define SERIAL_NO_DATA -1
72 #endif
73 
74 #define BUFNEXT(ptr, buffer) ((ptr + 1) & (sizeof(buffer.data) - 1))
75 #define BUFCOUNT(head, tail, size) ((head >= tail) ? (head - tail) : (size - tail + head))
76 
77 #include <stddef.h>
78 #include <stdint.h>
79 #include <stdbool.h>
80 
81 #include "probe.h"
82 #include "vfs.h"
83 
84 typedef enum {
91 
92 typedef enum {
97 
98 typedef enum {
102 
103 typedef enum {
109 
110 typedef enum {
117 
118 typedef union {
119  uint8_t value;
120  struct {
121  uint8_t width :2,
123  parity :3,
124  unused :1;
125  };
127 
128 typedef union {
129  uint8_t value;
130  struct {
131  uint8_t dtr :1,
132  dsr :1,
133  rts :1,
134  cts :1,
135  unused :4;
136  };
138 
139 typedef enum {
141  Report_MPGMode = (1 << 0),
142  Report_Scaling = (1 << 1),
143  Report_Homed = (1 << 2),
144  Report_LatheXMode = (1 << 3),
145  Report_Spindle = (1 << 4),
146  Report_Coolant = (1 << 5),
147  Report_Overrides = (1 << 6),
148  Report_Tool = (1 << 7),
149  Report_WCO = (1 << 8),
150  Report_GWCO = (1 << 9),
151  Report_ToolOffset = (1 << 10),
152  Report_M66Result = (1 << 11),
153  Report_PWM = (1 << 12),
154  Report_Motor = (1 << 13),
155  Report_Encoder = (1 << 14),
156  Report_TLOReference = (1 << 15),
157  Report_Fan = (1 << 16),
158  Report_SpindleId = (1 << 17),
159  Report_ProbeId = (1 << 18),
160  Report_DistanceToGo = (1 << 19),
161  Report_ProbeProtect = (1 << 20),
162  Report_ForceWCO = (1 << 29),
163  Report_CycleStart = (1 << 30),
164  Report_All = 0x801FFFFF
166 
167 typedef union {
168  uint32_t value;
169  struct {
170  uint32_t mpg_mode :1,
171  scaling :1,
172  homed :1,
173  xmode :1,
174  spindle :1,
175  coolant :1,
177  tool :1,
178  wco :1,
179  gwco :1,
182  pwm :1,
183  motor :1,
184  encoder :1,
186  fan :1,
188  probe_id :1,
191  unassigned :7, //
192  extended :1,
195  all :1;
196  };
198 
199 typedef struct {
202  uint8_t wco_counter;
205 
206 struct io_stream_properties;
208 
212 typedef bool (*stream_is_connected_ptr)(void);
213 
217 typedef uint16_t (*get_stream_buffer_count_ptr)(void);
218 
222 typedef int32_t (*stream_read_ptr)(void);
223 
229 typedef void (*stream_write_ptr)(const char *s);
230 
235 typedef void (*stream_write_n_ptr)(const uint8_t *s, uint16_t len);
236 
237 
241 typedef bool (*stream_write_char_ptr)(const uint8_t c);
242 
248 typedef bool (*enqueue_realtime_command_ptr)(uint8_t c);
249 
253 typedef void (*stream_set_direction_ptr)(bool tx);
254 
263 typedef bool (*enqueue_realtime_command2_ptr)(uint8_t c);
264 
265 
274 
279 typedef bool (*set_format_ptr)(serial_format_t format);
280 
285 typedef bool (*set_baud_rate_ptr)(uint32_t baud_rate);
286 
288 typedef void (*flush_stream_buffer_ptr)(void);
289 
295 typedef void (*cancel_read_buffer_ptr)(void);
296 
315 typedef bool (*suspend_read_ptr)(bool await);
316 
326 typedef bool (*disable_rx_stream_ptr)(bool disable);
327 
333 
334 typedef union {
335  uint8_t value;
336  struct {
337  uint8_t claimable :1,
344  is_usb :1;
345  };
347 
348 typedef union {
349  uint8_t value;
350  struct {
351  uint8_t webui_connected :1,
352  is_usb :1,
354  passthru :1,
355  utf8 :1,
356  eof :1,
358  is_mpg :1;
359  };
361 
363 typedef struct {
365  uint8_t instance;
387 // The following fields are kept over a stream change
390 } io_stream_t;
391 
392 typedef struct {
396  uint32_t baud_rate;
399 
400 typedef const io_stream_t *(*stream_claim_ptr)(uint32_t baud_rate);
401 typedef bool (*stream_release_ptr)(uint8_t instance);
402 typedef const io_stream_status_t *(*stream_get_status_ptr)(uint8_t instance);
403 
406  uint8_t instance;
411 };
412 
413 typedef bool (*stream_enumerate_callback_ptr)(io_stream_properties_t const *properties, void *data);
414 
415 typedef struct io_stream_details {
416  uint8_t n_streams;
420 
421 // The following structures and functions are not referenced in the core code, may be used by drivers
422 
423 typedef struct {
424  volatile uint_fast16_t head;
425  volatile uint_fast16_t tail;
426  volatile bool rts_state;
427  bool overflow;
428  bool backup;
429  uint8_t data[RX_BUFFER_SIZE];
431 
432 typedef struct {
433  volatile uint_fast16_t head;
434  volatile uint_fast16_t tail;
435  uint8_t data[TX_BUFFER_SIZE];
437 
438 typedef struct {
439  uint_fast16_t length;
440  uint_fast16_t max_length;
441  uint8_t *s;
442  uint8_t data[BLOCK_TX_BUFFER_SIZE];
444 
445 // double buffered tx stream
446 typedef struct {
447  uint_fast16_t length;
448  uint_fast16_t max_length;
449  uint8_t *s;
451  uint8_t data[BLOCK_TX_BUFFER_SIZE];
452  uint8_t data2[BLOCK_TX_BUFFER_SIZE];
454 
455 #ifdef __cplusplus
456 extern "C" {
457 #endif
458 
459 static inline bool stream_is_uart (stream_type_t type)
460 {
461  return type == StreamType_Serial || type == StreamType_Bluetooth;
462 }
463 
467 int32_t stream_get_null (void);
468 
474  bool stream_rx_suspend (stream_rx_buffer_t *rxbuffer, bool suspend);
475 
477 
478 bool stream_mpg_register (const io_stream_t *stream, bool rx_only, stream_write_char_ptr write_char);
479 
480 bool stream_mpg_set_baud (uint8_t baud);
481 
486 bool stream_mpg_enable (bool on);
487 
488 void stream_mpg_set_mode (void *data);
489 
490 bool stream_mpg_check_enable (uint8_t c);
491 
492 bool stream_buffer_all (uint8_t c);
493 
494 bool stream_tx_blocking (void);
495 
496 bool stream_enqueue_realtime_command (uint8_t c);
497 
499 
500 bool stream_enumerate_streams (stream_enumerate_callback_ptr callback, void *data);
501 
502 bool stream_connect (const io_stream_t *stream);
503 
504 bool stream_connect_instance (uint8_t instance, uint32_t baud_rate);
505 
506 void stream_disconnect (const io_stream_t *stream);
507 
508 bool stream_connected (void);
509 
510 bool stream_is_busy (bool is_connected);
511 
512 bool stream_await_tx_clear (const io_stream_t *stream);
513 
514 void stream_set_defaults (const io_stream_t *stream, uint32_t baud_rate);
515 
516 const io_stream_t *stream_get_base (void);
517 
519 
520 const io_stream_status_t *stream_get_uart_status (uint8_t instance);
521 
522 const io_stream_t *stream_null_init (uint32_t baud_rate);
523 
524 void stream_usb_linestate_changed (uint8_t instance, serial_linestate_t state);
525 
526 io_stream_t const *stream_open_instance (uint8_t instance, uint32_t baud_rate, stream_write_char_ptr rx_handler, const char *description);
527 bool stream_close (io_stream_t const *stream);
528 bool stream_set_description (const io_stream_t *stream, const char *description);
529 
530 void stream_set_file (vfs_file_t *file, stream_read_ptr read);
531 bool stream_is_file (void);
532 
533 void debug_printf(const char *fmt, ...);
534 
535 #if defined(DEBUG) || defined(DEBUGOUT)
536 #define DEBUG_PRINT 1
537 #ifdef DEBUGOUT
538 void debug_write (const char *s);
539 void debug_writeln (const char *s);
540 bool debug_stream_init (void);
541 #endif
542 #else
543 #define DEBUG_PRINT 0
544 #endif
545 
546 #define debug_print(fmt, ...) \
547  do { if(DEBUG_PRINT) debug_printf(fmt, __VA_ARGS__); } while(0)
548 
549 #ifdef __cplusplus
550 }
551 #endif
552 
553 #endif
stream_write_char_ptr write_char
Definition: stream.c:97
bool stream_connected(void)
Definition: stream.c:245
serial_stopbits_t
Definition: stream.h:103
@ Serial_StopBits0_5
Definition: stream.h:107
@ Serial_StopBits1
Definition: stream.h:104
@ Serial_StopBits2
Definition: stream.h:106
@ Serial_StopBits1_5
Definition: stream.h:105
void stream_disconnect(const io_stream_t *stream)
Definition: stream.c:524
bool(* stream_release_ptr)(uint8_t instance)
Definition: stream.h:401
stream_suspend_state_t
Definition: stream.h:92
@ StreamSuspend_Pending
Definition: stream.h:94
@ StreamSuspend_Active
Definition: stream.h:95
@ StreamSuspend_Off
Definition: stream.h:93
uint16_t(* get_stream_buffer_count_ptr)(void)
Pointer to function for getting number of characters available or free in a stream buffer.
Definition: stream.h:217
bool(* stream_is_connected_ptr)(void)
Pointer to function for getting stream connected status.
Definition: stream.h:212
void(* stream_write_ptr)(const char *s)
Pointer to function for writing a null terminated string to the output stream.
Definition: stream.h:229
bool stream_enqueue_realtime_command(uint8_t c)
Definition: stream.c:233
bool(* stream_enumerate_callback_ptr)(io_stream_properties_t const *properties, void *data)
Definition: stream.h:413
void stream_usb_linestate_changed(uint8_t instance, serial_linestate_t state)
Definition: stream.c:323
bool(* set_format_ptr)(serial_format_t format)
Pointer to function for setting the stream format.
Definition: stream.h:279
void stream_mpg_set_mode(void *data)
Definition: stream.c:637
const io_stream_status_t * stream_get_uart_status(uint8_t instance)
Definition: stream.c:149
bool stream_tx_blocking(void)
Definition: stream.c:136
bool(* stream_write_char_ptr)(const uint8_t c)
Pointer to function for writing a single character to the output stream.
Definition: stream.h:241
bool stream_mpg_set_baud(uint8_t baud)
Definition: stream.c:805
bool stream_is_file(void)
Definition: stream.c:580
void stream_set_defaults(const io_stream_t *stream, uint32_t baud_rate)
Definition: stream.c:587
io_stream_t const * stream_open_instance(uint8_t instance, uint32_t baud_rate, stream_write_char_ptr rx_handler, const char *description)
Definition: stream.c:530
void(* cancel_read_buffer_ptr)(void)
Pointer to function for flushing the input buffer and inserting an ASCII_CAN character.
Definition: stream.h:295
bool(* enqueue_realtime_command_ptr)(uint8_t c)
Pointer to function for extracting real-time commands from the input stream and enqueue them for proc...
Definition: stream.h:248
int32_t stream_get_null(void)
Dummy function for reading data from a virtual empty input buffer.
Definition: stream.c:144
void stream_register_streams(io_stream_details_t *details)
Definition: stream.c:106
io_stream_flags_t stream_get_flags(io_stream_t stream)
Definition: stream.c:455
int32_t(* stream_read_ptr)(void)
Pointer to function for reading a single character from a input stream.
Definition: stream.h:222
bool stream_mpg_enable(bool on)
Function for enabling/disabling input from a secondary input stream.
Definition: stream.c:812
#define RX_BUFFER_SIZE
Definition: stream.h:53
bool stream_connect_instance(uint8_t instance, uint32_t baud_rate)
Definition: stream.c:514
bool stream_enumerate_streams(stream_enumerate_callback_ptr callback, void *data)
Definition: stream.c:114
const io_stream_t * stream_null_init(uint32_t baud_rate)
Definition: stream.c:922
void(* stream_write_n_ptr)(const uint8_t *s, uint16_t len)
Pointer to function for writing a n character long string to the output stream.
Definition: stream.h:235
void debug_printf(const char *fmt,...)
Definition: stream.c:1070
bool stream_connect(const io_stream_t *stream)
Definition: stream.c:486
bool stream_mpg_register(const io_stream_t *stream, bool rx_only, stream_write_char_ptr write_char)
Definition: stream.c:723
void(* flush_stream_buffer_ptr)(void)
Pointer to function for flushing a stream buffer.
Definition: stream.h:288
stream_suspend_state_t stream_is_rx_suspended(void)
Definition: stream.c:188
#define TX_BUFFER_SIZE
Definition: stream.h:57
bool stream_set_description(const io_stream_t *stream, const char *description)
Definition: stream.c:474
bool(* set_baud_rate_ptr)(uint32_t baud_rate)
Pointer to function for setting the stream baud rate.
Definition: stream.h:285
struct io_stream_details io_stream_details_t
void stream_set_file(vfs_file_t *file, stream_read_ptr read)
Definition: stream.c:571
bool stream_await_tx_clear(const io_stream_t *stream)
Definition: stream.c:218
bool stream_is_busy(bool is_connected)
Definition: stream.c:787
const io_stream_t *(* stream_claim_ptr)(uint32_t baud_rate)
Definition: stream.h:400
serial_parity_t
Definition: stream.h:110
@ Serial_ParitySpace
Definition: stream.h:115
@ Serial_ParityNone
Definition: stream.h:111
@ Serial_ParityMark
Definition: stream.h:114
@ Serial_ParityEven
Definition: stream.h:112
@ Serial_ParityOdd
Definition: stream.h:113
bool stream_rx_suspend(stream_rx_buffer_t *rxbuffer, bool suspend)
Function for blocking reads from or restoring an input buffer.
Definition: stream.c:193
#define BLOCK_TX_BUFFER_SIZE
Definition: stream.h:61
report_tracking_t
Definition: stream.h:139
@ Report_PWM
Definition: stream.h:153
@ Report_Scaling
Definition: stream.h:142
@ Report_Homed
Definition: stream.h:143
@ Report_ClearAll
Definition: stream.h:140
@ Report_GWCO
Definition: stream.h:150
@ Report_DistanceToGo
Definition: stream.h:160
@ Report_WCO
Definition: stream.h:149
@ Report_Overrides
Definition: stream.h:147
@ Report_CycleStart
Definition: stream.h:163
@ Report_Motor
Definition: stream.h:154
@ Report_All
Definition: stream.h:164
@ Report_ProbeProtect
Definition: stream.h:161
@ Report_MPGMode
Definition: stream.h:141
@ Report_LatheXMode
Definition: stream.h:144
@ Report_TLOReference
Definition: stream.h:156
@ Report_SpindleId
Definition: stream.h:158
@ Report_ForceWCO
Definition: stream.h:162
@ Report_Encoder
Definition: stream.h:155
@ Report_Fan
Definition: stream.h:157
@ Report_Coolant
Definition: stream.h:146
@ Report_Spindle
Definition: stream.h:145
@ Report_ToolOffset
Definition: stream.h:151
@ Report_ProbeId
Definition: stream.h:159
@ Report_Tool
Definition: stream.h:148
@ Report_M66Result
Definition: stream.h:152
bool(* disable_rx_stream_ptr)(bool disable)
Pointer to function for disabling/enabling stream input.
Definition: stream.h:326
bool stream_buffer_all(uint8_t c)
Definition: stream.c:228
void(* on_linestate_changed_ptr)(io_stream_properties_t *stream, serial_linestate_t state)
Pointer to function for handling line state changed events.
Definition: stream.h:332
const io_stream_status_t *(* stream_get_status_ptr)(uint8_t instance)
Definition: stream.h:402
enqueue_realtime_command_ptr(* set_enqueue_rt_handler_ptr)(enqueue_realtime_command_ptr handler)
Pointer to function for setting the enqueue realtime commands handler.
Definition: stream.h:273
bool stream_close(io_stream_t const *stream)
Definition: stream.c:546
void(* stream_set_direction_ptr)(bool tx)
Pointer to function for setting the transfer direction control signal for half-duplex connections (RS...
Definition: stream.h:253
bool stream_mpg_check_enable(uint8_t c)
Definition: stream.c:677
stream_type_t
Definition: stream.h:84
@ StreamType_Bluetooth
Definition: stream.h:86
@ StreamType_Telnet
Definition: stream.h:87
@ StreamType_WebSocket
Definition: stream.h:88
@ StreamType_Null
Definition: stream.h:89
@ StreamType_Serial
Definition: stream.h:85
serial_width_t
Definition: stream.h:98
@ Serial_8bit
Definition: stream.h:99
@ Serial_7bit
Definition: stream.h:100
bool(* suspend_read_ptr)(bool await)
Pointer to function for blocking reads from and restoring a input buffer.
Definition: stream.h:315
const io_stream_t * stream_get_base(void)
Definition: stream.c:450
bool(* enqueue_realtime_command2_ptr)(uint8_t c)
Optional, but recommended, pointer to function for enqueueing realtime command characters.
Definition: stream.h:263
Definition: stream.h:415
struct io_stream_details * next
Definition: stream.h:418
io_stream_properties_t * streams
Definition: stream.h:417
uint8_t n_streams
Definition: stream.h:416
Definition: stream.h:404
uint8_t instance
Instance of stream type, starts from 0.
Definition: stream.h:406
stream_release_ptr release
Definition: stream.h:409
stream_get_status_ptr get_status
Optional handler for getting stream status, for UART streams only.
Definition: stream.h:410
stream_type_t type
Type of stream.
Definition: stream.h:405
stream_claim_ptr claim
Definition: stream.h:408
io_stream_flags_t flags
Definition: stream.h:407
Definition: stream.h:392
uint32_t baud_rate
Definition: stream.h:396
serial_format_t format
Stream format: data length (bits), parity, stop bits.
Definition: stream.h:395
io_stream_state_t state
Optional status flags such as connected status.
Definition: stream.h:393
uint32_t last_status_request
Timestamp of last status request received.
Definition: stream.h:397
io_stream_flags_t flags
Stream capability flags.
Definition: stream.h:394
Properties and handlers for stream I/O.
Definition: stream.h:363
uint8_t instance
Instance of stream type, starts from 0.
Definition: stream.h:365
flush_stream_buffer_ptr reset_read_buffer
Handler for flushing the input buffer.
Definition: stream.h:374
stream_write_char_ptr write_char
Handler for writing a single character to current stream only.
Definition: stream.h:371
set_enqueue_rt_handler_ptr set_enqueue_rt_handler
Handler for setting the enqueue realtime command character handler.
Definition: stream.h:376
set_format_ptr set_format
Optional handler for setting the stream format.
Definition: stream.h:384
stream_write_ptr write
Handler for writing string to current output stream only.
Definition: stream.h:369
enqueue_realtime_command2_ptr enqueue_rt_command
(Optional) handler for enqueueing a realtime command character.
Definition: stream.h:372
io_stream_state_t state
Optional status flags such as connected status.
Definition: stream.h:366
get_stream_buffer_count_ptr get_rx_buffer_count
Optional handler for getting number of characters in the input buffer.
Definition: stream.h:380
stream_type_t type
Type of stream.
Definition: stream.h:364
on_linestate_changed_ptr on_linestate_changed
Optional handler to be called when line state changes. Set by client.
Definition: stream.h:389
stream_write_n_ptr write_n
Optional handler for writing n characters to current output stream only. Required for Modbus support.
Definition: stream.h:378
get_stream_buffer_count_ptr get_tx_buffer_count
Optional handler for getting number of characters in the output buffer(s). Count shall include any un...
Definition: stream.h:381
disable_rx_stream_ptr disable_rx
Optional handler for disabling/enabling a stream. Recommended?
Definition: stream.h:379
stream_set_direction_ptr set_direction
Optional handler for setting the transfer direction for half-duplex communication.
Definition: stream.h:385
set_baud_rate_ptr set_baud_rate
Optional handler for setting the stream baud rate. Required for Modbus/RS-485 support,...
Definition: stream.h:383
status_report_tracking_t report
Tracks when to add data to status reports.
Definition: stream.h:388
stream_is_connected_ptr is_connected
Handler for getting stream connected status.
Definition: stream.h:367
cancel_read_buffer_ptr cancel_read_buffer
Handler for flushing the input buffer and inserting an ASCII_CAN character.
Definition: stream.h:375
stream_write_ptr write_all
Handler for writing string to all active output streams.
Definition: stream.h:370
vfs_file_t * file
File handle, non-null if streaming from a file.
Definition: stream.h:386
stream_read_ptr read
Handler for reading a single character from the input stream.
Definition: stream.h:373
flush_stream_buffer_ptr reset_write_buffer
Optional handler for flushing the output buffer. Any transmit FIFO shall be flushed as well....
Definition: stream.h:382
get_stream_buffer_count_ptr get_rx_buffer_free
Handler for getting number of free characters in the input buffer.
Definition: stream.h:368
suspend_read_ptr suspend_read
Optional handler for saving away and restoring the current input buffer.
Definition: stream.h:377
Definition: stream.h:199
uint8_t override_counter
Tracks when to add override data to status reports.
Definition: stream.h:201
report_tracking_flags_t flags
Definition: stream.h:200
probe_states_t probe_states
Last polled probe triggered state for all available probes.
Definition: stream.h:203
uint8_t wco_counter
Tracks when to add work coordinate offset data to status reports.
Definition: stream.h:202
Definition: stream.h:446
bool use_tx2data
Definition: stream.h:450
uint_fast16_t length
Definition: stream.h:447
uint8_t * s
Definition: stream.h:449
uint_fast16_t max_length
Definition: stream.h:448
Definition: stream.h:438
uint_fast16_t length
Definition: stream.h:439
uint8_t * s
Definition: stream.h:441
uint_fast16_t max_length
Definition: stream.h:440
Definition: stream.h:423
bool overflow
Definition: stream.h:427
volatile uint_fast16_t head
Definition: stream.h:424
volatile bool rts_state
Definition: stream.h:426
bool backup
Definition: stream.h:428
volatile uint_fast16_t tail
Definition: stream.h:425
Definition: stream.h:432
volatile uint_fast16_t head
Definition: stream.h:433
volatile uint_fast16_t tail
Definition: stream.h:434
Definition: vfs.h:95
Definition: stream.h:334
uint8_t can_set_baud
Definition: stream.h:339
uint8_t is_usb
Definition: stream.h:344
uint8_t claimed
Definition: stream.h:338
uint8_t value
Definition: stream.h:335
uint8_t init_ok
Definition: stream.h:343
uint8_t rx_only
Definition: stream.h:340
uint8_t modbus_ready
Definition: stream.h:341
uint8_t rts_handshake
Definition: stream.h:342
uint8_t claimable
Definition: stream.h:337
Definition: stream.h:348
uint8_t is_usb
Definition: stream.h:352
uint8_t m98_macro_prescan
Set when prescanning gcode for M98 macro definitions.
Definition: stream.h:357
uint8_t eof
Set when a file stream reaches end-of-file.
Definition: stream.h:356
uint8_t value
Definition: stream.h:349
uint8_t passthru
Set when stream is in passthru mode.
Definition: stream.h:354
uint8_t utf8
Set when stream is in UTF8 mode.
Definition: stream.h:355
uint8_t webui_connected
Definition: stream.h:351
uint8_t linestate_event
Set when driver supports on_linestate_changed event.
Definition: stream.h:353
uint8_t is_mpg
Set when stream is redirected to MPG.
Definition: stream.h:358
Definition: probe.h:44
Definition: stream.h:167
uint32_t tlo_reference
Tool length offset reference changed.
Definition: stream.h:185
uint32_t force_wco
Add work coordinates (due to WCO changed during motion).
Definition: stream.h:193
uint32_t extended
0x80 request
Definition: stream.h:192
uint32_t tool
Tool changed.
Definition: stream.h:177
uint32_t wco
Add work coordinates.
Definition: stream.h:178
uint32_t cycle_start
Cycle start signal triggered. NOTE: do NOT add to Report_All enum above!
Definition: stream.h:194
uint32_t unassigned
Definition: stream.h:191
uint32_t gwco
Add work coordinate.
Definition: stream.h:179
uint32_t fan
Fan on/off changed.
Definition: stream.h:186
uint32_t distance_to_go
Distance to go.
Definition: stream.h:189
uint32_t mpg_mode
MPG mode changed.
Definition: stream.h:170
uint32_t all
Set when CMD_STATUS_REPORT_ALL is requested, may be used by user code.
Definition: stream.h:195
uint32_t motor
Add motor information (optional: to be added by driver).
Definition: stream.h:183
uint32_t spindle_id
Spindle changed.
Definition: stream.h:187
uint32_t tool_offset
Tool offsets changed.
Definition: stream.h:180
uint32_t m66result
M66 result updated.
Definition: stream.h:181
uint32_t probe_id
Probe changed.
Definition: stream.h:188
uint32_t spindle
Spindle state changed.
Definition: stream.h:174
uint32_t homed
Homed state changed.
Definition: stream.h:172
uint32_t scaling
Scaling (G50/G51) changed.
Definition: stream.h:171
uint32_t probe_protect
Probe protection state changed.
Definition: stream.h:190
uint32_t pwm
Add PWM information (optional: to be added by driver).
Definition: stream.h:182
uint32_t encoder
Add encoder information (optional: to be added by driver).
Definition: stream.h:184
uint32_t value
Definition: stream.h:168
uint32_t coolant
Coolant state changed.
Definition: stream.h:175
uint32_t overrides
Overrides changed.
Definition: stream.h:176
uint32_t xmode
Lathe radius/diameter mode changed.
Definition: stream.h:173
Definition: stream.h:118
uint8_t width
Definition: stream.h:121
uint8_t value
Definition: stream.h:119
uint8_t stopbits
Definition: stream.h:122
uint8_t parity
Definition: stream.h:123
uint8_t unused
Definition: stream.h:124
Definition: stream.h:128
uint8_t cts
Definition: stream.h:134
uint8_t rts
Definition: stream.h:133
uint8_t dtr
Definition: stream.h:131
uint8_t value
Definition: stream.h:129
uint8_t dsr
Definition: stream.h:132
uint8_t unused
Definition: stream.h:135