ircut.h
1.2 KB
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
66
#ifndef IRCUT_H
#define IRCUT_H
#ifdef __cplusplus
extern "C" {
#endif
#include <stdio.h>
#include <unistd.h>
#include <sys/mman.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <fcntl.h>
#define PIO_BASE_ADDRESS 0x01C20800
//unsigned int 4�ֽ� һ��PIO_Structռ36�ֽ�,��Ӧʮ�����ƾ���0x24��������һ��offsetֵ��
typedef struct
{
unsigned int CFG[4];
unsigned int DAT;
unsigned int DRV0;
unsigned int DRV1;
unsigned int PUL0;
unsigned int PUL1;
} PIO_Struct;
typedef struct
{
PIO_Struct Pn[7];
} PIO_Map;
typedef enum {
PA = 0,
PB = 1,
PC = 2,
PD = 3,
PE = 4,
PF = 5,
PG = 6,
} PORT;
typedef enum {
IN = 0x00,
OUT = 0x01,
AUX = 0x02,
INT = 0x06,
DISABLE = 0x07,
} PIN_MODE;
extern PIO_Map *PIO;
void GPIO_Init(void);
void GPIO_ConfigPin(PORT port, unsigned int pin, PIN_MODE mode);
void GPIO_SetPin(PORT port, unsigned int pin, unsigned int level);
unsigned int GPIO_GetPin(PORT port, unsigned int pin);
int GPIO_Free(void);
void set_amplifier(int amplifier_mode);//���ſ��� 0�ر� 1��
void init_amplifier(void);//������ʼ��
#ifdef __cplusplus
}
#endif
#endif //IRCUT_H