-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathgpio.h
27 lines (22 loc) · 787 Bytes
/
gpio.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef GPIO_H
#define GPIO_H
#include <stdint.h>
#define MMIO_BASE 0x20000000U
#define GPIO_BASE (MMIO_BASE + 0x200000)
#define GPIO_GPFSEL (GPIO_BASE+0x00)
#define GPIO_GPSET (GPIO_BASE+0x1C)
#define GPIO_GPCLR (GPIO_BASE+0x28)
#define GPIO_GPLEV (GPIO_BASE+0x34)
#define GPIO_GPEDS (GPIO_BASE+0x40)
#define GPIO_GPREN (GPIO_BASE+0x4C)
#define GPIO_GPFEN (GPIO_BASE+0x58)
#define GPIO_GPHEN (GPIO_BASE+0x64)
#define GPIO_GPLEN (GPIO_BASE+0x70)
#define GPIO_GPAREN (GPIO_BASE+0x7C)
#define GPIO_GPAFEN (GPIO_BASE+0x88)
#define GPIO_GPPUD (GPIO_BASE+0x94)
#define GPIO_GPPUDCLK (GPIO_BASE+0x98)
void gpio_func_sel(int gpio_pin, int gpio_func);
void gpio_output(int gpio_pin, int value);
void gpio_enable_jtag();
#endif