rfLPC
A low level library for using NXP's LPC17xx SoC. Config is given for MBED prototyping board
General Purpose Input Output (GPIO)

Functions

void rflpc_gpio_use_pin (rflpc_pin_t pin, rflpc_pin_mode_t mode)
 Configures the multi-purpose pins of the CM3 so that it uses a given GPIO pin. More...
 
void rflpc_gpio_set_pin_mode_input (rflpc_pin_t pin, rflpc_pin_mode_t mode)
 Sets a pin to input mode. More...
 
void rflpc_gpio_set_pin_mode_output (rflpc_pin_t pin, uint8_t val)
 Sets a pin to output mode Uses a pin as output pin and sets its value. More...
 
void rflpc_gpio_set_pin (rflpc_pin_t pin)
 Set a pin (put a logical 1 on it)
 
void rflpc_gpio_clr_pin (rflpc_pin_t pin)
 Clear a pin (put a logical 0 on it)
 
void rflpc_gpio_set_pins_from_mask (uint8_t gpio, uint32_t mask)
 Set multiple pins from a mask.
 
void rflpc_gpio_clr_pins_from_mask (uint8_t gpio, uint32_t mask)
 Clean multiple pins from a mask.
 
void rflpc_gpio_set_pin_val (rflpc_pin_t pin, int val)
 Sets the value of a pin (0 or 1)
 
void rflpc_gpio_set_val (uint8_t gpio, uint32_t val, uint32_t mask)
 Sets the value of multiple pins of a given port from a mask and a value.
 
int rflpc_gpio_get_pin (rflpc_pin_t pin)
 Gets the value of a pin.
 
uint32_t rflpc_gpio_get_val (uint8_t gpio)
 Gets the value of the entire port.
 

Detailed Description

Function Documentation

void rflpc_gpio_set_pin_mode_input ( rflpc_pin_t  pin,
rflpc_pin_mode_t  mode 
)

Sets a pin to input mode.

Note
This automatically calls rflpc_gpio_use_pin
void rflpc_gpio_set_pin_mode_output ( rflpc_pin_t  pin,
uint8_t  val 
)

Sets a pin to output mode Uses a pin as output pin and sets its value.

Note
This automatically calls rflpc_gpio_use_pin with a pull-up configuration
Parameters
pinpin to use
valvalue to set on pin

Referenced by rflpc_led_init().

void rflpc_gpio_use_pin ( rflpc_pin_t  pin,
rflpc_pin_mode_t  mode 
)

Configures the multi-purpose pins of the CM3 so that it uses a given GPIO pin.

Parameters
pinthe pin to activate
modethe mode to set for the pin (pull-up, pull-down,...) see rflpc_pin_mode_t