Skip to content

Commit

Permalink
Add PWM_OPEN_DRAIN option to pinMode()
Browse files Browse the repository at this point in the history
Allow for alternate function open drain output mode to be accessed
through the wirish interface. This allows for open drain to be used on
PWM pins.
  • Loading branch information
iperry committed Sep 22, 2010
1 parent f2fd216 commit 943006d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 1 deletion.
3 changes: 2 additions & 1 deletion wirish/io.h
Expand Up @@ -47,7 +47,8 @@ typedef enum WiringPinMode {
INPUT_PULLUP,
INPUT_PULLDOWN,
INPUT_FLOATING,
PWM
PWM,
PWM_OPEN_DRAIN,
} WiringPinMode;


Expand Down
3 changes: 3 additions & 0 deletions wirish/wirish_digital.c
Expand Up @@ -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;
Expand Down

0 comments on commit 943006d

Please sign in to comment.