|
43 | 43 | #include "adc.h"
|
44 | 44 |
|
45 | 45 | #include "wiring_time.h"
|
46 |
| - |
47 |
| -/** |
48 |
| - * Specifies a GPIO pin behavior. |
49 |
| - * @see pinMode() |
50 |
| - */ |
51 |
| -typedef enum WiringPinMode { |
52 |
| - INPUT, /**< Basic digital input. The pin voltage is sampled; when |
53 |
| - it is closer to 3.3v (Vcc) the pin status is high, and |
54 |
| - when it is closer to 0v (ground) it is low. If no |
55 |
| - external circuit is pulling the pin voltage to high or |
56 |
| - low, it will tend to randomly oscillate and be very |
57 |
| - sensitive to noise (e.g., a breath of air across the pin |
58 |
| - might cause the state to flip). */ |
59 |
| - |
60 |
| - OUTPUT, /**< Basic digital output: when the pin is HIGH, the |
61 |
| - voltage is held at +3.3v (Vcc) and when it is LOW, it |
62 |
| - is pulled down to ground. */ |
63 |
| - |
64 |
| - OUTPUT_OPENDRAIN, /**< In open drain mode, the pin indicates |
65 |
| - "low" by accepting current flow to ground |
66 |
| - and "high" by providing increased |
67 |
| - impedance. An example use would be to |
68 |
| - connect a pin to a bus line (which is pulled |
69 |
| - up to a positive voltage by a separate |
70 |
| - supply through a large resistor). When the |
71 |
| - pin is high, not much current flows through |
72 |
| - to ground and the line stays at positive |
73 |
| - voltage; when the pin is low, the bus |
74 |
| - "drains" to ground with a small amount of |
75 |
| - current constantly flowing through the large |
76 |
| - resistor from the external supply. In this |
77 |
| - mode, no current is ever actually sourced |
78 |
| - from the pin. */ |
79 |
| - |
80 |
| - |
81 |
| - |
82 |
| - INPUT_PULLUP, /**< The state of the pin in this mode is reported |
83 |
| - the same way as with INPUT, but the pin voltage |
84 |
| - is gently "pulled up" towards +3.3v. This means |
85 |
| - the state will be high unless an external device |
86 |
| - is specifically pulling the pin down to ground, |
87 |
| - in which case the "gentle" pull-up will not |
88 |
| - affect the state of the input. */ |
89 |
| - |
90 |
| - INPUT_PULLDOWN, /**< The state of the pin in this mode is reported |
91 |
| - the same way as with INPUT, but the pin voltage |
92 |
| - is gently "pulled down" towards 0v. This means |
93 |
| - the state will be low unless an external device |
94 |
| - is specifically pulling the pin up to 3.3v, in |
95 |
| - which case the "gentle" pull-down will not |
96 |
| - affect the state of the input. */ |
97 |
| - |
98 |
| - INPUT_FLOAT, /**< Synonym for INPUT. */ |
99 |
| - |
100 |
| - OUTPUT_DAC, /**< This is a special mode for when the pin will be used for |
101 |
| - PWM output (a special case of digital output). */ |
102 |
| -} WiringPinMode; |
| 46 | +#include "wiring_constants.h" |
103 | 47 |
|
104 | 48 | /**
|
105 | 49 | * Configure behavior of a GPIO pin.
|
106 | 50 | *
|
107 | 51 | * @param pin Number of pin to configure.
|
108 | 52 | * @param mode Mode corresponding to desired pin behavior.
|
109 |
| - * @see WiringPinMode |
| 53 | + * @see PinMode |
110 | 54 | */
|
111 |
| -void pinMode(uint8 pin, WiringPinMode mode); |
| 55 | +void pinMode(uint8 pin, uint8 mode); |
112 | 56 |
|
113 | 57 | /**
|
114 | 58 | * Writes a (digital) value to a pin. The pin must have its
|
|
0 commit comments