PAN1080 Peripheral API
|
Gpio Interface. More...
Modules | |
Gpio mode | |
Gpio mode definitions. | |
Gpio interrupt type | |
Gpio interrupt type definitions. | |
Gpio debounce src | |
Gpio debouce src definitions. | |
Gpio debounce count | |
Gpio debouce count definitions. | |
Gpio address map | |
Macros | |
#define | GPIO_PIN_MAX 8 |
#define | GPIO_EnableEINT0 GPIO_EnableInt |
Enable External GPIO interrupt 0. More... | |
#define | GPIO_DisableEINT0 GPIO_DisableInt |
Disable External GPIO interrupt 0. More... | |
#define | GPIO_EnableEINT1 GPIO_EnableInt |
Enable External GPIO interrupt 1. More... | |
#define | GPIO_DisableEINT1 GPIO_DisableInt |
Disable External GPIO interrupt 1. More... | |
Functions | |
__STATIC_INLINE void | GPIO_ClrIntFlag (GPIO_T *gpio, uint32_t PinMask) |
Clear GPIO Pin Interrupt Flag. More... | |
__STATIC_INLINE void | GPIO_ClrAllIntFlag (GPIO_T *gpio) |
Clear GPIO Pin Interrupt Flag. More... | |
__STATIC_INLINE void | GPIO_DisableDebounce (GPIO_T *gpio, uint32_t PinMask) |
Disable Pin De-bounce Function. More... | |
__STATIC_INLINE void | GPIO_EnableDebounce (GPIO_T *gpio, uint32_t PinMask) |
Enable Pin De-bounce Function. More... | |
__STATIC_INLINE void | GPIO_DisableDigitalPath (GPIO_T *gpio, uint32_t PinMask) |
Disable I/O Digital Input Path. More... | |
__STATIC_INLINE void | GPIO_EnableDigitalPath (GPIO_T *gpio, uint32_t PinMask) |
Enable I/O Digital Input Path. More... | |
__STATIC_INLINE void | GPIO_DisablePullupPath (GPIO_T *gpio, uint32_t PinMask) |
Disable I/O Digital pull up Path. More... | |
__STATIC_INLINE void | GPIO_EnablePullupPath (GPIO_T *gpio, uint32_t PinMask) |
Enable I/O Digital pull up Path. More... | |
__STATIC_INLINE void | GPIO_DisablePulldownPath (GPIO_T *gpio, uint32_t PinMask) |
Disable I/O Digital pull down Path. More... | |
__STATIC_INLINE void | GPIO_EnablePulldownPath (GPIO_T *gpio, uint32_t PinMask) |
Enable I/O Digital pull down Path. More... | |
__STATIC_INLINE void | GPIO_DisableDoutMask (GPIO_T *gpio, uint32_t PinMask) |
Disable I/O DOUT mask. More... | |
__STATIC_INLINE void | GPIO_EnableDoutMask (GPIO_T *gpio, uint32_t PinMask) |
Enable I/O DOUT mask. More... | |
__STATIC_INLINE bool | GPIO_GetIntFlag (GPIO_T *gpio, uint32_t PinMask) |
Get GPIO Pin Interrupt Flag. More... | |
__STATIC_INLINE void | GPIO_SetDebounceTime (GPIO_ClkSrcDef ClkSrc, GPIO_ClkSelDef ClkSel) |
Set De-bounce Sampling Cycle Time. More... | |
__STATIC_INLINE uint32_t | GPIO_GetInData (GPIO_T *gpio) |
Get GPIO Port IN Data. More... | |
__STATIC_INLINE void | GPIO_SetOutData (GPIO_T *gpio, uint32_t data) |
Set GPIO Port OUT Data. More... | |
__STATIC_INLINE uint32_t | GPIO_GetOutData (GPIO_T *gpio) |
Get GPIO Port OUT Data. More... | |
__STATIC_INLINE void | GPIO_Toggle (GPIO_T *gpio, uint32_t u32PinMask) |
Toggle Specified GPIO pin. More... | |
__STATIC_INLINE void | GPIO_TogglePin (uint32_t u32Pin) |
Toggle Specified GPIO pin. More... | |
__STATIC_INLINE void | GPIO_EnableInt (GPIO_T *gpio, uint32_t Pin, GPIO_IntAttrDef IntAttribs) |
Enable GPIO interrupt. More... | |
__STATIC_INLINE void | GPIO_DisableInt (GPIO_T *gpio, uint32_t Pin) |
Disable GPIO interrupt. More... | |
void | GPIO_SetMode (GPIO_T *gpio, uint32_t PinMask, GPIO_ModeDef Mode) |
Set GPIO Work Mode. More... | |
Gpio Interface.
#define GPIO_DisableEINT0 GPIO_DisableInt |
Disable External GPIO interrupt 0.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. It could be 0 ~ 7. |
This function is used to disable specified GPIO pin interrupt.
#define GPIO_DisableEINT1 GPIO_DisableInt |
Disable External GPIO interrupt 1.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. It could be 0 ~ 7. |
This function is used to disable specified GPIO pin interrupt.
#define GPIO_EnableEINT0 GPIO_EnableInt |
Enable External GPIO interrupt 0.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. |
[in] | IntAttribs | The interrupt attribute of specified GPIO pin. It could be |
This function is used to enable specified GPIO pin interrupt.
#define GPIO_EnableEINT1 GPIO_EnableInt |
Enable External GPIO interrupt 1.
[in] | gpio | GPIO port. It could P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. |
[in] | IntAttribs | The interrupt attribute of specified GPIO pin. It could be |
This function is used to enable specified GPIO pin interrupt.
#define GPIO_PIN_MAX 8 |
Specify Maximum Pins of Each GPIO Port
__STATIC_INLINE void GPIO_ClrAllIntFlag | ( | GPIO_T * | gpio | ) |
Clear GPIO Pin Interrupt Flag.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
Clear the interrupt status of All GPIO pin.
__STATIC_INLINE void GPIO_ClrIntFlag | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Clear GPIO Pin Interrupt Flag.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Clear the interrupt status of specified GPIO pin.
__STATIC_INLINE void GPIO_DisableDebounce | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Disable Pin De-bounce Function.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Disable the interrupt de-bounce function of specified GPIO pin.
__STATIC_INLINE void GPIO_DisableDigitalPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Disable I/O Digital Input Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Disable I/O digital input path of specified GPIO pin.
__STATIC_INLINE void GPIO_DisableDoutMask | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Disable I/O DOUT mask.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Disable I/O DOUT mask of specified GPIO pin.
__STATIC_INLINE void GPIO_DisableInt | ( | GPIO_T * | gpio, |
uint32_t | Pin | ||
) |
Disable GPIO interrupt.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. It could be 0 ~ 7. |
This function is used to enable specified GPIO pin interrupt.
__STATIC_INLINE void GPIO_DisablePulldownPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Disable I/O Digital pull down Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Disable I/O Digital pull down Path of specified GPIO pin.
__STATIC_INLINE void GPIO_DisablePullupPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Disable I/O Digital pull up Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Disable I/O Digital pull up Path of specified GPIO pin.
__STATIC_INLINE void GPIO_EnableDebounce | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Enable Pin De-bounce Function.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Enable the interrupt de-bounce function of specified GPIO pin.
__STATIC_INLINE void GPIO_EnableDigitalPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Enable I/O Digital Input Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Enable I/O digital input path of specified GPIO pin.
__STATIC_INLINE void GPIO_EnableDoutMask | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Enable I/O DOUT mask.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Enable I/O DOUT mask of specified GPIO pin.
__STATIC_INLINE void GPIO_EnableInt | ( | GPIO_T * | gpio, |
uint32_t | Pin, | ||
GPIO_IntAttrDef | IntAttribs | ||
) |
Enable GPIO interrupt.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | Pin | The pin of specified GPIO port. It could be 0 ~ 7. |
[in] | IntAttribs | The interrupt attribute of specified GPIO pin. It could be |
This function is used to enable specified GPIO pin interrupt.
__STATIC_INLINE void GPIO_EnablePulldownPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Enable I/O Digital pull down Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Enable I/O Digital pull down Path of specified GPIO pin.
__STATIC_INLINE void GPIO_EnablePullupPath | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Enable I/O Digital pull up Path.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
Enable I/O Digital pull up Path of specified GPIO pin.
__STATIC_INLINE uint32_t GPIO_GetInData | ( | GPIO_T * | gpio | ) |
Get GPIO Port IN Data.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
Get the PIN register of specified GPIO port.
__STATIC_INLINE bool GPIO_GetIntFlag | ( | GPIO_T * | gpio, |
uint32_t | PinMask | ||
) |
Get GPIO Pin Interrupt Flag.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
false | No interrupt at specified GPIO pin |
true | The specified GPIO pin generate an interrupt |
Get the interrupt status of specified GPIO pin.
__STATIC_INLINE uint32_t GPIO_GetOutData | ( | GPIO_T * | gpio | ) |
Get GPIO Port OUT Data.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
Get the DOUT register of specified GPIO port.
__STATIC_INLINE void GPIO_SetDebounceTime | ( | GPIO_ClkSrcDef | ClkSrc, |
GPIO_ClkSelDef | ClkSel | ||
) |
Set De-bounce Sampling Cycle Time.
[in] | clksrc | The de-bounce counter clock source. It could be GPIO_DBCTL_DBCLKSRC_HCLK
|
[in] | clksel | The de-bounce sampling cycle selection. It could be
|
Set the interrupt de-bounce sampling cycle time based on the debounce counter clock source.
Example: GPIO_SET_DEBOUNCE_TIME(GPIO_DBCTL_DBCLKSRC_RCL, GPIO_DBCTL_DBCLKSEL_4).
It's meaning the De-debounce counter clock source is internal 10 KHz and sampling cycle selection is 4.
Then the target de-bounce sampling cycle time is (2^4)*(1/(10*1000)) s = 16*0.0001 s = 1600 us, and system will sampling interrupt input once per 1600 us.
void GPIO_SetMode | ( | GPIO_T * | gpio, |
uint32_t | PinMask, | ||
GPIO_ModeDef | Mode | ||
) |
Set GPIO Work Mode.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7. |
[in] | Mode | Gpio mode definitions (see GPIO_ModeDef). |
None |
Set the GPIO pin work mode.
__STATIC_INLINE void GPIO_SetOutData | ( | GPIO_T * | gpio, |
uint32_t | data | ||
) |
Set GPIO Port OUT Data.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | data | GPIO port data. |
None |
Set the Data into specified GPIO port.
__STATIC_INLINE void GPIO_Toggle | ( | GPIO_T * | gpio, |
uint32_t | u32PinMask | ||
) |
Toggle Specified GPIO pin.
[in] | gpio | GPIO port. It could be P0, P1, P2, P3, P4 or P5. |
[in] | u32PinMask | The single or multiple pins of specified GPIO port. BIT0, BIT1, BIT2,.. BIT7 |
None |
Toggle the specified GPIO pin output.
__STATIC_INLINE void GPIO_TogglePin | ( | uint32_t | u32Pin | ) |
Toggle Specified GPIO pin.
[in] | u32Pin | Pxy |
None |
Toggle the specified GPIO pin output.