forked from johankre/3_ppi
-
Notifications
You must be signed in to change notification settings - Fork 0
/
gpio.h
40 lines (34 loc) · 939 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
28
29
30
31
32
33
34
35
36
37
38
39
#ifndef GPIO_H
#define GPIO_H
#include <stdint.h>
#define GPIO0 ((NRF_GPIO_REGS0*)0x50000000) //gpio 0 base adress
#define GPIO1 ((NRF_GPIO_REGS1*)0x50000300) //gpio 1 base adress
typedef struct {
volatile uint32_t RESERVED0[321];
volatile uint32_t OUT;
volatile uint32_t OUTSET;
volatile uint32_t OUTCLR;
volatile uint32_t IN;
volatile uint32_t DIR;
volatile uint32_t DIRSET;
volatile uint32_t DIRCLR;
volatile uint32_t LATCH;
volatile uint32_t DETECTMODE;
volatile uint32_t RESERVED1[118];
volatile uint32_t PIN_CNF[32];
} NRF_GPIO_REGS0;
typedef struct {
volatile uint32_t RESERVED0[321];
volatile uint32_t OUT;
volatile uint32_t OUTSET;
volatile uint32_t OUTCLR;
volatile uint32_t IN;
volatile uint32_t DIR;
volatile uint32_t DIRSET;
volatile uint32_t DIRCLR;
volatile uint32_t LATCH;
volatile uint32_t DETECTMODE;
volatile uint32_t RESERVED1[118];
volatile uint32_t PIN_CNF[10];
} NRF_GPIO_REGS1;
#endif