save some ram by not making public data returns static data
[clinton/Smoothieware.git] / src / modules / tools / laser / Laser.h
CommitLineData
de91760a 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.
de91760a 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 LASER_MODULE_H
9#define LASER_MODULE_H
10
4cff3ded 11#include "libs/Module.h"
d90615e5 12#include "libs/Pin.h"
4cff3ded
AW
13#include "libs/Kernel.h"
14#include "modules/communication/utils/Gcode.h"
dad4ecfc 15#include "PwmOut.h" // mbed.h lib
4cff3ded 16
da3a10b9 17
d4f93cf4 18#define laser_module_enable_checksum CHECKSUM("laser_module_enable")
d90615e5 19#define laser_module_pin_checksum CHECKSUM("laser_module_pin")
9548623d 20#define laser_module_pwm_period_checksum CHECKSUM("laser_module_pwm_period")
d4f93cf4
AG
21#define laser_module_max_power_checksum CHECKSUM("laser_module_max_power")
22#define laser_module_tickle_power_checksum CHECKSUM("laser_module_tickle_power")
f5598f5b 23
4cff3ded
AW
24class Laser : public Module{
25 public:
e605a0d6 26 Laser();
eeef2894 27 virtual ~Laser() {};
4cff3ded 28 void on_module_loaded();
a2cd92c0
AW
29 void on_block_end(void* argument);
30 void on_block_begin(void* argument);
befcf5cc
AW
31 void on_play(void* argument);
32 void on_pause(void* argument);
4cff3ded
AW
33 void on_gcode_execute(void* argument);
34 void on_speed_change(void* argument);
a2cd92c0 35 void set_proportional_power();
4cff3ded 36
dad4ecfc 37 mbed::PwmOut* laser_pin; // PWM output to regulate the laser power
86fa0b93
JM
38 struct {
39 bool laser_on:1; // Laser status
40 bool laser_inverting:1; // stores whether the pwm period should be inverted
41 };
dad4ecfc
AW
42 float laser_max_power; // maximum allowed laser power to be output on the pwm pin
43 float laser_tickle_power; // value used to tickle the laser on moves
4cff3ded
AW
44};
45
2f37949e 46#endif