YAHAL
Yet Another Hardware Abstraction Library
Loading...
Searching...
No Matches
src
platform
BBB
gpio_module
gpio_bbb_if.h
1
#ifndef _GPIO_BBB_IF_H_
2
#define _GPIO_BBB_IF_H_
3
4
#include <linux/ioctl.h>
5
6
/*
7
* The name of the device file
8
*/
9
#define GPIO_DEV_NAME "gpio_bbb"
10
11
/*
12
* Number of available GPIOs
13
*/
14
#define GPIO_COUNT 128
15
16
/*
17
* Definition of GPIO mode flags.
18
* Should be compatible with gpio_interface.h
19
*/
20
#define GPIO_INPUT 0x0001
21
#define GPIO_OUTPUT 0x0002
22
#define GPIO_OUTPUT_OPEN_DRAIN 0x0004
23
#define GPIO_OUTPUT_OPEN_SOURCE 0x0008
24
#define GPIO_PULLUP 0x0010
25
#define GPIO_PULLDOWN 0x0020
26
#define GPIO_SLOW 0x0040
27
#define GPIO_FAST 0x0080
28
#define GPIO_INIT_HIGH 0x0100
29
#define GPIO_INIT_LOW 0x0200
30
#define GPIO_REQUESTED 0x8000
31
32
/*
33
* Definition of IRQ trigger flags.
34
* Should be compatible with gpio_interface.h
35
*/
36
#define GPIO_RISING 0x0001
37
#define GPIO_FALLING 0x0002
38
#define GPIO_LEVEL_HIGH 0x0004
39
#define GPIO_LEVEL_LOW 0x0008
40
41
/*
42
* Macro to support coding of data into the
43
* IOCTL parameter: Lower 8 bits are GPIO
44
* number (0...127), higher bits are data.
45
*/
46
#define GPIO_DATA(gpio, data) (((data) << 8) | (gpio))
47
48
/*
49
* The major IOCTL 'magic' number.
50
*/
51
#define MAJOR_NUM 100
52
53
#define IOCTL_GPIO_MODE _IOW(MAJOR_NUM, 0, unsigned long)
54
#define IOCTL_GPIO_READ _IOW(MAJOR_NUM, 1, unsigned long)
55
#define IOCTL_GPIO_WRITE _IOW(MAJOR_NUM, 2, unsigned long)
56
#define IOCTL_GPIO_TOGGLE _IOW(MAJOR_NUM, 3, unsigned long)
57
#define IOCTL_GPIO_ATTACH_IRQ _IOW(MAJOR_NUM, 4, unsigned long)
58
#define IOCTL_GPIO_DETACH_IRQ _IOW(MAJOR_NUM, 5, unsigned long)
59
#define IOCTL_GPIO_ENABLE_IRQ _IOW(MAJOR_NUM, 6, unsigned long)
60
#define IOCTL_GPIO_DISABLE_IRQ _IOW(MAJOR_NUM, 7, unsigned long)
61
#define IOCTL_SET_DEBOUNCE _IOW(MAJOR_NUM, 8, unsigned long)
62
63
#endif
Generated by
1.12.0