Skip to content

Commit

Permalink
Merge pull request #4740 from cgundogan/pr/saul/pull_modes
Browse files Browse the repository at this point in the history
saul: make pull-up/pull-down mode configurable
  • Loading branch information
haukepetersen committed Feb 4, 2016
2 parents 6ace823 + b860ad3 commit 84b44f0
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions boards/iotlab-m3/include/gpio_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,16 +35,19 @@ static const saul_gpio_params_t saul_gpio_params[] =
.name = "LED(red)",
.pin = LED_RED_GPIO,
.dir = GPIO_DIR_OUT,
.pull = GPIO_NOPULL,
},
{
.name = "LED(green)",
.pin = LED_GREEN_GPIO,
.dir = GPIO_DIR_OUT,
.pull = GPIO_NOPULL,
},
{
.name = "LED(orange)",
.pin = LED_ORANGE_GPIO,
.dir = GPIO_DIR_OUT,
.pull = GPIO_NOPULL,
},
};

Expand Down
1 change: 1 addition & 0 deletions boards/samr21-xpro/include/gpio_params.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ static const saul_gpio_params_t saul_gpio_params[] =
.name = "LED(orange)",
.pin = LED_GPIO,
.dir = GPIO_DIR_OUT,
.pull = GPIO_NOPULL,
},
};

Expand Down
1 change: 1 addition & 0 deletions drivers/include/saul/periph.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ typedef struct {
const char *name; /**< name of the device connected to this pin */
gpio_t pin; /**< GPIO pin to initialize and expose */
gpio_dir_t dir; /**< use GPIO as input or output */
gpio_pp_t pull; /**< define the pull-up/pull-down mode */
} saul_gpio_params_t;

#ifdef __cplusplus
Expand Down
2 changes: 1 addition & 1 deletion sys/auto_init/saul/auto_init_gpio.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ void auto_init_gpio(void)
saul_reg_entries[i].name = p->name;
saul_reg_entries[i].driver = &gpio_saul_driver;
/* initialize the GPIO pin */
gpio_init(p->pin, p->dir, GPIO_NOPULL);
gpio_init(p->pin, p->dir, p->pull);
/* add to registry */
saul_reg_add(&(saul_reg_entries[i]));
}
Expand Down

0 comments on commit 84b44f0

Please sign in to comment.