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