GPIO driver APIs. More...
Typedefs | |
| typedef enum gpio_interrupt_trigger | gpio_interrupt_trigger_t |
| Interrupt trigger type. More... | |
Enumerations | |
| enum | gpio_interrupt_trigger { gpio_interrupt_trigger_level_high = 0 , gpio_interrupt_trigger_level_low , gpio_interrupt_trigger_edge_rising , gpio_interrupt_trigger_edge_falling } |
| Interrupt trigger type. More... | |
Functions | |
| static uint8_t | gpio_read_pin (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Read target pin level. More... | |
| static uint32_t | gpio_get_pin_output_status (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Read target pin output state. More... | |
| static void | gpio_toggle_pin (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Toggle pin level. More... | |
| static void | gpio_write_pin (GPIO_Type *ptr, uint32_t port, uint8_t pin, uint8_t high) |
| Write pin level. More... | |
| static void | gpio_set_pin_input (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Set pin to input mode. More... | |
| static void | gpio_set_pin_output (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Set pin to output mode. More... | |
| void | gpio_set_pin_output_with_initial (GPIO_Type *ptr, uint32_t port, uint8_t pin, uint8_t initial) |
| Set pin to output mode with initial value. More... | |
| static bool | gpio_check_pin_interrupt_flag (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Check specific pin interrupt status. More... | |
| static void | gpio_clear_pin_interrupt_flag (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Clear specific pin interrupt flag. More... | |
| static bool | gpio_check_pin_interrupt_enabled (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Check if specific pin interrupt is enabled or not. More... | |
| static void | gpio_enable_pin_interrupt (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Enable interrupt for specific pin. More... | |
| static void | gpio_disable_pin_interrupt (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Disable interrupt for specific pin. More... | |
| static bool | gpio_check_clear_interrupt_flag (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Check interrupt flag of specific pin and clear if it is set. More... | |
| static uint32_t | gpio_read_port (GPIO_Type *ptr, uint32_t port) |
| Read all pins level on specific port. More... | |
| static void | gpio_toggle_port_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Toggle port with specific pin mask. More... | |
| static void | gpio_write_port (GPIO_Type *ptr, uint32_t port, uint32_t value) |
| Write specific port with value. More... | |
| static void | gpio_set_port_low_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Set spcific port pin high according to the given mask. More... | |
| static void | gpio_set_port_high_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Set spcific port pin high according to the given mask. More... | |
| static void | gpio_enable_port_output_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Enable pins output of specific port according to the given mask. More... | |
| static void | gpio_disable_port_output_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Disable pins output of specific port according to the given mask. More... | |
| static uint32_t | gpio_get_port_interrupt_flags (GPIO_Type *ptr, uint32_t port) |
| Get current interrupt flags on specific port. More... | |
| static void | gpio_clear_port_interrupt_flags_with_mask (GPIO_Type *ptr, uint32_t port, uint32_t mask) |
| Clear interrupt flags with given mask on specific port. More... | |
| static void | gpio_enable_port_interrupt_with_mask (GPIO_Type *ptr, uint32_t port, uint8_t mask) |
| Enable interrupts with given mask on specific port. More... | |
| static void | gpio_disable_port_interrupt_with_mask (GPIO_Type *ptr, uint32_t port, uint8_t mask) |
| Disable interrupts with given mask on specific port. More... | |
| void | gpio_config_pin_interrupt (GPIO_Type *ptr, uint32_t port, uint8_t pin, gpio_interrupt_trigger_t trigger) |
| Config pin interrupt. More... | |
| void | gpio_toggle_pin_interrupt_trigger_polarity (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Toggle pin interrupt trigger polarity. More... | |
| void | gpio_toggle_pin_interrupt_trigger_type (GPIO_Type *ptr, uint32_t port, uint8_t pin) |
| Toggle pin interrupt trigger type. More... | |
GPIO driver APIs.
| typedef enum gpio_interrupt_trigger gpio_interrupt_trigger_t |
#include <drivers/inc/hpm_gpio_drv.h>
Interrupt trigger type.
#include <drivers/inc/hpm_gpio_drv.h>
Interrupt trigger type.
| Enumerator | |
|---|---|
| gpio_interrupt_trigger_level_high | |
| gpio_interrupt_trigger_level_low | |
| gpio_interrupt_trigger_edge_rising | |
| gpio_interrupt_trigger_edge_falling | |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Check interrupt flag of specific pin and clear if it is set.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Check if specific pin interrupt is enabled or not.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Check specific pin interrupt status.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Clear specific pin interrupt flag.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Clear interrupt flags with given mask on specific port.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of interrupts to be cleared |
| void gpio_config_pin_interrupt | ( | GPIO_Type * | ptr, |
| uint32_t | port, | ||
| uint8_t | pin, | ||
| gpio_interrupt_trigger_t | trigger | ||
| ) |
#include <drivers/inc/hpm_gpio_drv.h>
Config pin interrupt.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| trigger | Trigger type |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Disable interrupt for specific pin.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Disable interrupts with given mask on specific port.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of interrupts to be disabled |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Disable pins output of specific port according to the given mask.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of pins to be disabled |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Enable interrupt for specific pin.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Enable interrupts with given mask on specific port.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of interrupts to be enabled |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Enable pins output of specific port according to the given mask.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of pins to be enabled |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Read target pin output state.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Get current interrupt flags on specific port.
| ptr | GPIO base address |
| port | Port index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Read target pin level.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Read all pins level on specific port.
| ptr | GPIO base address |
| port | Port index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Set pin to input mode.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Set pin to output mode.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| void gpio_set_pin_output_with_initial | ( | GPIO_Type * | ptr, |
| uint32_t | port, | ||
| uint8_t | pin, | ||
| uint8_t | initial | ||
| ) |
#include <drivers/inc/hpm_gpio_drv.h>
Set pin to output mode with initial value.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| initial | Initial value |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Set spcific port pin high according to the given mask.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of pins to be set to high |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Set spcific port pin high according to the given mask.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask of pins to be set to low |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Toggle pin level.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| void gpio_toggle_pin_interrupt_trigger_polarity | ( | GPIO_Type * | ptr, |
| uint32_t | port, | ||
| uint8_t | pin | ||
| ) |
#include <drivers/inc/hpm_gpio_drv.h>
Toggle pin interrupt trigger polarity.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| void gpio_toggle_pin_interrupt_trigger_type | ( | GPIO_Type * | ptr, |
| uint32_t | port, | ||
| uint8_t | pin | ||
| ) |
#include <drivers/inc/hpm_gpio_drv.h>
Toggle pin interrupt trigger type.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Toggle port with specific pin mask.
| ptr | GPIO base address |
| port | Port index |
| mask | Mask pins to be toggled |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Write pin level.
| ptr | GPIO base address |
| port | Port index |
| pin | Pin index |
| high | Pin level set to high when it is set to true |
|
inlinestatic |
#include <drivers/inc/hpm_gpio_drv.h>
Write specific port with value.
| ptr | GPIO base address |
| port | Port index |
| value | Value to be written |