Finializing tests
[solderbot.git] / src / core / digital.h
blob0435a2e9c8ea4e219bdf8ba5abb981d8987ecee4
1 /*
2 Copyright 2008 Lukas Kropatschek lukas.krop@gmail.com
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU General Public License as
6 published by the Free Software Foundation; either version 2 of
7 the License, or (at your option) any later version.
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 GNU General Public License for more details.
14 You should have received a copy of the GNU General Public License
15 along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #ifndef DIGITALIO_H
19 #define DIGITALIO_H
21 #include "defines.h"
23 /**
24 * \brief Returns the appropriate port to a pin
25 * \param pin the pin
26 * \return The appropriate port to the pin
28 byte getPortFromPin(byte pin);
29 /**
30 * \brief Set the mode of a pin to input or output
31 * \param pin the pin
32 * \param mode the mode, could be INPUT or OUTPUT.
34 void pinMode(byte pin, byte mode);
36 /**
37 * \brief Sets the status of a pin to HIGH or LOW
38 * \param pin the pin
39 * \param mode the mode, could be HIGH or LOW
41 void setPin(byte pin, byte mode);
43 /**
44 * \brief Returns the current status of a digital pin
45 * \param pin the pin
46 * \return the status of the pin, could be HIGH or LOW
48 byte getPinSt(byte pin);
50 byte getPinTimer(byte pin);
52 inline void turnOffPWM(byte timer);
54 #endif