SDK4.0 This document shows Ameba SDK 4.0 APIs

- Main Page
- Modules
- Data Structures
- Files

Functions
GPIO_EX
Ameba SDK » HAL

gpio extended functions More...

## Functions
void | gpio_direct_write (gpio_t *obj, BOOL value)
| Sets value to the selected output port pin. More...
void | gpio_pull_ctrl (gpio_t *obj, PinMode pull_type)
| Sets pull type to the selected pin. More...
void | gpio_deinit (gpio_t *obj)
| Deinitializes the GPIO device, include mode/direction/pull control registers. More...
void | gpio_change_dir (gpio_t *obj, PinDirection direction)
| Set GPIO direction. More...

## Detailed Description

gpio extended functions

## Function Documentation

void gpio_change_dir | ( | gpio_t * | obj,
|  | PinDirection | direction
| ) |  |

Set GPIO direction.

Parameters

  obj | gpio object define in application software.
  direction | this parameter can be one of the following values: PIN_INPUT: this pin is input PIN_OUTPUT: this pin is output

Return values

  none |

void gpio_deinit | ( | gpio_t * | obj | ) |

Deinitializes the GPIO device, include mode/direction/pull control registers.

Parameters

  obj | gpio object define in application software.

Return values

  none |

void gpio_direct_write | ( | gpio_t * | obj,
|  | BOOL | value
| ) |  |

Sets value to the selected output port pin.

Parameters

  obj | gpio object define in application software.
  value | specifies the value to be written to the selected pin This parameter can be one of the following values: 0: Pin state set to low 1: Pin state set to high

Return values

  none |

void gpio_pull_ctrl | ( | gpio_t * | obj,
|  | PinMode | pull_type
| ) |  |

Sets pull type to the selected pin.

Parameters

  obj | gpio object define in application software.
  pull_type | this parameter can be one of the following values: PullNone: HighZ, user can input high or low use this pin OpenDrain(is OpenDrain output): no pull + OUT + GPIO[gpio_bit] = 0 PullDown: pull down PullUp: pull up

Return values

  none |