Mbed OS Reference
|
Modules | |
GPIO HAL tests | |
The GPIO HAL tests ensure driver conformance to defined behaviour. | |
Data Structures | |
struct | gpio_capabilities_t |
GPIO capabilities for a given pin. More... | |
Functions | |
uint32_t | gpio_set (PinName pin) |
Set the given pin as GPIO. More... | |
int | gpio_is_connected (const gpio_t *obj) |
Checks if gpio object is connected (pin was not initialized with NC) More... | |
void | gpio_init (gpio_t *obj, PinName pin) |
Initialize the GPIO pin. More... | |
void | gpio_free (gpio_t *obj) |
Releases the GPIO pin. More... | |
void | gpio_mode (gpio_t *obj, PinMode mode) |
Set the input pin mode. More... | |
void | gpio_dir (gpio_t *obj, PinDirection direction) |
Set the pin direction. More... | |
void | gpio_write (gpio_t *obj, int value) |
Set the output value. More... | |
int | gpio_read (gpio_t *obj) |
Read the input value. More... | |
void | gpio_init_in (gpio_t *gpio, PinName pin) |
Init the input pin and set mode to PullDefault. More... | |
void | gpio_init_in_ex (gpio_t *gpio, PinName pin, PinMode mode) |
Init the input pin and set the mode. More... | |
void | gpio_init_out (gpio_t *gpio, PinName pin) |
Init the output pin as an output, with predefined output value 0. More... | |
void | gpio_init_out_ex (gpio_t *gpio, PinName pin, int value) |
Init the pin as an output and set the output value. More... | |
void | gpio_init_inout (gpio_t *gpio, PinName pin, PinDirection direction, PinMode mode, int value) |
Init the pin to be in/out. More... | |
void | gpio_get_capabilities (gpio_t *gpio, gpio_capabilities_t *cap) |
Fill the given gpio_capabilities_t instance according to pin capabilities. More... | |
const PinMap * | gpio_pinmap (void) |
Get the pins that support all GPIO tests. More... | |
gpio_capabilities_t
instance according to pin capabilities.uint32_t gpio_set | ( | PinName | pin | ) |
Set the given pin as GPIO.
pin | The pin to be set as GPIO |
int gpio_is_connected | ( | const gpio_t * | obj | ) |
Checks if gpio object is connected (pin was not initialized with NC)
obj | The GPIO object |
void gpio_init | ( | gpio_t * | obj, |
PinName | pin | ||
) |
Initialize the GPIO pin.
obj | The GPIO object to initialize |
pin | The GPIO pin to initialize (may be NC) |
void gpio_free | ( | gpio_t * | obj | ) |
Releases the GPIO pin.
obj | The GPIO object to release |
void gpio_mode | ( | gpio_t * | obj, |
PinMode | mode | ||
) |
Set the input pin mode.
obj | The GPIO object (must be connected) |
mode | The pin mode to be set |
void gpio_dir | ( | gpio_t * | obj, |
PinDirection | direction | ||
) |
Set the pin direction.
obj | The GPIO object (must be connected) |
direction | The pin direction to be set |
void gpio_write | ( | gpio_t * | obj, |
int | value | ||
) |
Set the output value.
obj | The GPIO object (must be connected) |
value | The value to be set |
int gpio_read | ( | gpio_t * | obj | ) |
Read the input value.
obj | The GPIO object (must be connected) |
void gpio_init_in | ( | gpio_t * | gpio, |
PinName | pin | ||
) |
Init the input pin and set mode to PullDefault.
gpio | The GPIO object |
pin | The pin name (may be NC) |
void gpio_init_in_ex | ( | gpio_t * | gpio, |
PinName | pin, | ||
PinMode | mode | ||
) |
Init the input pin and set the mode.
gpio | The GPIO object |
pin | The pin name (may be NC) |
mode | The pin mode to be set |
void gpio_init_out | ( | gpio_t * | gpio, |
PinName | pin | ||
) |
Init the output pin as an output, with predefined output value 0.
gpio | The GPIO object |
pin | The pin name (may be NC) |
void gpio_init_out_ex | ( | gpio_t * | gpio, |
PinName | pin, | ||
int | value | ||
) |
Init the pin as an output and set the output value.
gpio | The GPIO object |
pin | The pin name (may be NC) |
value | The value to be set |
void gpio_init_inout | ( | gpio_t * | gpio, |
PinName | pin, | ||
PinDirection | direction, | ||
PinMode | mode, | ||
int | value | ||
) |
Init the pin to be in/out.
gpio | The GPIO object |
pin | The pin name (may be NC) |
direction | The pin direction to be set |
mode | The pin mode to be set |
value | The value to be set for an output pin |
void gpio_get_capabilities | ( | gpio_t * | gpio, |
gpio_capabilities_t * | cap | ||
) |
Fill the given gpio_capabilities_t instance according to pin capabilities.
const PinMap * gpio_pinmap | ( | void | ) |