microHAL
An abstraction layer for your future F4xx projects
|
Function defines for the GPIO driver. More...
#include "gpio.h"
Functions | |
void | gp_set_direction (const gp_bank_t bank, const uint8_t pin, const gp_dir_t dir) |
Sets the GPIO pin to the desired mode. | |
void | gp_set_output_type (const gp_bank_t bank, const uint8_t pin, const gp_otype_t type) |
Sets the GPIO output pin to the desired type. | |
void | gp_set_speed (const gp_bank_t bank, const uint8_t pin, const gp_speed_t speed) |
Sets the GPIO output pin to the desired speed. | |
void | gp_set_pupd (const gp_bank_t bank, const uint8_t pin, const gp_pupd_t poopdr) |
Sets the GPIO input pin to the desired state. | |
void | gp_set_val (const gp_bank_t bank, const uint8_t pin, const _Bool value) |
Sets the GPIO output pin to the desired value. | |
uint8_t | gp_read_val (const gp_bank_t bank, const uint8_t pin) |
Reads the GPIO input pin value. | |
void | gp_set_af (const gp_bank_t bank, const uint8_t pin, const uint8_t af) |
Sets the alternate function of the GPIO pin. | |
Function defines for the GPIO driver.
This file contains all of the function definitions declared in gpio.h.
uint8_t gp_read_val | ( | const gp_bank_t | bank, |
const uint8_t | pin ) |
Reads the GPIO input pin value.
bank | The GPIO bank |
pin | The GPIO pin |
void gp_set_af | ( | const gp_bank_t | bank, |
const uint8_t | pin, | ||
const uint8_t | af ) |
Sets the alternate function of the GPIO pin.
bank | The GPIO bank |
pin | The GPIO pin |
The | alternate function number |
Sets the GPIO pin to the desired mode.
The available directions for the GPIO pins are specified in the gp_dir_t enum. Any other value will be ignored.
bank | The GPIO bank |
pin | The GPIO pin |
dir | The pin mode |
void gp_set_output_type | ( | const gp_bank_t | bank, |
const uint8_t | pin, | ||
const gp_otype_t | type ) |
Sets the GPIO output pin to the desired type.
The available output types for the GPIO pins are specified in the gp_otype_t enum. Any other value will be ignored.
bank | The GPIO bank |
pin | The GPIO pin |
type | The pin type |
Sets the GPIO input pin to the desired state.
The available pull-up/pull-down states for the GPIO pins are specified in the gp_pupdr_t enum. Any other value will be ignored.
bank | The GPIO bank |
pin | The GPIO pin |
poopdr | The pin state |
void gp_set_speed | ( | const gp_bank_t | bank, |
const uint8_t | pin, | ||
const gp_speed_t | speed ) |
Sets the GPIO output pin to the desired speed.
The available speeds for the GPIO output pins are specified in the gp_speed_t enum. Any other value will be ignored.
bank | The GPIO bank |
pin | The GPIO pin |
speed | The pin speed |
void gp_set_val | ( | const gp_bank_t | bank, |
const uint8_t | pin, | ||
const _Bool | value ) |
Sets the GPIO output pin to the desired value.
Allowed values are either TRUE(1) or FALSE(0). Any other value will be ignored.
bank | The GPIO bank |
pin | The GPIO pin |
value | The pin value |