This is the final version of Mini Gateway for Automation and Security desgined for Renesas GR Peach Design Contest

Dependencies:   GR-PEACH_video GraphicsFramework HTTPServer R_BSP mbed-rpc mbed-rtos Socket lwip-eth lwip-sys lwip FATFileSystem

Fork of mbed-os-example-mbed5-blinky by mbed-os-examples

Embed: (wiki syntax)

« Back to documentation index

GPIO HAL functions

GPIO HAL functions
[Hal]

Functions

uint32_t gpio_set (PinName pin)
 Set the given pin as GPIO.
void gpio_init (gpio_t *obj, PinName pin)
 Initialize the GPIO pin.
void gpio_mode (gpio_t *obj, PinMode mode)
 Set the input pin mode.
void gpio_dir (gpio_t *obj, PinDirection direction)
 Set the pin direction.
void gpio_write (gpio_t *obj, int value)
 Set the output value.
int gpio_read (gpio_t *obj)
 Read the input value.
void gpio_init_in (gpio_t *gpio, PinName pin)
 Init the input pin and set mode to PullDefault.
void gpio_init_in_ex (gpio_t *gpio, PinName pin, PinMode mode)
 Init the input pin and set the mode.
void gpio_init_out (gpio_t *gpio, PinName pin)
 Init the output pin as an output, with predefined output value 0.
void gpio_init_out_ex (gpio_t *gpio, PinName pin, int value)
 Init the pin as an output and set the output value.
void gpio_init_inout (gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value)
 Init the pin to be in/out.

Function Documentation

void gpio_dir ( gpio_t *  obj,
PinDirection  direction 
)

Set the pin direction.

Parameters:
objThe GPIO object
directionThe pin direction to be set
void gpio_init ( gpio_t *  obj,
PinName  pin 
)

Initialize the GPIO pin.

Parameters:
objThe GPIO object to initialize
pinThe GPIO pin to initialize
void gpio_init_in ( gpio_t *  gpio,
PinName  pin 
)

Init the input pin and set mode to PullDefault.

Parameters:
objThe GPIO object
pinThe pin name

Definition at line 37 of file mbed_gpio.c.

void gpio_init_in_ex ( gpio_t *  gpio,
PinName  pin,
PinMode  mode 
)

Init the input pin and set the mode.

Parameters:
objThe GPIO object
pinThe pin name
modeThe pin mode to be set

Definition at line 41 of file mbed_gpio.c.

void gpio_init_inout ( gpio_t *  gpio,
PinName  pin,
PinDirection  direction,
PinMode  mode,
int  value 
)

Init the pin to be in/out.

Parameters:
objThe GPIO object
pinThe pin name
directionThe pin direction to be set
modeThe pin mode to be set
valueThe value to be set for an output pin

Definition at line 53 of file mbed_gpio.c.

void gpio_init_out ( gpio_t *  gpio,
PinName  pin 
)

Init the output pin as an output, with predefined output value 0.

Parameters:
objThe GPIO object
pinThe pin name
Returns:
An integer value 1 or 0

Definition at line 45 of file mbed_gpio.c.

void gpio_init_out_ex ( gpio_t *  gpio,
PinName  pin,
int  value 
)

Init the pin as an output and set the output value.

Parameters:
objThe GPIO object
pinThe pin name
valueThe value to be set

Definition at line 49 of file mbed_gpio.c.

void gpio_mode ( gpio_t *  obj,
PinMode  mode 
)

Set the input pin mode.

Parameters:
objThe GPIO object
modeThe pin mode to be set
int gpio_read ( gpio_t *  obj )

Read the input value.

Parameters:
objThe GPIO object
Returns:
An integer value 1 or 0
uint32_t gpio_set ( PinName  pin )

Set the given pin as GPIO.

Parameters:
pinThe pin to be set as GPIO
Returns:
The GPIO port mask for this pin
void gpio_write ( gpio_t *  obj,
int  value 
)

Set the output value.

Parameters:
objThe GPIO object
valueThe value to be set