47 #include "gpio_regs.h" 68 #define PORT_0 ((uint32_t)(0UL)) 69 #define PORT_1 ((uint32_t)(1UL)) 70 #define PORT_2 ((uint32_t)(2UL)) 71 #define PORT_3 ((uint32_t)(3UL)) 72 #define PORT_4 ((uint32_t)(4UL)) 79 #define PIN_0 ((uint32_t)(1UL << 0)) 80 #define PIN_1 ((uint32_t)(1UL << 1)) 81 #define PIN_2 ((uint32_t)(1UL << 2)) 82 #define PIN_3 ((uint32_t)(1UL << 3)) 83 #define PIN_4 ((uint32_t)(1UL << 4)) 84 #define PIN_5 ((uint32_t)(1UL << 5)) 85 #define PIN_6 ((uint32_t)(1UL << 6)) 86 #define PIN_7 ((uint32_t)(1UL << 7)) 87 #define PIN_8 ((uint32_t)(1UL << 8)) 88 #define PIN_9 ((uint32_t)(1UL << 9)) 89 #define PIN_10 ((uint32_t)(1UL << 10)) 90 #define PIN_11 ((uint32_t)(1UL << 11)) 91 #define PIN_12 ((uint32_t)(1UL << 12)) 92 #define PIN_13 ((uint32_t)(1UL << 13)) 93 #define PIN_14 ((uint32_t)(1UL << 14)) 94 #define PIN_15 ((uint32_t)(1UL << 15)) 95 #define PIN_16 ((uint32_t)(1UL << 16)) 96 #define PIN_17 ((uint32_t)(1UL << 17)) 97 #define PIN_18 ((uint32_t)(1UL << 18)) 98 #define PIN_19 ((uint32_t)(1UL << 19)) 99 #define PIN_20 ((uint32_t)(1UL << 20)) 100 #define PIN_21 ((uint32_t)(1UL << 21)) 101 #define PIN_22 ((uint32_t)(1UL << 22)) 102 #define PIN_23 ((uint32_t)(1UL << 23)) 103 #define PIN_24 ((uint32_t)(1UL << 24)) 104 #define PIN_25 ((uint32_t)(1UL << 25)) 105 #define PIN_26 ((uint32_t)(1UL << 26)) 106 #define PIN_27 ((uint32_t)(1UL << 27)) 107 #define PIN_28 ((uint32_t)(1UL << 28)) 108 #define PIN_29 ((uint32_t)(1UL << 29)) 109 #define PIN_30 ((uint32_t)(1UL << 30)) 110 #define PIN_31 ((uint32_t)(1UL << 31)) uint32_t mask
Pin mask (multiple pins may be set)
Definition: gpio.h:140
void GPIO_Handler(unsigned int port)
GPIO IRQ Handler.
int GPIO_Config(const gpio_cfg_t *cfg)
Configure GPIO pin(s).
Structure type for configuring a GPIO port.
Definition: gpio.h:138
void(* gpio_callback_fn)(void *cbdata)
Type alias for a GPIO callback function with prototype:
Definition: gpio.h:269
void GPIO_IntEnable(const gpio_cfg_t *cfg)
Enables the specified GPIO interrupt.
gpio_int_pol_t
Enumeration type for the interrupt polarity.
Definition: gpio.h:156
uint32_t GPIO_IntStatus(const gpio_cfg_t *cfg)
Gets the interrupt(s) status on a GPIO pin.
uint32_t GPIO_OutGet(const gpio_cfg_t *cfg)
Gets the pin(s) output state.
void GPIO_OutSet(const gpio_cfg_t *cfg)
Sets the pin(s) to a high level output.
int GPIO_Init(void)
Initialize GPIO.
Interrupt triggers on rising edge.
Definition: gpio.h:159
Interrupt triggers on either edge.
Definition: gpio.h:161
gpio_int_mode_t
Enumeration type for the interrupt modes.
Definition: gpio.h:148
No pull-up or pull-down.
Definition: gpio.h:130
Interrupt triggers when level is high.
Definition: gpio.h:158
Alternate Function Selection.
Definition: gpio.h:121
Set pad to weak pull-up.
Definition: gpio.h:131
void GPIO_OutClr(const gpio_cfg_t *cfg)
Clears the pin(s) to a low level output.
Alternate Function Selection.
Definition: gpio.h:123
GPIO Output.
Definition: gpio.h:119
void GPIO_IntDisable(const gpio_cfg_t *cfg)
Disables the specified GPIO interrupt.
Interrupt is level sensitive.
Definition: gpio.h:149
void GPIO_RegisterCallback(const gpio_cfg_t *cfg, gpio_callback_fn callback, void *cbdata)
Registers a callback for the interrupt on a given port and pin.
Alternate Function Selection.
Definition: gpio.h:122
gpio_pad_t pad
Pad type.
Definition: gpio.h:142
Alternate Function Selection.
Definition: gpio.h:120
Interrupt triggers when level is low.
Definition: gpio.h:160
Set pad to weak pull-down.
Definition: gpio.h:132
GPIO Input.
Definition: gpio.h:118
Interrupt is edge sensitive.
Definition: gpio.h:150
Interrupt triggers on falling edge.
Definition: gpio.h:157
void GPIO_OutPut(const gpio_cfg_t *cfg, uint32_t val)
Write the pin(s) to a desired output level.
uint32_t GPIO_InGet(const gpio_cfg_t *cfg)
Gets the pin(s) input state.
void GPIO_OutToggle(const gpio_cfg_t *cfg)
Toggles the the pin(s) output level.
int GPIO_IntConfig(const gpio_cfg_t *cfg, gpio_int_mode_t mode, gpio_int_pol_t pol)
Configure GPIO interrupt(s)
void GPIO_IntClr(const gpio_cfg_t *cfg)
Clears the interrupt(s) status on a GPIO pin.
uint32_t port
Index of GPIO port.
Definition: gpio.h:139
gpio_pad_t
Enumeration type for the type of GPIO pad on a given pin.
Definition: gpio.h:129
gpio_func_t
Enumeration type for the GPIO Function Type.
Definition: gpio.h:117
gpio_func_t func
Function type.
Definition: gpio.h:141