|  | WE310F5
    39.00.000
    | 
GPIO library implementation. More...
Go to the source code of this file.
| Data Structures | |
| struct | M2MB_GPIO_CFG_T | 
| Macros | |
| #define | NULL 0 | 
| Typedefs | |
| typedef VOID(* | M2MB_GPIOINT_CB_T) (UINT32 id, UINT32 event) | 
| GPIO interrupt callback function definition.  More... | |
| typedef UINT32 | M2MB_GPIO_PIN_E | 
| typedef VOID * | M2MB_GPIOINT_CALLBACK_DATA_T | 
| Functions | |
| INT32 | m2mb_gpio_open (const CHAR *path, INT32 flags,...) | 
| open a GPIO device arguments: path: /dev/GPIO# where # is in decimal format flags currently unused return: file descriptor on SUCCESS -1 on FAILURE i.e.: fd = m2mb_gpio_open( "/dev/GPIO7", 0 );  More... | |
| INT32 | m2mb_gpio_close (INT32 fd) | 
| close a GPIO device  More... | |
| INT32 | m2mb_gpio_ioctl (INT32 fd, M2MB_GPIO_IOCTL_REQUEST_E cmd, void *arg) | 
| configure a GPIO device  More... | |
| INT32 | m2mb_gpio_multi_ioctl (INT32 fd, UINT8 nCmds,...) | 
| : allow a multiple configuration of a GPIO device. Can not be used in order to get data.  More... | |
GPIO library implementation.
m2m/m2m_generic/common/m2mb_inc/m2mb_gpio.h
The following functions are implemented: m2mb_gpio_ioctl m2mb_gpio_open m2mb_gpio_read m2mb_gpio_write m2mb_gpio_close
Dependencies: m2m/m2m_generic/common/m2mb_inc/m2mb_types.h
Keshava Kumar B
Definition in file m2mb_gpio.h.
| #define NULL 0 | 
Definition at line 38 of file m2mb_gpio.h.
| typedef UINT32 M2MB_GPIO_PIN_E | 
Definition at line 178 of file m2mb_gpio.h.
| typedef VOID* M2MB_GPIOINT_CALLBACK_DATA_T | 
Definition at line 180 of file m2mb_gpio.h.
GPIO interrupt callback function definition.
GPIO interrupt clients will pass a function pointer of this format in M2MB_GPIO_CFG_T callback function
Definition at line 176 of file m2mb_gpio.h.
| enum M2M_GPIO_INTR_TYPE_E | 
GPIO ISR type: callback or counter.
| Enumerator | |
|---|---|
| INTR_CB_SET | Interrupt set with a callback function. | 
| INTR_COUNTER_SET | Interrupt set a counter for interrupt and no callback | 
Definition at line 159 of file m2mb_gpio.h.
| enum M2MB_GPIO_DEBOUNCE_E | 
enum used for gpio interrupt debounce
| Enumerator | |
|---|---|
| M2MB_GPIO_INT_DEBOUNCE_DISABLE | Disable interrupt debounce | 
| M2MB_GPIO_INT_DEBOUNCE_ENABLE | Enable interrupt debounce | 
Definition at line 108 of file m2mb_gpio.h.
enum used for gpio direction
| Enumerator | |
|---|---|
| M2MB_GPIO_MODE_INPUT | GPIO mode : input | 
| M2MB_GPIO_MODE_OUTPUT | GPIO mode : output | 
Definition at line 74 of file m2mb_gpio.h.
| enum M2MB_GPIO_DRIVE_E | 
GPIO pin drive strength.
This enumeration specifies the drive strength to use when specifying the configuration of a GPIO pin.
| Enumerator | |
|---|---|
| M2MB_GPIO_LOW_DRIVE | Specify a low drive. | 
| M2MB_GPIO_MEDIUM_DRIVE | Specify a medium drive. | 
| M2MB_GPIO_HIGH_DRIVE | Specify a high drive. | 
Definition at line 134 of file m2mb_gpio.h.
Definition at line 45 of file m2mb_gpio.h.
| enum M2MB_GPIO_POLARITY_E | 
enum used for gpio Interrupt Polarity
| Enumerator | |
|---|---|
| M2MB_GPIO_INTR_POL_LOW | Setting interrupt to low active: falling edge or low level | 
| M2MB_GPIO_INTR_POL_HIGH | Setting interrupt to high active: rising edge or high level | 
Definition at line 97 of file m2mb_gpio.h.
enum used for gpio Pull
| Enumerator | |
|---|---|
| M2MB_GPIO_NO_PULL | Specify no pull | 
| M2MB_GPIO_PULL_DOWN | Gpio pull down | 
| M2MB_GPIO_PULL_UP | Gpio pull up | 
| M2MB_GPIO_PULL_KEEPER | Keep the GPIO as it is | 
Definition at line 119 of file m2mb_gpio.h.
| enum M2MB_GPIO_TRIGGER_E | 
enum used for gpio Interrupt trigger
Definition at line 85 of file m2mb_gpio.h.
| enum M2MB_GPIO_VALUE_E | 
GPIO output state specification.
| Enumerator | |
|---|---|
| M2MB_GPIO_LOW_VALUE | Drive the output LOW. | 
| M2MB_GPIO_HIGH_VALUE | Drive the output HIGH. | 
Definition at line 147 of file m2mb_gpio.h.
close a GPIO device
m2mb_gpio_close:
| fd | file descriptor returned by m2mb_gpio_open | 
| INT32 m2mb_gpio_ioctl | ( | INT32 | fd, | 
| M2MB_GPIO_IOCTL_REQUEST_E | cmd, | ||
| void * | arg | ||
| ) | 
configure a GPIO device
m2mb_gpio_ioctl:
| fd | file descriptor returned by m2mb_gpio_open | 
| cmd | required operation (see M2MB_GPIO_IOCTL_REQUEST_E) | 
| arg | pointer to the value to set | 
: allow a multiple configuration of a GPIO device. Can not be used in order to get data.
m2mb_gpio_multi_ioctl:
| fd | file descriptor returned by m2mb_gpio_open | 
| nCmds | number of commands to be issued at once | 
| ... | variable inputs, N cmds (see M2MB_GPIO_IOCTL_REQUEST_E) followed by N arguments for their respective issued commands. CMDS(...) and CMDS_ARGS(...) macro can be used to better insert cmd and parameters and to better control right insertion | 
In order to use interrupts it is mandatory to initialize the interrupt with M2MB_GPIO_IOCTL_INIT_INTR