forked from grbl/grbl
-
Notifications
You must be signed in to change notification settings - Fork 14
/
stepper.h
61 lines (46 loc) · 1.77 KB
/
stepper.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
/*
stepper.c - stepper motor pulse generation
Processes block from the queue generated by the planer and pulses
steppers accordingly via a dynamically adapted timer interrupt.
Part of LasaurGrbl
Copyright (c) 2011 Stefan Hechenberger
Copyright (c) 2009-2011 Simen Svale Skogsrud
Copyright (c) 2011 Sungeun K. Jeon
Inspired by the 'RepRap cartesian firmware' by Zack Smith and
Philipp Tiefenbacher.
LasaurGrbl 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.
LasaurGrbl 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.
*/
#ifndef stepper_h
#define stepper_h
#include <avr/io.h>
#include <avr/sleep.h>
#include <stdbool.h>
// Initialize and start the stepper motor subsystem
void stepper_init();
// Block until all buffered steps are executed
void stepper_synchronize();
// Start stepper interrupt and execute the blocks in queue.
void stepper_wake_up();
// make the stepper subsystem fall asleep
void stepper_go_idle();
// stop (error) functions
void stepper_request_stop(uint8_t status);
uint8_t stepper_stop_status();
bool stepper_stop_requested();
void stepper_stop_resume();
// Get the actual position of the head in mm.
// This is as accurate as an open loop system can be.
double stepper_get_position_x();
double stepper_get_position_y();
double stepper_get_position_z();
void stepper_set_position(double x, double y, double z);
// perform the homing cycle
void stepper_homing_cycle();
#endif