File syn_gcode.h¶
FileList > motor > syn_gcode.h
Go to the source code of this file
G-Code & NIST RS-274 Motion Interpreter and Controller. More...
#include "../common/syn_defs.h"#include "../pt/syn_pt.h"#include "../sched/syn_sched.h"#include "syn_interpolator.h"#include <stdbool.h>#include <stddef.h>#include <stdint.h>
Classes¶
| Type | Name |
|---|---|
| struct | SYN_GCode_Block Parsed RS-274 G-Code line block. |
| struct | SYN_GCode_Config G-Code controller configuration. |
| struct | SYN_GCode_Controller G-Code interpreter and controller instance. |
Public Types¶
| Type | Name |
|---|---|
| typedef void(* | SYN_GCode_CoolantCb Coolant state change notification callback. |
| enum | SYN_GCode_CoolantMode Coolant state (Group 8). |
| enum | SYN_GCode_DistanceMode Distance positioning mode (Group 3). |
| enum | SYN_GCode_MotionMode Motion mode (Group 1). |
| enum | SYN_GCode_Plane Working plane selection (Group 2). |
| typedef void(* | SYN_GCode_SpindleCb Spindle state change notification callback. |
| enum | SYN_GCode_SpindleMode Spindle state (Group 7). |
| typedef void(* | SYN_GCode_ToolCb Tool change notification callback. |
| enum | SYN_GCode_Units Unit system (Group 6). |
Public Functions¶
| Type | Name |
|---|---|
| SYN_Status | syn_gcode_execute_block (SYN_GCode_Controller * ctrl, const SYN_GCode_Block * block) Execute a parsed G-Code block on the controller. |
| SYN_Status | syn_gcode_execute_line (SYN_GCode_Controller * ctrl, const char * line) Parse and execute an ASCII G-Code line in one step. |
| SYN_Status | syn_gcode_init (SYN_GCode_Controller * ctrl, const SYN_GCode_Config * cfg) Initialize G-Code Controller. |
| SYN_Status | syn_gcode_parse_line (const char * line, SYN_GCode_Block * block) Parse a single ASCII G-Code line into a command block. |
| bool | syn_gcode_step (SYN_GCode_Controller * ctrl, SYN_Vector3F * out_pos) Step the active motion move generated by the G-code controller. |
| SYN_PT_Status | syn_gcode_task_pt (SYN_PT * pt, SYN_Task * task) Protothread continuation function for syn_sched . |
Detailed Description¶
Provides a zero-heap streaming ASCII G-code parser and motion controller:
* Word extraction (G, M, X, Y, Z, I, J, K, F, S, P, T).
* Modal state tracking (G0..G4, G17..G19, G20/G21, G90/G91, G92, M3..M5, M7..M9).
* Trajectory pipeline integration with SYN_Interpolator for coordinated multi-axis moves.
* Non-blocking motion step execution and cooperative protothread runner.
Public Types Documentation¶
typedef SYN_GCode_CoolantCb¶
Coolant state change notification callback.
enum SYN_GCode_CoolantMode¶
Coolant state (Group 8).
enum SYN_GCode_CoolantMode {
SYN_GCODE_COOLANT_OFF = 0,
SYN_GCODE_COOLANT_FLOOD = 1,
SYN_GCODE_COOLANT_MIST = 2
};
enum SYN_GCode_DistanceMode¶
Distance positioning mode (Group 3).
enum SYN_GCode_MotionMode¶
Motion mode (Group 1).
enum SYN_GCode_MotionMode {
SYN_GCODE_MOTION_RAPID = 0,
SYN_GCODE_MOTION_LINEAR = 1,
SYN_GCODE_MOTION_ARC_CW = 2,
SYN_GCODE_MOTION_ARC_CCW = 3,
SYN_GCODE_MOTION_DWELL = 4
};
enum SYN_GCode_Plane¶
Working plane selection (Group 2).
typedef SYN_GCode_SpindleCb¶
Spindle state change notification callback.
enum SYN_GCode_SpindleMode¶
Spindle state (Group 7).
enum SYN_GCode_SpindleMode {
SYN_GCODE_SPINDLE_OFF = 0,
SYN_GCODE_SPINDLE_CW = 1,
SYN_GCODE_SPINDLE_CCW = 2
};
typedef SYN_GCode_ToolCb¶
Tool change notification callback.
enum SYN_GCode_Units¶
Unit system (Group 6).
Public Functions Documentation¶
function syn_gcode_execute_block¶
Execute a parsed G-Code block on the controller.
Parameters:
ctrlController instance.blockParsed block to execute.
Returns:
SYN_OK on success.
function syn_gcode_execute_line¶
Parse and execute an ASCII G-Code line in one step.
Parameters:
ctrlController instance.lineNull-terminated ASCII string line.
Returns:
SYN_OK on success.
function syn_gcode_init¶
Initialize G-Code Controller.
Parameters:
ctrlController instance.cfgConfiguration parameters.
Returns:
SYN_OK on success, SYN_INVALID_PARAM on invalid argument.
function syn_gcode_parse_line¶
Parse a single ASCII G-Code line into a command block.
Parameters:
lineNull-terminated ASCII string line.blockOutput parsed block structure.
Returns:
SYN_OK on success, SYN_INVALID_PARAM on malformed line.
function syn_gcode_step¶
Step the active motion move generated by the G-code controller.
Parameters:
ctrlController instance.out_posOutput calculated position after step.
Returns:
true if move active and advanced, false if move complete / idle.
function syn_gcode_task_pt¶
Protothread continuation function for syn_sched .
Parameters:
ptProtothread continuation structure.taskTask handle containing SYN_GCode_Controller in user_data.
Returns:
SYN_PT_Status continuation status.
The documentation for this class was generated from the following file src/syntropic/motor/syn_gcode.h