USB: ensure interrupts are disabled while getting LPC serial number
[clinton/Smoothieware.git] / src / libs / Module.h
CommitLineData
df27a6a3 1/*
4cff3ded
AW
2 This file is part of Smoothie (http://smoothieware.org/). The motion control part is heavily based on Grbl (https://github.com/simen/grbl).
3 Smoothie 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.
4 Smoothie 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.
df27a6a3 5 You should have received a copy of the GNU General Public License along with Smoothie. If not, see <http://www.gnu.org/licenses/>.
4cff3ded
AW
6*/
7
8#ifndef MODULE_H
9#define MODULE_H
10
b6c86164
AW
11#include <string>
12using std::string;
b6c86164 13
af9072ee
MM
14// See : http://smoothieware.org/listofevents
15enum _EVENT_ENUM {
16 ON_MAIN_LOOP,
17 ON_CONSOLE_LINE_RECEIVED,
18 ON_GCODE_RECEIVED,
19 ON_STEPPER_WAKE_UP,
20 ON_GCODE_EXECUTE,
21 ON_SPEED_CHANGE,
22 ON_BLOCK_BEGIN,
23 ON_BLOCK_END,
24 ON_CONFIG_RELOAD,
25 ON_PLAY,
26 ON_PAUSE,
27 ON_IDLE,
28 ON_CONFIG_VALUE,
29 ON_CONFIG_COMPLETE,
30 NUMBER_OF_DEFINED_EVENTS
31};
32
4cff3ded 33// Module base class
df27a6a3 34// All modules must extend this class, see http://smoothieware.org/moduleexample
4cff3ded
AW
35class Kernel;
36class Module {
37 public:
38 Module();
39 virtual void on_module_loaded();
af9072ee 40 virtual void register_for_event( _EVENT_ENUM event_id);
67624453 41 virtual void on_main_loop( void * argument);
4cff3ded
AW
42 virtual void on_console_line_received( void * argument);
43 virtual void on_gcode_received( void * argument);
4cff3ded 44 virtual void on_stepper_wake_up( void * argument);
af9072ee 45 virtual void on_gcode_execute( void * argument);
4cff3ded
AW
46 virtual void on_speed_change( void * argument);
47 virtual void on_block_begin( void * argument);
48 virtual void on_block_end( void * argument);
da24d6ae 49 virtual void on_config_reload( void * argument);
befcf5cc
AW
50 virtual void on_play( void * argument);
51 virtual void on_pause( void * argument);
70c25627 52 virtual void on_idle( void * argument);
af9072ee
MM
53 virtual void on_config_value( void * argument);
54 virtual void on_config_complete( void * argument);
4cff3ded
AW
55 Kernel * kernel;
56};
57
58#endif