-
Notifications
You must be signed in to change notification settings - Fork 0
/
GPIO.h
45 lines (34 loc) · 866 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
40
41
42
43
44
45
#ifndef GPIO_H
#define GPIO_H
#include "tm4c123gh6pm.h"
#include <stdint.h>
#include <stddef.h>
#include <stdbool.h>
#define PORTA 'A'
#define PORTB 'B'
#define PORTC 'C'
#define PORTD 'D'
#define PORTE 'E'
#define PORTF 'F'
#define PIN0 0
#define PIN1 1
#define PIN2 2
#define PIN3 3
#define PIN4 4
#define PIN5 5
#define PIN6 6
#define PIN7 7
#define DIGITAL 1
#define ANALOG 0
#define UP 1
#define DOWN 0
#define INPUT 0
#define OUTPUT 1
void GPIO_init(uint8_t port, uint32_t pin, uint32_t dtype, uint32_t io);
void GPIO_setPin(uint8_t port, uint32_t pin);
void GPIO_clearPin(uint8_t port, uint32_t pin);
void GPIO_togglePin(uint8_t port, uint32_t pin);
uint8_t GPIO_readPin(uint8_t port, uint32_t pin);
void GPIO_writePort(uint8_t port, uint32_t value);
uint32_t GPIO_readPort(uint8_t port);
#endif //GPIO_H