Skip to content

Commit

Permalink
fix(PeriphDrivers): Update MAX32662 GPIO PAD configuration (#874)
Browse files Browse the repository at this point in the history
Signed-off-by: Furkan Akkiz <hasanfurkan.akkiz@analog.com>
  • Loading branch information
hfakkiz authored Jan 19, 2024
1 parent 9836e56 commit 96a56a8
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 21 deletions.
8 changes: 4 additions & 4 deletions Libraries/PeriphDrivers/Include/MAX32662/gpio.h
Original file line number Diff line number Diff line change
Expand Up @@ -139,10 +139,10 @@ typedef enum {
*/
typedef enum {
MXC_GPIO_PAD_NONE, /**< No pull-up or pull-down */
MXC_GPIO_PAD_PULL_UP, /**< Set pad to strong pull-up */
MXC_GPIO_PAD_PULL_DOWN, /**< Set pad to strong pull-down */
MXC_GPIO_PAD_WEAK_PULL_UP, /**< Set pad to weak pull-up */
MXC_GPIO_PAD_WEAK_PULL_DOWN, /**< Set pad to weak pull-down */
MXC_GPIO_PAD_PULL_UP, /**< Set pad to weak pull-up */
MXC_GPIO_PAD_PULL_DOWN, /**< Set pad to weak pull-down */
MXC_GPIO_PAD_WEAK_PULL_UP = MXC_GPIO_PAD_PULL_UP, /**< Set pad to weak pull-up */
MXC_GPIO_PAD_WEAK_PULL_DOWN = MXC_GPIO_PAD_PULL_DOWN, /**< Set pad to weak pull-down */
} mxc_gpio_pad_t;

/**
Expand Down
19 changes: 2 additions & 17 deletions Libraries/PeriphDrivers/Source/GPIO/gpio_me12.c
Original file line number Diff line number Diff line change
Expand Up @@ -87,31 +87,16 @@ int MXC_GPIO_Config(const mxc_gpio_cfg_t *cfg)
switch (cfg->pad) {
case MXC_GPIO_PAD_NONE:
gpio->padctrl0 &= ~cfg->mask;
gpio->padctrl1 &= ~cfg->mask;
break;

case MXC_GPIO_PAD_WEAK_PULL_UP:
gpio->padctrl0 |= cfg->mask;
gpio->padctrl1 &= ~cfg->mask;
gpio->ps &= ~cfg->mask;
break;

case MXC_GPIO_PAD_PULL_UP:
gpio->padctrl0 |= cfg->mask;
gpio->padctrl1 &= ~cfg->mask;
gpio->ps |= cfg->mask;
break;

case MXC_GPIO_PAD_WEAK_PULL_DOWN:
gpio->padctrl0 &= ~cfg->mask;
gpio->padctrl1 |= cfg->mask;
gpio->ps &= ~cfg->mask;
break;

case MXC_GPIO_PAD_PULL_DOWN:
gpio->padctrl0 &= ~cfg->mask;
gpio->padctrl1 |= cfg->mask;
gpio->ps |= cfg->mask;
gpio->padctrl0 |= cfg->mask;
gpio->ps &= ~cfg->mask;
break;

default:
Expand Down

0 comments on commit 96a56a8

Please sign in to comment.