-
Notifications
You must be signed in to change notification settings - Fork 6
/
gpioInterface.h
60 lines (49 loc) · 1.25 KB
/
gpioInterface.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
#include <stdlib.h>
#include <stdio.h>
#define RASPBERRYPI 0
#define ARIETTAG25 1
#define CUSTOM 2
//============================================================================
// Description : SidBerry wrapper to GPIO ports - Header File
// Author : Alessio Lombardo
//============================================================================
#if BOARD == RASPBERRYPI //Raspberry Pi
#include <wiringPi.h>
#define CS 3
#define A0 8
#define A1 9
#define A2 7
#define A3 0
#define A4 2
#define D0 15
#define D1 16
#define D2 1
#define D3 4
#define D4 5
#define D5 6
#define D6 10
#define D7 11
#elif BOARD == ARIETTAG25 //Acme Systems Arietta G25
#include <wiringSam.h>
#define CS 65
#define A0 6
#define A1 92
#define A2 68
#define A3 67
#define A4 66
#define D0 8
#define D1 0
#define D2 29
#define D3 28
#define D4 27
#define D5 26
#define D6 25
#define D7 24
#elif BOARD == CUSTOM //Custom Board
//1) GPIO library (if needed)
//2) I/O Defines (if needed): INPUT mode, OUTPUT mode, HIGH level, LOW level
//3) Pinout Defines (mandatory): CS (Chip Select), A0-A4 (Address Bus), D0-D7 (Data Bus)
#endif
void gpioWrite(int pin, int level);
int gpioSetup();
void gpioMode(int pin, int mode);