Prusa MINI Firmware overview
joystick.h
Go to the documentation of this file.
1 /**
2  * Marlin 3D Printer Firmware
3  * Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
4  *
5  * Based on Sprinter and grbl.
6  * Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  *
21  */
22 #pragma once
23 
24 /**
25  * joystick.h - joystick input / jogging
26  */
27 
28 #include "../inc/MarlinConfigPre.h"
29 #include "../core/types.h"
30 #include "../core/macros.h"
31 #include "../module/temperature.h"
32 
33 //#define JOYSTICK_DEBUG
34 
35 class Joystick {
36  friend class Temperature;
37  private:
38  #if HAS_JOY_ADC_X
39  static temp_info_t x;
40  #endif
41  #if HAS_JOY_ADC_Y
42  static temp_info_t y;
43  #endif
44  #if HAS_JOY_ADC_Z
45  static temp_info_t z;
46  #endif
47  public:
48  #if ENABLED(JOYSTICK_DEBUG)
49  static void report();
50  #endif
51  static void calculate(xyz_float_t &norm_jog);
52  static void inject_jog_moves();
53 };
54 
55 extern Joystick joystick;
WITHIN
#define WITHIN(N, L, H)
Definition: macros.h:195
PENDING
#define PENDING(NOW, SOON)
Definition: millis_t.h:28
XYZval::z
T z
Definition: types.h:286
SERIAL_ECHO_TERNARY
#define SERIAL_ECHO_TERNARY(TF, PRE, ON, OFF, POST)
Definition: serial.h:188
sq
#define sq(x)
Definition: wiring_constants.h:83
Joystick
Definition: joystick.h:35
XYZval::x
T x
Definition: types.h:286
planner_settings_t::max_feedrate_mm_s
feedRate_t max_feedrate_mm_s[XYZE_N]
Definition: planner.h:182
queue
GCodeQueue queue
Definition: queue.cpp:28
UNEAR_ZERO
#define UNEAR_ZERO(x)
Definition: macros.h:269
SERIAL_ECHOPAIR
#define SERIAL_ECHOPAIR(V...)
Definition: serial.h:114
GCodeQueue::has_commands_queued
static bool has_commands_queued()
Definition: queue.cpp:103
Planner::movesplanned
static FORCE_INLINE uint8_t movesplanned()
Definition: planner.h:543
i
uint8_t i
Definition: screen_test_graph.c:72
millis
uint32_t millis(void)
Definition: wiring_time.c:29
TempInfo
Definition: temperature.h:158
joystick.h
current_position
xyze_pos_t current_position
Definition: motion.cpp:102
LOOP_XYZ
#define LOOP_XYZ(VAR)
Definition: types.h:60
SERIAL_ECHOPGM
#define SERIAL_ECHOPGM(S)
Definition: serial.h:173
Planner::buffer_line
static bool buffer_line(const float &rx, const float &ry, const float &rz, const float &e, const feedRate_t &fr_mm_s, const uint8_t extruder, const float millimeters=0.0)
Definition: planner.cpp:2663
Joystick::inject_jog_moves
static void inject_jog_moves()
XYZval::y
T y
Definition: types.h:286
SERIAL_EOL
#define SERIAL_EOL()
Definition: serial.h:181
Temperature
Definition: temperature.h:267
joystick
Joystick joystick
MMM_TO_MMS
#define MMM_TO_MMS(MM_M)
Definition: types.h:83
SIGN
#define SIGN(a)
Definition: macros.h:105
XYZval
Definition: types.h:100
length
png_uint_32 length
Definition: png.c:2247
Planner::settings
static planner_settings_t settings
Definition: planner.h:251
Joystick::calculate
static void calculate(xyz_float_t &norm_jog)
READ
#define READ(IO)
Definition: fastio.h:95
millis_t
uint32_t millis_t
Definition: millis_t.h:26
active_extruder
constexpr uint8_t active_extruder
Definition: motion.h:107
planner
Planner planner
Definition: planner.cpp:111