-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathgpio.h
65 lines (56 loc) · 1.28 KB
/
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#ifndef GPIO_H_
#define GPIO_H_
#ifndef ADI_GPIO_H
#include <drivers/gpio/adi_gpio.h>
#endif
typedef struct {
ADI_GPIO_PORT port;
ADI_GPIO_DATA pin;
} pinMap;
typedef enum {
INPUT,
OUTPUT,
INPUT_PULLUP
} mode;
typedef enum {
FALLING = false,
RISING = true
} Imode;
typedef enum {
HIGH = 1,
LOW = 0
} logicLevel;
extern uint8_t gpioMemory[ADI_GPIO_MEMORY_SIZE];
extern pinMap SCL;
extern pinMap SDA;
extern pinMap SCLK;
extern pinMap MISO;
extern pinMap MOSI;
extern pinMap CS;
extern pinMap RDY;
extern pinMap IO28;
extern pinMap IO08;
extern pinMap IO27;
extern pinMap IO33;
extern pinMap IO09;
extern pinMap IO13;
extern pinMap IO15;
extern pinMap TX;
extern pinMap RX;
extern pinMap AIN0;
extern pinMap AIN1;
extern pinMap AIN2;
extern pinMap AIN3;
extern pinMap AIN4;
extern pinMap AIN5;
extern pinMap IO16;
extern pinMap IO12;
extern pinMap DS4;
extern pinMap DS3;
ADI_GPIO_RESULT gpioSetup();
ADI_GPIO_RESULT pinMode(pinMap pm, mode m);
ADI_GPIO_RESULT digitalWrite(pinMap pm, logicLevel b);
logicLevel digitalRead(pinMap pm);
ADI_GPIO_RESULT attachInterrupt(pinMap pm, ADI_CALLBACK const cb, Imode im, ADI_GPIO_IRQ gp);
ADI_GPIO_RESULT setupInterrupt(pinMap pm, ADI_CALLBACK const cb, Imode im, ADI_GPIO_IRQ gp);
#endif