grblHAL core  20250514
plugins_init.h
Go to the documentation of this file.
1 /*
2  plugins_init.h - An embedded CNC Controller with rs274/ngc (g-code) support
3 
4  Calls the init function of enabled plugins, may be included at the end of the drivers driver_init() implementation.
5 
6  These are NOT referenced in the core grbl code
7 
8  Part of grblHAL
9 
10  Copyright (c) 2021-2025 Terje Io
11 
12  grblHAL is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  grblHAL is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with grblHAL. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #if SDCARD_ENABLE || LITTLEFS_ENABLE == 2
27  extern void fs_stream_init (void);
28  fs_stream_init();
29 #endif
30 
31 #if TRINAMIC_ENABLE
32  extern bool trinamic_init (void);
33  trinamic_init();
34 #endif
35 
36 #if PLASMA_ENABLE
37  extern void plasma_init (void);
38  plasma_init();
39 #endif
40 
41 #if MODBUS_ENABLE && (MODBUS_ENABLE & MODBUS_RTU_ENABLED)
42 
43  extern void modbus_rtu_init (int8_t stream, int8_t dir_aux);
44 
45  int8_t stream, dir_aux;
46 
47  #ifdef MODBUS_RTU_STREAM
48  stream = MODBUS_RTU_STREAM;
49  #elif defined(MODBUS_SERIAL_PORT)
50  stream = MODBUS_SERIAL_PORT; // Use deprecated definition
51  #else
52  stream = -1;
53  #endif
54 
55  #if MODBUS_ENABLE && (MODBUS_ENABLE & MODBUS_RTU_DIR_ENABLED)
56  #ifdef MODBUS_DIR_AUX
57  dir_aux = MODBUS_DIR_AUX;
58  #else
59  dir_aux = -1;
60  #endif
61  #else
62  dir_aux = -2;
63  #endif
64 
65  modbus_rtu_init(stream, dir_aux);
66 
67 #endif // MODBUS_ENABLE (RTU)
68 
69 #if CANBUS_ENABLE
70  extern void canbus_init (void);
71  canbus_init();
72 #endif
73 
74 #if SPINDLE_ENABLE & (1<<SPINDLE_PWM0_CLONE)
75  extern void cloned_spindle_init (void);
76  cloned_spindle_init();
77 #endif
78 
79 #if SPINDLE_ENABLE & (1<<SPINDLE_STEPPER)
80  extern void stepper_spindle_init (void);
81  stepper_spindle_init();
82 #endif
83 
84 #if SPINDLE_ENABLE & ((1<<SPINDLE_ONOFF1)|(1<<SPINDLE_ONOFF1_DIR))
85  extern void onoff_spindle_init (void);
86  onoff_spindle_init();
87 #endif
88 
89 #if SPINDLE_ENABLE & ((1<<SPINDLE_PWM2)|(1<<SPINDLE_PWM2_NODIR))
90  extern void pwm_spindle_init (void);
91  pwm_spindle_init();
92 #endif
93 
94 #if VFD_ENABLE
95  extern void vfd_init (void);
96  vfd_init();
97 #endif
98 
99 #if PROBE_ENABLE > 1
100  extern void probe_select_init (void);
101  probe_select_init();
102 #endif
103 
104 #if BLUETOOTH_ENABLE > 1
105  extern void bluetooth_init (void);
106  bluetooth_init();
107 #endif
108 
109 #if ESP_AT_ENABLE
110  extern void esp_at_init (void);
111  esp_at_init();
112 #endif
113 
114 #if KEYPAD_ENABLE
115  extern bool keypad_init (void);
116  keypad_init();
117 #endif
118 
119 #if MACROS_ENABLE
120  extern bool macros_init (void);
121  macros_init();
122 #endif
123 
124 #if LASER_COOLANT_ENABLE
125  extern void laser_coolant_init (void);
126  laser_coolant_init();
127 #endif
128 
129 #if LASER_OVD_ENABLE
130  extern void laser_ovd_init (void);
131  laser_ovd_init();
132 #endif
133 
134 #if FANS_ENABLE
135  extern void fans_init (void);
136  fans_init();
137 #endif
138 
139 #if OPENPNP_ENABLE
140  extern void openpnp_init (void);
141  openpnp_init();
142 #endif
143 
144 #if LB_CLUSTERS_ENABLE
145  extern void lb_clusters_init (void);
146  lb_clusters_init();
147 #endif
148 
149 #if PROBE_PROTECT_ENABLE
150  extern void probe_protect_init (void);
151  probe_protect_init();
152 #endif
153 
154 #if WEBUI_ENABLE
155  extern void webui_init (void);
156  webui_init();
157 #endif
158 
159 #if EMBROIDERY_ENABLE
160  extern void embroidery_init (void);
161  embroidery_init();
162 #endif
163 
164 #if RGB_LED_ENABLE
165  extern void rgb_led_init (void);
166  rgb_led_init();
167 #endif
168 
169 #if FEED_OVERRIDE_ENABLE
170  extern void feed_override_init (void);
171  feed_override_init();
172 #endif
173 
174 #if HOMING_PULLOFF_ENABLE
175  extern void homing_pulloff_init (void);
176  homing_pulloff_init();
177 #endif
178 
179  extern void my_plugin_init (void);
180  my_plugin_init();
181 
182 #if N_SPINDLE > 1
183  extern void spindle_select_init(void);
184  spindle_select_init();
185  #if SPINDLE_OFFSET == 1
186  extern void spindle_offset_init (void);
187  spindle_offset_init();
188  #endif
189 #endif
190 
191 // Third party plugin definitions.
192 // The code for these has to be downloaded from the source and placed in the same folder as driver.c
193 // Note: Third party plugins may have more than one implementation, there is no "owner" of plugins listed here.
194 // It is also guaranteed that there will be no implementation in the grblHAL repository of these.
195 
196 #if PWM_SERVO_ENABLE
197  extern void pwm_servo_init (void);
198  pwm_servo_init();
199 #endif
200 
201 #if BLTOUCH_ENABLE
202  extern void bltouch_init (void);
203  bltouch_init();
204 #endif
205 
206 #if ATC_ENABLE
207  extern void atc_init (void);
208  atc_init();
209 #endif
210 
211 #if PROBE_RELAY_ENABLE
212  extern void probe_relay_init (void);
213  probe_relay_init();
214 #endif
215 
216 #if DISPLAY_ENABLE
217  void display_init (void);
218  display_init();
219 #endif
220 
221 #if STATUS_LIGHT_ENABLE
222  extern void status_light_init (void);
223  status_light_init();
224 #endif
225 
226 #if PANEL_ENABLE
227  extern void panel_init (void);
228  panel_init();
229 #endif
230 
231 #if EVENTOUT_ENABLE
232  extern void event_out_init (void);
233  event_out_init();
234 #endif
235 
236 // End third party plugin definitions.
237 
238 #if ODOMETER_ENABLE
239  extern void odometer_init (void);
240  odometer_init(); // NOTE: this *must* be last plugin to be initialized as it claims storage at the end of NVS.
241 #endif
242 
243 /*EOF*/
void canbus_init(void)
Definition: canbus.c:189
void modbus_rtu_init(int8_t stream, int8_t dir_aux)
Definition: modbus_rtu.c:503
void my_plugin_init(void)
Definition: my_plugin.c:26