Skip to content

Commit

Permalink
fixup! drivers: add PCF857X I/O expander driver
Browse files Browse the repository at this point in the history
  • Loading branch information
gschorcht committed Dec 4, 2021
1 parent 0b9b8c2 commit d02a87f
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions drivers/pcf857x/pcf857x.c
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,13 @@ int pcf857x_gpio_init(pcf857x_t *dev, gpio_t pin, gpio_mode_t mode)

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

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

0 comments on commit d02a87f

Please sign in to comment.