Michael Spencer / Smoothie

Dependencies:   mbed

Fork of Smoothie by Stéphane Cachat

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers nuts_bolts.h Source File

nuts_bolts.h

00001 /*
00002 nuts_bolts.h - cartesian robot controller.
00003 Part of Grbl
00004 
00005 Copyright (c) 2009-2011 Simen Svale Skogsrud
00006 
00007 Grbl is free software: you can redistribute it and/or modify
00008 it under the terms of the GNU General Public License as published by
00009 the Free Software Foundation, either version 3 of the License, or
00010 (at your option) any later version.
00011 
00012 Grbl is distributed in the hope that it will be useful,
00013 but WITHOUT ANY WARRANTY; without even the implied warranty of
00014 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
00015 GNU General Public License for more details.
00016 
00017 You should have received a copy of the GNU General Public License
00018 along with Grbl. If not, see <http://www.gnu.org/licenses/>.
00019 */
00020 
00021 #ifndef nuts_bolts_h
00022 #define nuts_bolts_h
00023 
00024 #include <string>
00025 using std::string;
00026 
00027 #define X_AXIS 0
00028 #define Y_AXIS 1
00029 #define Z_AXIS 2
00030 
00031 #define ALPHA_STEPPER 0
00032 #define BETA_STEPPER 1
00033 #define GAMMA_STEPPER 2
00034 
00035 #define clear_vector(a) memset(a, 0, sizeof(a))
00036 #define clear_vector_float(a) memset(a, 0.0F, sizeof(a))
00037 
00038 #define confine(value, min, max) (((value) < (min))?(min):(((value) > (max))?(max):(value)))
00039 
00040 #define dd(...) LPC_GPIO2->FIODIR = 0xffff; LPC_GPIO2->FIOCLR = 0xffff; LPC_GPIO2->FIOSET = __VA_ARGS__
00041 
00042 
00043 #endif
00044