Provides APIs for GPIO (General Purpose Input/Output)
More...
|
| iotbus_gpio_context_h | iotbus_gpio_open (int gpiopin) |
| | initializes gpio_context based on gpio pin. More...
|
| |
| int | iotbus_gpio_close (iotbus_gpio_context_h dev) |
| | closes the gpio_context. More...
|
| |
| int | iotbus_gpio_set_direction (iotbus_gpio_context_h dev, iotbus_gpio_direction_e dir) |
| | sets gpio direction. More...
|
| |
| int | iotbus_gpio_set_edge_mode (iotbus_gpio_context_h dev, iotbus_gpio_edge_e edge) |
| | sets the edge mode on the gpio. More...
|
| |
| int | iotbus_gpio_set_drive_mode (iotbus_gpio_context_h dev, iotbus_gpio_drive_e drive) |
| | sets gpio output mode. More...
|
| |
| int | iotbus_gpio_register_cb (iotbus_gpio_context_h dev, iotbus_gpio_edge_e edge, gpio_isr_cb isr_cb, void *user_data) |
| | registers event handler callback for interrupt. More...
|
| |
| int | iotbus_gpio_unregister_cb (iotbus_gpio_context_h dev) |
| | unregisters event handler callback for interrupt. More...
|
| |
| int | iotbus_gpio_read (iotbus_gpio_context_h dev) |
| | reads the gpio value. More...
|
| |
| int | iotbus_gpio_write (iotbus_gpio_context_h dev, int value) |
| | writes to the gpio value. More...
|
| |
| int | iotbus_gpio_get_direction (iotbus_gpio_context_h dev, iotbus_gpio_direction_e *dir) |
| | gets a direction of the gpio. More...
|
| |
| int | iotbus_gpio_get_pin (iotbus_gpio_context_h dev) |
| | gets a pin number of the gpio. More...
|
| |
| int | iotbus_gpio_get_edge_mode (iotbus_gpio_context_h dev, iotbus_gpio_edge_e *edge) |
| | gets a edge mode of the gpio. More...
|
| |
| int | iotbus_gpio_get_drive_mode (iotbus_gpio_context_h dev, iotbus_gpio_drive_e *drive) |
| | gets a drive mode of the gpio. More...
|
| |
Provides APIs for GPIO (General Purpose Input/Output)
Pointer definition to the internal struct iotbus_gpio_s.
Definition at line 85 of file iotbus_gpio.h.
Enumeration of Gpio direction options.
Enumeration Details:
IOTBUS_GPIO_DIRECTION_NONE = 0, No set any state
IOTBUS_GPIO_DIRECTION_OUT = 1, Output Direction
IOTBUS_GPIO_DIRECTION_IN = 2, Input Direction
Definition at line 59 of file iotbus_gpio.h.
Enumeration of Gpio output mode.
Enumeration Details:
IOTBUS_GPIO_DRIVE_NONE = 0, No set any state
IOTBUS_GPIO_DRIVE_PULLUP = 1, Resistive High
IOTBUS_GPIO_DRIVE_PULLDOWN = 2, Resistive Low
IOTBUS_GPIO_DRIVE_FLOAT = 3, Float
IOTBUS_GPIO_DRIVE_PUSHPULL = 4, Push Pull
Definition at line 44 of file iotbus_gpio.h.
Enumeration of Gpio edge type for interrupt.
Enumeration Details:
IOTBUS_GPIO_EDGE_NONE = 0, No interrupt on Gpio
IOTBUS_GPIO_EDGE_BOTH = 1, Interrupt on rising and falling edge
IOTBUS_GPIO_EDGE_RISING = 2, Interrupt on rising edge only
IOTBUS_GPIO_EDGE_FALLING = 3, Interrupt on falling edge only
Definition at line 73 of file iotbus_gpio.h.
closes the gpio_context.
- Parameters
-
| [in] | dev | handle of gpio_context |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
gets a direction of the gpio.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [out] | dir | current gpio direction |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
gets a drive mode of the gpio.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [out] | drive | current drive type |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
gets a edge mode of the gpio.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [out] | edge | current gpio edge type |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
gets a pin number of the gpio.
- Parameters
-
| [in] | dev | handle of gpio_context |
- Returns
- On success, gpio pin number is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
initializes gpio_context based on gpio pin.
- Parameters
-
| [in] | gpiopin | gpio pin number |
- Returns
- On success, handle of gpio_context is returned. On failure, NULL is returned.
- Since
- Tizen RT v1.0
reads the gpio value.
- Parameters
-
| [in] | dev | handle of gpio_context |
- Returns
- On success, 0 or 1 is returned. (0: signal low, 1: signal high) On failure, a nagative value is returned.
- Since
- Tizen RT v1.0
registers event handler callback for interrupt.
isr_cb is called when following situation occured.
the gpio value is changed from 0 to 1 on IOTBUS_GPIO_EDGE_RISING mode.
the gpio value is changed from 1 to 0 on IOTBUS_GPIO_EDGE_FALLING mode.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [in] | edge | gpio edge type |
| [in] | isr_cb | the pointer of isr callback function |
| [in] | user_data | isr function parameter |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
sets gpio direction.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [in] | dir | gpio direction type |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
sets gpio output mode.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [in] | drive | gpio drive type |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
sets the edge mode on the gpio.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [in] | edge | gpio edge type |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
unregisters event handler callback for interrupt.
- Parameters
-
| [in] | dev | handle of gpio_context |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0
writes to the gpio value.
- Parameters
-
| [in] | dev | handle of gpio_context |
| [in] | value | signal value |
- Returns
- On success, 0 is returned. On failure, a negative value is returned.
- Since
- Tizen RT v1.0