RTEMS: bsps/arm/lpc176x/gpio/lpc-gpio.c File Reference

| RTEMS 5.4-rc2

Loading...
Searching...
No Matches
Functions
lpc-gpio.c File Reference
Board Support Packages » ARM » NXP LPC176X

GPIO library for the lpc176x bsp. More...

`#include <assert.h>`
`#include <bsp/irq.h>`
`#include <bsp/io.h>`
`#include <bsp/lpc-gpio.h>`
`#include <rtems/status-checks.h>`

## Functions
rtems_status_code | lpc176x_gpio_config (const lpc176x_pin_number pin, const lpc176x_gpio_direction dir)
| Configures the pin as input or output GPIO.
rtems_status_code | lpc176x_gpio_config_input_with_interrupt (const lpc176x_pin_number pin, const lpc176x_gpio_interrupt edge, const lpc176x_gpio_interrupt_function isr_funct)
| Configures the pin as input, enables interrupt for an edge/s and sets isrfunct as the function to call when that interrupt occurs.
rtems_status_code | lpc176x_gpio_set_pin (const lpc176x_pin_number pin)
| Sets the output pin to 1.
rtems_status_code | lpc176x_gpio_clear_pin (const lpc176x_pin_number pin)
| Sets the output pin to 0.
rtems_status_code | lpc176x_gpio_write_pin (const lpc176x_pin_number pin, const bool value)
| Sets the output pin to 0 or 1 according to value.
rtems_status_code | lpc176x_gpio_get_pin_value (const lpc176x_pin_number pin, bool *pin_value)
| Returns the value at the given input pin.

## Detailed Description

GPIO library for the lpc176x bsp.

## Function Documentation

## ◆ lpc176x_gpio_clear_pin()

rtems_status_code lpc176x_gpio_clear_pin | ( | lpc176x_pin_number | pin | ) |

Sets the output pin to 0.

Parameters

  pin | The pin to set

## ◆ lpc176x_gpio_config()

rtems_status_code lpc176x_gpio_config | ( | lpc176x_pin_number | pin,
|  | lpc176x_gpio_direction | dir
| ) |  |

Configures the pin as input or output GPIO.

Parameters

  pin | The pin to configure
  dir | Input or output.

## ◆ lpc176x_gpio_config_input_with_interrupt()

rtems_status_code lpc176x_gpio_config_input_with_interrupt | ( | lpc176x_pin_number | pin,
|  | lpc176x_gpio_interrupt | edge,
|  | lpc176x_gpio_interrupt_function | isrfunct
| ) |  |

Configures the pin as input, enables interrupt for an edge/s and sets isrfunct as the function to call when that interrupt occurs.

Parameters

  pin | The pin to configure.
  edge | Which edge or edges will activate the interrupt.
  isrfunct | The function that is called when the interrupt occurs.

Returns
  RTEMS_SUCCESSFULL if the configurations was success.

## ◆ lpc176x_gpio_get_pin_value()

rtems_status_code lpc176x_gpio_get_pin_value | ( | lpc176x_pin_number | pin,
|  | bool * | pin_value
| ) |  |
| inline

Returns the value at the given input pin.

Parameters

  pin | The pin where to read the value.
  pin_value | TRUE if the pin value was getted successfuly.

Returns
  RTEMS_SUCCESSFUL if the pin value was getted successfuly.

## ◆ lpc176x_gpio_set_pin()

rtems_status_code lpc176x_gpio_set_pin | ( | lpc176x_pin_number | pin | ) |

Sets the output pin to 1.

Parameters

  pin | The pin to set

## ◆ lpc176x_gpio_write_pin()

rtems_status_code lpc176x_gpio_write_pin | ( | lpc176x_pin_number | pin,
|  | bool | value
| ) |  |

Sets the output pin to 0 or 1 according to value.

Parameters

  pin | The pin to set
  value | the value to set.