MCPcopy Create free account
hub / github.com/FastLED/FastLED / pinMode

Function pinMode

src/platforms/arm/teensy/pin_teensy.hpp:39–63  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

37namespace platforms {
38
39inline void pinMode(int pin, fl::PinMode mode) FL_NOEXCEPT {
40 // Translate PinMode to Teensy core constants
41 // PinMode::Input=0, Output=1, InputPullup=2, InputPulldown=3
42 // Teensy: INPUT=0, OUTPUT=1, INPUT_PULLUP=2, INPUT_PULLDOWN (Teensy-specific)
43 int teensy_mode = INPUT; // Initialize to safe default
44 switch (mode) {
45 case fl::PinMode::Input:
46 teensy_mode = INPUT; // 0
47 break;
48 case fl::PinMode::Output:
49 teensy_mode = OUTPUT; // 1
50 break;
51 case fl::PinMode::InputPullup:
52 teensy_mode = INPUT_PULLUP; // 2
53 break;
54 case fl::PinMode::InputPulldown:
55#ifdef INPUT_PULLDOWN
56 teensy_mode = INPUT_PULLDOWN; // Teensy-specific
57#else
58 teensy_mode = INPUT_PULLUP; // Fallback to INPUT_PULLUP
59#endif
60 break;
61 }
62 ::pinMode(pin, teensy_mode);
63}
64
65inline void digitalWrite(int pin, fl::PinValue val) FL_NOEXCEPT {
66 ::digitalWrite(pin, static_cast<int>(val)); // PinValue::Low=0, High=1

Callers 12

setOutputMethod · 0.50
setInputMethod · 0.50
setOutputMethod · 0.50
setInputMethod · 0.50
setOutputMethod · 0.50
setInputMethod · 0.50
setOutputMethod · 0.50
setInputMethod · 0.50
setOutputMethod · 0.50
setInputMethod · 0.50
setOutputMethod · 0.50
setInputMethod · 0.50

Calls

no outgoing calls

Tested by

no test coverage detected