27#ifndef LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_GPIO_H_
28#define LIBRARIES_PERIPHDRIVERS_INCLUDE_MAX32675_GPIO_H_
52#define MXC_GPIO_PORT_0 ((uint32_t)(1UL << 0))
53#define MXC_GPIO_PORT_1 ((uint32_t)(1UL << 1))
54#define MXC_GPIO_PORT_2 ((uint32_t)(1UL << 2))
55#define MXC_GPIO_PORT_3 ((uint32_t)(1UL << 3))
62#define MXC_GPIO_PIN_0 ((uint32_t)(1UL << 0))
63#define MXC_GPIO_PIN_1 ((uint32_t)(1UL << 1))
64#define MXC_GPIO_PIN_2 ((uint32_t)(1UL << 2))
65#define MXC_GPIO_PIN_3 ((uint32_t)(1UL << 3))
66#define MXC_GPIO_PIN_4 ((uint32_t)(1UL << 4))
67#define MXC_GPIO_PIN_5 ((uint32_t)(1UL << 5))
68#define MXC_GPIO_PIN_6 ((uint32_t)(1UL << 6))
69#define MXC_GPIO_PIN_7 ((uint32_t)(1UL << 7))
70#define MXC_GPIO_PIN_8 ((uint32_t)(1UL << 8))
71#define MXC_GPIO_PIN_9 ((uint32_t)(1UL << 9))
72#define MXC_GPIO_PIN_10 ((uint32_t)(1UL << 10))
73#define MXC_GPIO_PIN_11 ((uint32_t)(1UL << 11))
74#define MXC_GPIO_PIN_12 ((uint32_t)(1UL << 12))
75#define MXC_GPIO_PIN_13 ((uint32_t)(1UL << 13))
76#define MXC_GPIO_PIN_14 ((uint32_t)(1UL << 14))
77#define MXC_GPIO_PIN_15 ((uint32_t)(1UL << 15))
78#define MXC_GPIO_PIN_16 ((uint32_t)(1UL << 16))
79#define MXC_GPIO_PIN_17 ((uint32_t)(1UL << 17))
80#define MXC_GPIO_PIN_18 ((uint32_t)(1UL << 18))
81#define MXC_GPIO_PIN_19 ((uint32_t)(1UL << 19))
82#define MXC_GPIO_PIN_20 ((uint32_t)(1UL << 20))
83#define MXC_GPIO_PIN_21 ((uint32_t)(1UL << 21))
84#define MXC_GPIO_PIN_22 ((uint32_t)(1UL << 22))
85#define MXC_GPIO_PIN_23 ((uint32_t)(1UL << 23))
86#define MXC_GPIO_PIN_24 ((uint32_t)(1UL << 24))
87#define MXC_GPIO_PIN_25 ((uint32_t)(1UL << 25))
88#define MXC_GPIO_PIN_26 ((uint32_t)(1UL << 26))
89#define MXC_GPIO_PIN_27 ((uint32_t)(1UL << 27))
90#define MXC_GPIO_PIN_28 ((uint32_t)(1UL << 28))
91#define MXC_GPIO_PIN_29 ((uint32_t)(1UL << 29))
92#define MXC_GPIO_PIN_30 ((uint32_t)(1UL << 30))
93#define MXC_GPIO_PIN_31 ((uint32_t)(1UL << 31))
Registers, Bit Masks and Bit Positions for the GPIO Peripheral Module.
Definition: gpio_regs.h:76
mxc_gpio_vssel_t vssel
Voltage select.
Definition: gpio.h:170
mxc_gpio_func_t func
Function type.
Definition: gpio.h:168
mxc_gpio_pad_t pad
Pad type.
Definition: gpio.h:169
uint32_t mask
Pin mask (multiple pins may be set)
Definition: gpio.h:167
mxc_gpio_drvstr_t drvstr
Drive Strength select.
Definition: gpio.h:171
mxc_gpio_regs_t * port
Pointer to GPIO regs.
Definition: gpio.h:166
mxc_gpio_vssel_t
Enumeration type for the voltage level on a given pin.
Definition: gpio.h:122
int MXC_GPIO_Config(const mxc_gpio_cfg_t *cfg)
Configure GPIO pin(s).
mxc_gpio_int_pol_t
Enumeration type for the interrupt polarity.
Definition: gpio.h:185
uint32_t MXC_GPIO_GetFlags(mxc_gpio_regs_t *port)
Gets the interrupt(s) status on a GPIO port.
mxc_gpio_config_lock_t
Enumeration type for the pin configuration lock mechanism.
Definition: gpio.h:196
mxc_gpio_int_mode_t
Enumeration type for the interrupt modes.
Definition: gpio.h:177
uint32_t MXC_GPIO_OutGet(mxc_gpio_regs_t *port, uint32_t mask)
Gets the pin(s) output state.
void MXC_GPIO_RegisterCallback(const mxc_gpio_cfg_t *cfg, mxc_gpio_callback_fn callback, void *cbdata)
Registers a callback for the interrupt on a given port and pin.
void MXC_GPIO_EnableInt(mxc_gpio_regs_t *port, uint32_t mask)
Enables the specified GPIO interrupt.
mxc_gpio_config_lock_t MXC_GPIO_GetConfigLock(void)
Reads the current lock state on pin configuration.
void MXC_GPIO_OutPut(mxc_gpio_regs_t *port, uint32_t mask, uint32_t val)
Write the pin(s) to a desired output level.
int MXC_GPIO_SetVSSEL(mxc_gpio_regs_t *port, mxc_gpio_vssel_t vssel, uint32_t mask)
Set Voltage select for pins to VDDIO or VDDIOH.
int MXC_GPIO_Shutdown(uint32_t portMask)
Shutdown GPIO.
mxc_gpio_func_t
Enumeration type for the GPIO Function Type.
Definition: gpio.h:110
int MXC_GPIO_SetDriveStrength(mxc_gpio_regs_t *port, mxc_gpio_drvstr_t drvstr, uint32_t mask)
Set Drive Strength for pins.
int MXC_GPIO_Init(uint32_t portMask)
Initialize GPIO.
void MXC_GPIO_DisableInt(mxc_gpio_regs_t *port, uint32_t mask)
Disables the specified GPIO interrupt.
uint32_t MXC_GPIO_GetWakeEn(mxc_gpio_regs_t *port)
Returns the pins currently enabled as wakeup sources.
mxc_gpio_pad_t
Enumeration type for the type of GPIO pad on a given pin.
Definition: gpio.h:154
void MXC_GPIO_OutToggle(mxc_gpio_regs_t *port, uint32_t mask)
Toggles the the pin(s) output level.
void MXC_GPIO_ClearWakeEn(mxc_gpio_regs_t *port, uint32_t mask)
Disables GPIO pins from being used as a wakeup source.
void MXC_GPIO_ClearFlags(mxc_gpio_regs_t *port, uint32_t flags)
Gets the interrupt(s) status on a GPIO port.
void MXC_GPIO_OutClr(mxc_gpio_regs_t *port, uint32_t mask)
Clears the pin(s) to a low level output.
void MXC_GPIO_OutSet(mxc_gpio_regs_t *port, uint32_t mask)
Sets the pin(s) to a high level output.
int MXC_GPIO_Reset(uint32_t portMask)
Reset GPIO.
mxc_gpio_drvstr_t
Enumeration type for drive strength on a given pin. This represents what the two GPIO_DS[2] (Drive St...
Definition: gpio.h:144
void(* mxc_gpio_callback_fn)(void *cbdata)
Type alias for a GPIO callback function with prototype:
Definition: gpio.h:105
void MXC_GPIO_Handler(unsigned int port)
GPIO IRQ Handler.
void MXC_GPIO_SetWakeEn(mxc_gpio_regs_t *port, uint32_t mask)
Enables GPIO pins to be used as a wakeup source.
int MXC_GPIO_IntConfig(const mxc_gpio_cfg_t *cfg, mxc_gpio_int_pol_t pol)
Configure GPIO interrupt(s)
void MXC_GPIO_SetConfigLock(mxc_gpio_config_lock_t locked)
Enables/Disables the lock on all pins' configurations. If locked, any changes to a pin's configuratio...
uint32_t MXC_GPIO_InGet(mxc_gpio_regs_t *port, uint32_t mask)
Gets the pin(s) input state.
@ MXC_GPIO_VSSEL_VDDIO
Set pin to VIDDIO voltage.
Definition: gpio.h:123
@ MXC_GPIO_VSSEL_VDDIOH
Set pin to VIDDIOH voltage.
Definition: gpio.h:124
@ MXC_GPIO_INT_BOTH
Interrupt triggers on either edge.
Definition: gpio.h:190
@ MXC_GPIO_INT_RISING
Interrupt triggers on rising edge.
Definition: gpio.h:188
@ MXC_GPIO_INT_LOW
Interrupt triggers when level is low.
Definition: gpio.h:189
@ MXC_GPIO_INT_HIGH
Interrupt triggers when level is high.
Definition: gpio.h:187
@ MXC_GPIO_INT_FALLING
Interrupt triggers on falling edge.
Definition: gpio.h:186
@ MXC_GPIO_CONFIG_LOCKED
Definition: gpio.h:198
@ MXC_GPIO_CONFIG_UNLOCKED
Definition: gpio.h:197
@ MXC_GPIO_INT_LEVEL
Interrupt is level sensitive.
Definition: gpio.h:178
@ MXC_GPIO_INT_EDGE
Interrupt is edge sensitive.
Definition: gpio.h:179
@ MXC_GPIO_FUNC_ALT3
Alternate Function Selection.
Definition: gpio.h:115
@ MXC_GPIO_FUNC_OUT
GPIO Output.
Definition: gpio.h:112
@ MXC_GPIO_FUNC_ALT4
Alternate Function Selection.
Definition: gpio.h:116
@ MXC_GPIO_FUNC_IN
GPIO Input.
Definition: gpio.h:111
@ MXC_GPIO_FUNC_ALT1
Alternate Function Selection.
Definition: gpio.h:113
@ MXC_GPIO_FUNC_ALT2
Alternate Function Selection.
Definition: gpio.h:114
@ MXC_GPIO_PAD_NONE
No pull-up or pull-down.
Definition: gpio.h:155
@ MXC_GPIO_PAD_PULL_UP
Set pad to weak pull-up.
Definition: gpio.h:156
@ MXC_GPIO_PAD_WEAK_PULL_DOWN
Set pad to weak pull-down.
Definition: gpio.h:159
@ MXC_GPIO_PAD_WEAK_PULL_UP
Set pad to weak pull-up.
Definition: gpio.h:158
@ MXC_GPIO_PAD_PULL_DOWN
Set pad to weak pull-down.
Definition: gpio.h:157
@ MXC_GPIO_DRVSTR_3
Drive Strength GPIO_DS[2][pin]=0b11.
Definition: gpio.h:148
@ MXC_GPIO_DRVSTR_1
Drive Strength GPIO_DS[2][pin]=0b01.
Definition: gpio.h:146
@ MXC_GPIO_DRVSTR_0
Drive Strength GPIO_DS[2][pin]=0b00.
Definition: gpio.h:145
@ MXC_GPIO_DRVSTR_2
Drive Strength GPIO_DS[2][pin]=0b10.
Definition: gpio.h:147
Structure type for configuring a GPIO port.
Definition: gpio.h:165