Skip to content

Commit d02a87f

Browse files
committed
fixup! drivers: add PCF857X I/O expander driver
1 parent 0b9b8c2 commit d02a87f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

drivers/pcf857x/pcf857x.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,13 @@ int pcf857x_gpio_init(pcf857x_t *dev, gpio_t pin, gpio_mode_t mode)
153153

154154
DEBUG_DEV("pin=%u mode=%u", dev, pin, mode);
155155

156+
/*
157+
* Since the LOW output is the only actively driven level possible with
158+
* this expander, only in the case of GPIO_OUT we write a 0 to the pin
159+
* to configure the pin as an output and actively drive it LOW. In all
160+
* other modes, the pin is configured as an input and pulled-up to HIGH
161+
* with the weak pull-up to emulate them.
162+
*/
156163
switch (mode) {
157164
case GPIO_IN_PD: DEBUG_DEV("gpio mode GPIO_IN_PD not supported", dev, mode);
158165
return -PCF857X_ERROR_INV_MODE;

0 commit comments

Comments
 (0)