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.
5 you should have received a copy of the gnu general public license along with smoothie. if not, see <http://www.gnu.org/licenses/>.
25 class Switch
: public Module
{
28 Switch(uint16_t name
);
30 void on_module_loaded();
31 void on_main_loop(void *argument
);
32 void on_config_reload(void* argument
);
33 void on_gcode_received(void* argument
);
34 void on_get_public_data(void* argument
);
35 void on_set_public_data(void* argument
);
36 void on_halt(void *arg
);
38 uint32_t pinpoll_tick(uint32_t dummy
);
39 enum OUTPUT_TYPE
{NONE
, SIGMADELTA
, DIGITAL
, HWPWM
};
43 void send_gcode(string msg
, StreamOutput
* stream
);
44 bool match_input_on_gcode(const Gcode
* gcode
) const;
45 bool match_input_off_gcode(const Gcode
* gcode
) const;
49 OUTPUT_TYPE output_type
;
53 mbed::PwmOut
*pwm_pin
;
55 string output_on_command
;
56 string output_off_command
;
57 uint16_t name_checksum
;
58 uint16_t input_pin_behavior
;
59 uint16_t input_on_command_code
;
60 uint16_t input_off_command_code
;
61 char input_on_command_letter
;
62 char input_off_command_letter
;
64 bool switch_changed
:1;
65 bool input_pin_state
:1;
67 bool ignore_on_halt
:1;