diff options
-rw-r--r-- | wirish/io.h | 3 | ||||
-rw-r--r-- | wirish/wirish_digital.c | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/wirish/io.h b/wirish/io.h index e779604..4aa1eef 100644 --- a/wirish/io.h +++ b/wirish/io.h @@ -47,7 +47,8 @@ typedef enum WiringPinMode { INPUT_PULLUP, INPUT_PULLDOWN, INPUT_FLOATING, - PWM + PWM, + PWM_OPEN_DRAIN, } WiringPinMode; diff --git a/wirish/wirish_digital.c b/wirish/wirish_digital.c index c93c786..9dd46ed 100644 --- a/wirish/wirish_digital.c +++ b/wirish/wirish_digital.c @@ -58,6 +58,9 @@ void pinMode(uint8 pin, WiringPinMode mode) { case PWM: outputMode = GPIO_MODE_AF_OUTPUT_PP; break; + case PWM_OPEN_DRAIN: + outputMode = GPIO_MODE_AF_OUTPUT_OD; + break; default: ASSERT(0); return; |