Datasheet

Table Of Contents
34
35 static const char *gpio_irq_str[] = {
36 "LEVEL_LOW", // 0x1
37 "LEVEL_HIGH", // 0x2
38 "EDGE_FALL", // 0x4
39 "EDGE_RISE" // 0x8
40 };
41
42 void gpio_event_string(char *buf, uint32_t events) {
43 for (uint i = 0; i < 4; i++) {
44 uint mask = (1 << i);
45 if (events & mask) {
46 // Copy this event string into the user string
47 const char *event_str = gpio_irq_str[i];
48 while (*event_str != '\0') {
49 *buf++ = *event_str++;
50 }
51 events &= ~mask;
52
53 // If more events add ", "
54 if (events) {
55 *buf++ = ',';
56 *buf++ = ' ';
57 }
58 }
59 }
60 *buf++ = '\0';
61 }
2.18.6. Registers
2.18.6.1. IO - User Bank
Table 278. List of
IO_BANK0 registers
Offset Name Info
0x000 GPIO0_STATUS GPIO status
0x004 GPIO0_CTRL GPIO control including function select and overrides.
0x008 GPIO1_STATUS GPIO status
0x00c GPIO1_CTRL GPIO control including function select and overrides.
0x010 GPIO2_STATUS GPIO status
0x014 GPIO2_CTRL GPIO control including function select and overrides.
0x018 GPIO3_STATUS GPIO status
0x01c GPIO3_CTRL GPIO control including function select and overrides.
0x020 GPIO4_STATUS GPIO status
0x024 GPIO4_CTRL GPIO control including function select and overrides.
0x028 GPIO5_STATUS GPIO status
0x02c GPIO5_CTRL GPIO control including function select and overrides.
0x030 GPIO6_STATUS GPIO status
0x034 GPIO6_CTRL GPIO control including function select and overrides.
RP2040 Datasheet
2.18. GPIO 215