-
Notifications
You must be signed in to change notification settings - Fork 1k
/
Copy pathwiring_digital.h
65 lines (54 loc) · 1.92 KB
/
wiring_digital.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
62
63
64
65
/*
Copyright (c) 2011 Arduino. All right reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
This library 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 Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
*/
#ifndef _WIRING_DIGITAL_
#define _WIRING_DIGITAL_
#ifdef __cplusplus
extern "C" {
#endif
/**
* \brief Configures the specified pin to behave either as an input or an output.
*
* \param dwPin The number of the pin whose mode you wish to set
* \param dwMode Either INPUT, INPUT_PULLUP, INPUT_PULLDOWN or OUTPUT
*/
extern void pinMode(uint32_t dwPin, uint32_t dwMode) ;
/**
* \brief Write a HIGH or a LOW value to a digital pin.
*
* If the pin has been configured as an OUTPUT with pinMode(), its voltage will be set to the
* corresponding value: 3.3V for HIGH, 0V (ground) for LOW.
*
* \param dwPin the pin number
* \param dwVal HIGH or LOW
*/
extern void digitalWrite(uint32_t dwPin, uint32_t dwVal) ;
/**
* \brief Reads the value from a specified digital pin, either HIGH or LOW.
*
* \param ulPin The number of the digital pin you want to read (int)
*
* \return HIGH or LOW
*/
extern int digitalRead(uint32_t ulPin) ;
/**
* \brief Toggle the value from a specified digital pin.
*
* \param ulPin The number of the digital pin you want to toggle (int)
*/
extern void digitalToggle(uint32_t ulPin) ;
#ifdef __cplusplus
}
#endif
#endif /* _WIRING_DIGITAL_ */