-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDIO.h
More file actions
50 lines (33 loc) · 765 Bytes
/
DIO.h
File metadata and controls
50 lines (33 loc) · 765 Bytes
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
#ifndef _DIO_H
#define _DIO_H
// Port define
#include "STD_TYPES.h"
#define PORTA 0
#define PORTB 1
#define PORTC 2
#define PORTD 3
#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 HIGH 1
#define LOW 0
#define OUTPUT 1
#define INPUT 0
#define PORT_OUTPUT 0xff
#define PORT_INPUT 0x00
#define PORT_HIGH 0xff
#define PORT_LOW 0x00
#define OK 1
#define ERR 0
u8 DIO_u8_SET_PIN(u8 Port , u8 Pin , u8 Direction);
u8 DIO_u8_SET_PORT(u8 Port , u8 Direction);
u8 DIO_u8_WRITE_PIN(u8 Port , u8 Pin , u8 Value);
u8 DIO_u8_WRITE_PORT(u8 Port , u8 Value);
u8 DIO_u8_READ_PORT(u8 Port);
u8 DIO_u8_READ_PIN(u8 Port , u8 Pin);
#endif