refactoring
This commit is contained in:
26
gpio_common.c
Normal file
26
gpio_common.c
Normal file
@@ -0,0 +1,26 @@
|
||||
#include "gpio_common.h"
|
||||
|
||||
#include <pico/stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
|
||||
void gpio_init_out(uint gpio) {
|
||||
gpio_set_dir(gpio, GPIO_OUT);
|
||||
gpio_put(gpio, 0);
|
||||
gpio_set_function(gpio, GPIO_FUNC_SIO);
|
||||
}
|
||||
|
||||
|
||||
void gpio_init_input(uint gpio) {
|
||||
gpio_set_dir(gpio, GPIO_IN);
|
||||
gpio_pull_up(gpio);
|
||||
gpio_set_function(gpio, GPIO_FUNC_SIO);
|
||||
}
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
Reference in New Issue
Block a user