Data Structures | |
struct | XMC_GPIO_CONFIG_t |
struct | XMC_GPIO_PORT_t |
Enumerations | |
enum | XMC_GPIO_HWCTRL_t |
enum | XMC_GPIO_MODE_t |
enum | XMC_GPIO_OUTPUT_LEVEL_t |
enum | XMC_GPIO_OUTPUT_STRENGTH_t |
Functions | |
void | XMC_GPIO_DisableDigitalInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_DisablePowerSaveMode (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_EnableDigitalInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_EnablePowerSaveMode (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
uint32_t | XMC_GPIO_GetInput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_Init (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_CONFIG_t *const config) |
void | XMC_GPIO_SetHardwareControl (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_HWCTRL_t hwctrl) |
void | XMC_GPIO_SetMode (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_MODE_t mode) |
void | XMC_GPIO_SetOutputHigh (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_SetOutputLevel (XMC_GPIO_PORT_t *const port, const uint8_t pin, const XMC_GPIO_OUTPUT_LEVEL_t level) |
void | XMC_GPIO_SetOutputLow (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
void | XMC_GPIO_SetOutputStrength (XMC_GPIO_PORT_t *const port, const uint8_t pin, XMC_GPIO_OUTPUT_STRENGTH_t strength) |
void | XMC_GPIO_ToggleOutput (XMC_GPIO_PORT_t *const port, const uint8_t pin) |
GPIO driver provide a generic and very flexible software interface for all standard digital I/O port pins. Each port slice has individual interfaces for the operation as General Purpose I/O and it further provides the connectivity to the on-chip periphery and the control for the pad characteristics.
The driver is divided into Input and Output mode.
Input mode features:
Output mode features:
enum XMC_GPIO_HWCTRL_t |
Defines direct hardware control characteristics of the pin . Use type XMC_GPIO_HWCTRL_t for this enum.
enum XMC_GPIO_MODE_t |
Defines the direction and characteristics of a pin. Use type XMC_GPIO_MODE_t for this enum. For the operation with alternate functions, the port pins are directly connected to input or output functions of the on-chip periphery.
Defines output strength and slew rate of a pin. Use type XMC_GPIO_OUTPUT_STRENGTH_t for this enum.
void XMC_GPIO_DisableDigitalInput | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_PDISC. |
pin | port pin number. |
void XMC_GPIO_DisablePowerSaveMode | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_PPS. |
pin | port pin number. |
void XMC_GPIO_EnableDigitalInput | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_PDISC. |
pin | port pin number. |
void XMC_GPIO_EnablePowerSaveMode | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_PPS. |
pin | port pin number. |
Note:
Do not enable the Pin Power Save function for pins configured for Hardware Control (Pn_HWSEL.HWx != 00B). Doing so may result in an undefined behavior of the pin when the device enters the Deep Sleep state.
uint32_t XMC_GPIO_GetInput | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_IN. |
pin | Port pin number. |
void XMC_GPIO_Init | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin, | ||
const XMC_GPIO_CONFIG_t *const | config | ||
) |
port | Constant pointer pointing to GPIO port, to access port registers like Pn_OUT,Pn_OMR,Pn_IOCR etc. |
pin | Port pin number. |
config | GPIO configuration data structure. Refer data structure XMC_GPIO_CONFIG_t for details. |
void XMC_GPIO_SetHardwareControl | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin, | ||
const XMC_GPIO_HWCTRL_t | hwctrl | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_HWSEL. |
pin | port pin number. |
hwctrl | direct hardware control selection. Refer XMC_GPIO_HWCTRL_t for valid values. |
void XMC_GPIO_SetMode | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin, | ||
const XMC_GPIO_MODE_t | mode | ||
) |
port | Constant pointer pointing to GPIO port, to access hardware register Pn_IOCR. |
pin | Port pin number. |
mode | input / output functionality selection. Refer XMC_GPIO_MODE_t for valid values. |
void XMC_GPIO_SetOutputHigh | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
pin | Port pin number. |
void XMC_GPIO_SetOutputLevel | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin, | ||
const XMC_GPIO_OUTPUT_LEVEL_t | level | ||
) |
port | Constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
pin | Port pin number. |
level | output level selection. Refer XMC_GPIO_OUTPUT_LEVEL_t for valid values. |
void XMC_GPIO_SetOutputLow | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
pin | port pin number. |
void XMC_GPIO_SetOutputStrength | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin, | ||
XMC_GPIO_OUTPUT_STRENGTH_t | strength | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_PDR. |
pin | Port pin number. |
strength | Output driver mode selection. Refer data structure XMC_GPIO_OUTPUT_STRENGTH_t for details. |
void XMC_GPIO_ToggleOutput | ( | XMC_GPIO_PORT_t *const | port, |
const uint8_t | pin | ||
) |
port | constant pointer pointing to GPIO port, to access hardware register Pn_OMR. |
pin | port pin number. |