|  | MAX32655 Peripheral Driver API
    Peripheral Driver API for the MAX32655 | 
| Modules | |
| Port and Pin Definitions | |
| GPIO_Registers | |
| Data Structures | |
| struct | mxc_gpio_cfg_t | 
| Typedefs | |
| typedef void(* | mxc_gpio_callback_fn) (void *cbdata) | 
| Enumerations | |
| enum | mxc_gpio_func_t | 
| enum | mxc_gpio_vssel_t | 
| enum | mxc_gpio_drvstr_t | 
| enum | mxc_gpio_pad_t | 
| enum | mxc_gpio_int_mode_t | 
| enum | mxc_gpio_int_pol_t | 
| enum | mxc_gpio_config_lock_t | 
| struct mxc_gpio_cfg_t | 
Structure type for configuring a GPIO port.
| Data Fields | |
| mxc_gpio_regs_t * | port | 
| uint32_t | mask | 
| mxc_gpio_func_t | func | 
| mxc_gpio_pad_t | pad | 
| mxc_gpio_vssel_t | vssel | 
| mxc_gpio_drvstr_t | drvstr | 
| mxc_gpio_drvstr_t drvstr | 
Drive Strength select
| mxc_gpio_func_t func | 
Function type
| uint32_t mask | 
Pin mask (multiple pins may be set)
| mxc_gpio_pad_t pad | 
Pad type
| mxc_gpio_regs_t* port | 
Pointer to GPIO regs
| mxc_gpio_vssel_t vssel | 
Voltage select
| typedef void(* mxc_gpio_callback_fn) (void *cbdata) | 
Type alias for a GPIO callback function with prototype:
| cbdata | A void pointer to the data type as registered when MXC_GPIO_RegisterCallback() was called. | 
| enum mxc_gpio_drvstr_t | 
Enumeration type for drive strength on a given pin. This represents what the two GPIO_DS[2] (Drive Strength) registers are set to for a given GPIO pin; NOT the drive strength level.
For example: MXC_GPIO_DRVSTR_0: GPIO_DS1[pin] = 0; GPIO_DS0[pin] = 0 MXC_GPIO_DRVSTR_1: GPIO_DS1[pin] = 0; GPIO_DS0[pin] = 1 MXC_GPIO_DRVSTR_2: GPIO_DS1[pin] = 1; GPIO_DS0[pin] = 0 MXC_GPIO_DRVSTR_3: GPIO_DS1[pin] = 1; GPIO_DS0[pin] = 1
Refer to the user guide and datasheet to select the appropriate drive strength. Note: the drive strength values are not linear, and can vary from pin-to-pin and the state of the GPIO pin (alternate function and voltage level).
| enum mxc_gpio_func_t | 
Enumeration type for the GPIO Function Type.
| enum mxc_gpio_int_mode_t | 
| enum mxc_gpio_int_pol_t | 
Enumeration type for the interrupt polarity.
| enum mxc_gpio_pad_t | 
Enumeration type for the type of GPIO pad on a given pin.
| enum mxc_gpio_vssel_t | 
| void MXC_GPIO_ClearFlags | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | flags | ||
| ) | 
Gets the interrupt(s) status on a GPIO port.
| port | Pointer to the GPIO port registers | 
| flags | The flags to clear | 
| void MXC_GPIO_ClearWakeEn | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Disables GPIO pins from being used as a wakeup source.
| port | The GPIO port | 
| mask | Pins in the GPIO port that will be disabled as a wakeup source. | 
| int MXC_GPIO_Config | ( | const mxc_gpio_cfg_t * | cfg | ) | 
Configure GPIO pin(s).
| cfg | Pointer to configuration structure describing the pin. | 
| void MXC_GPIO_DisableInt | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Disables the specified GPIO interrupt.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to disable interrupts for | 
| void MXC_GPIO_EnableInt | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Enables the specified GPIO interrupt.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to enable interrupts for | 
| mxc_gpio_config_lock_t MXC_GPIO_GetConfigLock | ( | void | ) | 
Reads the current lock state on pin configuration.
| uint32_t MXC_GPIO_GetFlags | ( | mxc_gpio_regs_t * | port | ) | 
Gets the interrupt(s) status on a GPIO port.
| port | Pointer to the GPIO port registers | 
| uint32_t MXC_GPIO_GetWakeEn | ( | mxc_gpio_regs_t * | port | ) | 
Returns the pins currently enabled as wakeup sources.
| port | The GPIO port to check. | 
| void MXC_GPIO_Handler | ( | unsigned int | port | ) | 
GPIO IRQ Handler.
| port | Number of the port that generated the interrupt service routine. | 
| uint32_t MXC_GPIO_InGet | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Gets the pin(s) input state.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to read | 
| int MXC_GPIO_Init | ( | uint32_t | portMask | ) | 
Initialize GPIO.
| portMask | Mask for the port to be initialized | 
| int MXC_GPIO_IntConfig | ( | const mxc_gpio_cfg_t * | cfg, | 
| mxc_gpio_int_pol_t | pol | ||
| ) | 
Configure GPIO interrupt(s)
| cfg | Pointer to configuration structure describing the pin. | 
| pol | Requested interrupt polarity. | 
| void MXC_GPIO_OutClr | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Clears the pin(s) to a low level output.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to clear | 
| uint32_t MXC_GPIO_OutGet | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Gets the pin(s) output state.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to read the output state of | 
| void MXC_GPIO_OutPut | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask, | ||
| uint32_t | val | ||
| ) | 
Write the pin(s) to a desired output level.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to set output level of | 
| val | Desired output level of the pin(s). This will be masked with the configuration mask. | 
| void MXC_GPIO_OutSet | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Sets the pin(s) to a high level output.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to set | 
| void MXC_GPIO_OutToggle | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Toggles the the pin(s) output level.
| port | Pointer to the GPIO port registers | 
| mask | Mask of the pin(s) to toggle the output | 
| 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.
| cfg | Pointer to configuration structure describing the pin | 
| callback | A pointer to a function of type #callback_fn. | 
| cbdata | The parameter to be passed to the callback function, #callback_fn, when an interrupt occurs. | 
| int MXC_GPIO_Reset | ( | uint32_t | portMask | ) | 
Reset GPIO.
| portMask | Mask for the port to be initialized | 
| 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 configuration made through the MXC_GPIO_Config function will be ignored.
| locked | Determines if changes will be allowed. | 
| int MXC_GPIO_SetDriveStrength | ( | mxc_gpio_regs_t * | port, | 
| mxc_gpio_drvstr_t | drvstr, | ||
| uint32_t | mask | ||
| ) | 
Set Drive Strength for pins.
| port | The GPIO port. | |
| [in] | ds | Drive strength level. Ref /mxc_gpio_ds_t enum type. | 
| [in] | mask | Pins in the GPIO port that will be set to the voltage. | 
| 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.
| port | Pointer to the GPIO port registers | |
| [in] | vssel | VDDIO or VDDIOH to set the voltatge to | 
| [in] | mask | Pins in the GPIO port that will be set to the voltage. | 
| void MXC_GPIO_SetWakeEn | ( | mxc_gpio_regs_t * | port, | 
| uint32_t | mask | ||
| ) | 
Enables GPIO pins to be used as a wakeup source.
| port | The GPIO port | 
| mask | Pins in the GPIO port that will be enabled as a wakeup source. | 
| int MXC_GPIO_Shutdown | ( | uint32_t | portMask | ) | 
Shutdown GPIO.
| portMask | Mask for the port to be initialized |