rp2040: Add initial support for the rp2040 mcu

Support the rp2040 (as tested on a Raspberry Pi Pico board).  This
adds basic uart, timer, gpio, and watchdog support.

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor
2021-06-19 21:43:26 -04:00
parent 20c5976356
commit 045bfa4e8d
11 changed files with 642 additions and 0 deletions

22
src/rp2040/gpio.h Normal file
View File

@@ -0,0 +1,22 @@
#ifndef __RP2040_GPIO_H
#define __RP2040_GPIO_H
#include <stdint.h> // uint32_t
struct gpio_out {
uint32_t bit;
};
struct gpio_out gpio_out_setup(uint8_t pin, uint8_t val);
void gpio_out_reset(struct gpio_out g, uint8_t val);
void gpio_out_toggle_noirq(struct gpio_out g);
void gpio_out_toggle(struct gpio_out g);
void gpio_out_write(struct gpio_out g, uint8_t val);
struct gpio_in {
uint32_t bit;
};
struct gpio_in gpio_in_setup(uint8_t pin, int8_t pull_up);
void gpio_in_reset(struct gpio_in g, int8_t pull_up);
uint8_t gpio_in_read(struct gpio_in g);
#endif // gpio.h