diff options
| author | guozhanxin <[email protected]> | 2021-01-28 22:09:28 +0800 |
|---|---|---|
| committer | guozhanxin <[email protected]> | 2021-01-28 22:17:05 +0800 |
| commit | 76331797cd18f05800ead01433b27e6f554bbb94 (patch) | |
| tree | c38465926ef6111c25a7249bee0d8e97edd11a15 /bsp/raspberry-pico/applications | |
| parent | e3604553c7431b0fe7a64c5a10781d0589a8ee58 (diff) | |
[bsp][raspberry-pico]add gpio drivers
Diffstat (limited to 'bsp/raspberry-pico/applications')
| -rw-r--r-- | bsp/raspberry-pico/applications/main.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/bsp/raspberry-pico/applications/main.c b/bsp/raspberry-pico/applications/main.c index f1792ed836..a2d0aac153 100644 --- a/bsp/raspberry-pico/applications/main.c +++ b/bsp/raspberry-pico/applications/main.c @@ -5,20 +5,21 @@ */ #include <rtthread.h> +#include <rtdevice.h> -#include "board.h" - -int main() { - const uint LED_PIN = 25; +#define LED_PIN 25 +int main(void) +{ rt_kprintf("Hello, RT-Thread!\n"); - gpio_init(LED_PIN); - gpio_set_dir(LED_PIN, GPIO_OUT); - while (true) { - gpio_put(LED_PIN, 1); + rt_pin_mode(LED_PIN, PIN_MODE_OUTPUT); + + while (1) + { + rt_pin_write(LED_PIN, 1); rt_thread_mdelay(1000); - gpio_put(LED_PIN, 0); + rt_pin_write(LED_PIN, 0); rt_thread_mdelay(1000); } } |
