libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
|
Functions | |
void | gpio_enable_lock (void) |
Enable GPIO registers lock. More... | |
void | gpio_disable_lock (void) |
Disable GPIO registers lock. More... | |
bool | gpio_get_lock_flag (void) |
Get GPIO register lock flag. More... | |
void | gpio_set_drive_strength (uint32_t gpio_port, enum gpio_drive_strength drive_stength) |
Set port pins drive strength. More... | |
void | gpio_mode_setup (uint32_t gpio_port, enum gpio_mode mode, uint16_t gpios) |
Set port pins mode. More... | |
void | gpio_set (uint32_t gpio_port, uint16_t gpios) |
Set port pins output value (Atomic) More... | |
void | gpio_clear (uint32_t gpio_port, uint16_t gpios) |
Set port pins output value (Atomic) More... | |
uint16_t | gpio_get (uint32_t gpio_port, uint16_t gpios) |
Get port pins input value. More... | |
void | gpio_toggle (uint32_t gpio_port, uint16_t gpios) |
Toggle port pins output value (Atomic) More... | |
uint16_t | gpio_port_read (uint32_t gpio_port) |
Get port (all) input value's. More... | |
void | gpio_port_write (uint32_t gpio_port, uint16_t data) |
Set port (all) output value's. More... | |
void | gpio_port_config_lock (uint32_t gpio_port, uint16_t gpios) |
Lock the Configuration of a Group of Pins. More... | |
void gpio_clear | ( | uint32_t | gpio_port, |
uint16_t | gpios | ||
) |
Set port pins output value (Atomic)
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 118 of file gpio_common.c.
References GPIO_P_DOUTCLR.
void gpio_disable_lock | ( | void | ) |
Disable GPIO registers lock.
Definition at line 42 of file gpio_common.c.
References GPIO_LOCK, and GPIO_LOCK_LOCKKEY_UNLOCK.
void gpio_enable_lock | ( | void | ) |
Enable GPIO registers lock.
Definition at line 32 of file gpio_common.c.
References GPIO_LOCK, and GPIO_LOCK_LOCKKEY_LOCK.
uint16_t gpio_get | ( | uint32_t | gpio_port, |
uint16_t | gpios | ||
) |
Get port pins input value.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 130 of file gpio_common.c.
References GPIO_P_DIN.
bool gpio_get_lock_flag | ( | void | ) |
Get GPIO register lock flag.
true | if flag is set |
false | if flag is not set |
Definition at line 54 of file gpio_common.c.
References GPIO_LOCK, GPIO_LOCK_LOCKKEY_LOCKED, and GPIO_LOCK_LOCKKEY_MASK.
void gpio_mode_setup | ( | uint32_t | gpio_port, |
enum gpio_mode | mode, | ||
uint16_t | gpios | ||
) |
Set port pins mode.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | mode | Mode (use GPIO_MODE_*) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 78 of file gpio_common.c.
References GPIO_P_MODE_MODEx, GPIO_P_MODEH, and GPIO_P_MODEL.
void gpio_port_config_lock | ( | uint32_t | gpio_port, |
uint16_t | gpios | ||
) |
Lock the Configuration of a Group of Pins.
The configuration of one or more pins of the given GPIO port is locked. There is no mechanism to unlock these via software. Unlocking occurs at the next reset.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 177 of file gpio_common.c.
References GPIO_P_PINLOCKN.
uint16_t gpio_port_read | ( | uint32_t | gpio_port | ) |
Get port (all) input value's.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
Definition at line 151 of file gpio_common.c.
References GPIO_P_DIN.
void gpio_port_write | ( | uint32_t | gpio_port, |
uint16_t | data | ||
) |
Set port (all) output value's.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | data | Data (all pins output value) |
Definition at line 161 of file gpio_common.c.
References GPIO_P_DOUT.
void gpio_set | ( | uint32_t | gpio_port, |
uint16_t | gpios | ||
) |
Set port pins output value (Atomic)
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 107 of file gpio_common.c.
References GPIO_P_DOUTSET.
void gpio_set_drive_strength | ( | uint32_t | gpio_port, |
enum gpio_drive_strength | drive_stength | ||
) |
Set port pins drive strength.
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | drive_stength | Driver Stength (use GPIO_STENGTH_*) |
Definition at line 65 of file gpio_common.c.
References GPIO_P_CTRL, and GPIO_P_CTRL_DRIVEMODE.
void gpio_toggle | ( | uint32_t | gpio_port, |
uint16_t | gpios | ||
) |
Toggle port pins output value (Atomic)
[in] | gpio_port | GPIO Port (use GPIO* ex. GPIOA, GPIOB, ....) |
[in] | gpios | (pins mask (use GPIO* ex . GPIO0, GPIO1 .... GPIO_ALL, use bitwise OR '|' to separate) |
Definition at line 141 of file gpio_common.c.
References GPIO_P_DOUTTGL.