RTEMS  5.0.0
Functions
lpc-gpio.c File Reference

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. More...
 
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. More...
 
rtems_status_code lpc176x_gpio_set_pin (const lpc176x_pin_number pin)
 Sets the output pin to 1. More...
 
rtems_status_code lpc176x_gpio_clear_pin (const lpc176x_pin_number pin)
 Sets the output pin to 0. More...
 
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. More...
 
rtems_status_code lpc176x_gpio_get_pin_value (const lpc176x_pin_number pin, bool *pin_value)
 Returns the value at the given input pin. More...
 

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
pinThe 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
pinThe pin to configure
dirInput 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
pinThe pin to configure.
edgeWhich edge or edges will activate the interrupt.
isrfunctThe 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
pinThe pin where to read the value.
pin_valueTRUE 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
pinThe 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
pinThe pin to set
valuethe value to set.