yarf 0.1
Yet Another RepRap Firmware
src/hardware/io.c
Go to the documentation of this file.
00001 /*
00002  * io.c
00003  *
00004  * Copyright 2011 Pieter Agten
00005  *
00006  * This file is part of Yarf.
00007  *
00008  * Yarf is free software: you can redistribute it and/or modify
00009  * it under the terms of the GNU General Public License as published by
00010  * the Free Software Foundation, either version 3 of the License, or
00011  * (at your option) any later version.
00012  *
00013  * Yarf is distributed in the hope that it will be useful,
00014  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  * GNU General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU General Public License
00019  * along with Yarf.  If not, see <http://www.gnu.org/licenses/>.
00020  */
00021 
00029 #include "io.h"
00030 
00031 #include "yarf.h"
00032 #include "fastio.h"
00033 #include "steppers.h"
00034 
00035 void
00036 io_init(void)
00037 {
00038   SET_OUTPUT(X_ENABLE_PIN);
00039   SET_OUTPUT(X_STEP_PIN);
00040   SET_OUTPUT(X_DIR_PIN);
00041 
00042   SET_OUTPUT(Y_ENABLE_PIN);
00043   SET_OUTPUT(Y_STEP_PIN);
00044   SET_OUTPUT(Y_DIR_PIN);
00045 
00046   SET_OUTPUT(Z_ENABLE_PIN);
00047   SET_OUTPUT(Z_STEP_PIN);
00048   SET_OUTPUT(Z_DIR_PIN);
00049 
00050   SET_OUTPUT(E_ENABLE_PIN);
00051   SET_OUTPUT(E_STEP_PIN);
00052   SET_OUTPUT(E_DIR_PIN);
00053 
00054   SET_INPUT(X_MIN_PIN);
00055   SET_INPUT(Y_MIN_PIN);
00056   SET_INPUT(Z_MIN_PIN);
00057 
00058 #if X_MAX_PIN >= 0
00059   SET_INPUT(X_MAX_PIN);
00060 #endif
00061 #if Y_MAX_PIN >= 0
00062   SET_INPUT(Y_MAX_PIN);
00063 #endif
00064 #if Z_MAX_PIN >= 0
00065   SET_INPUT(Z_MAX_PIN);
00066 #endif
00067 
00068   SET_OUTPUT(HEAT1_PIN);
00069   SET_OUTPUT(HEAT2_PIN);
00070 
00071   /* Disable all stepper motors */
00072   steppers_disable();
00073 }
00074 
00075 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Defines