NUC472_NUC442_BSP V3.03.005
The Board Support Package for NUC472/NUC442
Macros | Functions
gpio.h File Reference

NUC472/NUC442 GPIO driver header file. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define GPIO_PIN_MAX   16
 
#define GPIO_MODE_INPUT   0x0UL
 
#define GPIO_MODE_OUTPUT   0x1UL
 
#define GPIO_MODE_OPEN_DRAIN   0x2UL
 
#define GPIO_MODE_QUASI   0x3UL
 
#define GPIO_INT_RISING   0x00010000UL
 
#define GPIO_INT_FALLING   0x00000001UL
 
#define GPIO_INT_BOTH_EDGE   0x00010001UL
 
#define GPIO_INT_HIGH   0x01010000UL
 
#define GPIO_INT_LOW   0x01000001UL
 
#define GPIO_IMD_EDGE   0UL
 
#define GPIO_IMD_LEVEL   1UL
 
#define GPIO_DBCTL_ICLK_ON   0x00000020UL
 
#define GPIO_DBCTL_ICLK_OFF   0x00000000UL
 
#define GPIO_DBCTL_DBCLKSRC_IRC10K   0x00000010UL
 
#define GPIO_DBCTL_DBCLKSRC_HCLK   0x00000000UL
 
#define GPIO_DBCTL_DBCLKSEL_1   0x00000000UL
 
#define GPIO_DBCTL_DBCLKSEL_2   0x00000001UL
 
#define GPIO_DBCTL_DBCLKSEL_4   0x00000002UL
 
#define GPIO_DBCTL_DBCLKSEL_8   0x00000003UL
 
#define GPIO_DBCTL_DBCLKSEL_16   0x00000004UL
 
#define GPIO_DBCTL_DBCLKSEL_32   0x00000005UL
 
#define GPIO_DBCTL_DBCLKSEL_64   0x00000006UL
 
#define GPIO_DBCTL_DBCLKSEL_128   0x00000007UL
 
#define GPIO_DBCTL_DBCLKSEL_256   0x00000008UL
 
#define GPIO_DBCTL_DBCLKSEL_512   0x00000009UL
 
#define GPIO_DBCTL_DBCLKSEL_1024   0x0000000AUL
 
#define GPIO_DBCTL_DBCLKSEL_2048   0x0000000BUL
 
#define GPIO_DBCTL_DBCLKSEL_4096   0x0000000CUL
 
#define GPIO_DBCTL_DBCLKSEL_8192   0x0000000DUL
 
#define GPIO_DBCTL_DBCLKSEL_16384   0x0000000EUL
 
#define GPIO_DBCTL_DBCLKSEL_32768   0x0000000FUL
 
#define GPIO_PIN_ADDR(port, pin)   (*((volatile uint32_t *)((GPIO_PIN_DATA_BASE+(0x40*(port))) + ((pin)<<2))))
 
#define PA0   GPIO_PIN_ADDR(0, 0)
 
#define PA1   GPIO_PIN_ADDR(0, 1)
 
#define PA2   GPIO_PIN_ADDR(0, 2)
 
#define PA3   GPIO_PIN_ADDR(0, 3)
 
#define PA4   GPIO_PIN_ADDR(0, 4)
 
#define PA5   GPIO_PIN_ADDR(0, 5)
 
#define PA6   GPIO_PIN_ADDR(0, 6)
 
#define PA7   GPIO_PIN_ADDR(0, 7)
 
#define PA8   GPIO_PIN_ADDR(0, 8)
 
#define PA9   GPIO_PIN_ADDR(0, 9)
 
#define PA10   GPIO_PIN_ADDR(0, 10)
 
#define PA11   GPIO_PIN_ADDR(0, 11)
 
#define PA12   GPIO_PIN_ADDR(0, 12)
 
#define PA13   GPIO_PIN_ADDR(0, 13)
 
#define PA14   GPIO_PIN_ADDR(0, 14)
 
#define PA15   GPIO_PIN_ADDR(0, 15)
 
#define PB0   GPIO_PIN_ADDR(1, 0)
 
#define PB1   GPIO_PIN_ADDR(1, 1)
 
#define PB2   GPIO_PIN_ADDR(1, 2)
 
#define PB3   GPIO_PIN_ADDR(1, 3)
 
#define PB4   GPIO_PIN_ADDR(1, 4)
 
#define PB5   GPIO_PIN_ADDR(1, 5)
 
#define PB6   GPIO_PIN_ADDR(1, 6)
 
#define PB7   GPIO_PIN_ADDR(1, 7)
 
#define PB8   GPIO_PIN_ADDR(1, 8)
 
#define PB9   GPIO_PIN_ADDR(1, 9)
 
#define PB10   GPIO_PIN_ADDR(1, 10)
 
#define PB11   GPIO_PIN_ADDR(1, 11)
 
#define PB12   GPIO_PIN_ADDR(1, 12)
 
#define PB13   GPIO_PIN_ADDR(1, 13)
 
#define PB14   GPIO_PIN_ADDR(1, 14)
 
#define PB15   GPIO_PIN_ADDR(1, 15)
 
#define PC0   GPIO_PIN_ADDR(2, 0)
 
#define PC1   GPIO_PIN_ADDR(2, 1)
 
#define PC2   GPIO_PIN_ADDR(2, 2)
 
#define PC3   GPIO_PIN_ADDR(2, 3)
 
#define PC4   GPIO_PIN_ADDR(2, 4)
 
#define PC5   GPIO_PIN_ADDR(2, 5)
 
#define PC6   GPIO_PIN_ADDR(2, 6)
 
#define PC7   GPIO_PIN_ADDR(2, 7)
 
#define PC8   GPIO_PIN_ADDR(2, 8)
 
#define PC9   GPIO_PIN_ADDR(2, 9)
 
#define PC10   GPIO_PIN_ADDR(2, 10)
 
#define PC11   GPIO_PIN_ADDR(2, 11)
 
#define PC12   GPIO_PIN_ADDR(2, 12)
 
#define PC13   GPIO_PIN_ADDR(2, 13)
 
#define PC14   GPIO_PIN_ADDR(2, 14)
 
#define PC15   GPIO_PIN_ADDR(2, 15)
 
#define PD0   GPIO_PIN_ADDR(3, 0)
 
#define PD1   GPIO_PIN_ADDR(3, 1)
 
#define PD2   GPIO_PIN_ADDR(3, 2)
 
#define PD3   GPIO_PIN_ADDR(3, 3)
 
#define PD4   GPIO_PIN_ADDR(3, 4)
 
#define PD5   GPIO_PIN_ADDR(3, 5)
 
#define PD6   GPIO_PIN_ADDR(3, 6)
 
#define PD7   GPIO_PIN_ADDR(3, 7)
 
#define PD8   GPIO_PIN_ADDR(3, 8)
 
#define PD9   GPIO_PIN_ADDR(3, 9)
 
#define PD10   GPIO_PIN_ADDR(3, 10)
 
#define PD11   GPIO_PIN_ADDR(3, 11)
 
#define PD12   GPIO_PIN_ADDR(3, 12)
 
#define PD13   GPIO_PIN_ADDR(3, 13)
 
#define PD14   GPIO_PIN_ADDR(3, 14)
 
#define PD15   GPIO_PIN_ADDR(3, 15)
 
#define PE0   GPIO_PIN_ADDR(4, 0)
 
#define PE1   GPIO_PIN_ADDR(4, 1)
 
#define PE2   GPIO_PIN_ADDR(4, 2)
 
#define PE3   GPIO_PIN_ADDR(4, 3)
 
#define PE4   GPIO_PIN_ADDR(4, 4)
 
#define PE5   GPIO_PIN_ADDR(4, 5)
 
#define PE6   GPIO_PIN_ADDR(4, 6)
 
#define PE7   GPIO_PIN_ADDR(4, 7)
 
#define PE8   GPIO_PIN_ADDR(4, 8)
 
#define PE9   GPIO_PIN_ADDR(4, 9)
 
#define PE10   GPIO_PIN_ADDR(4, 10)
 
#define PE11   GPIO_PIN_ADDR(4, 11)
 
#define PE12   GPIO_PIN_ADDR(4, 12)
 
#define PE13   GPIO_PIN_ADDR(4, 13)
 
#define PE14   GPIO_PIN_ADDR(4, 14)
 
#define PE15   GPIO_PIN_ADDR(4, 15)
 
#define PF0   GPIO_PIN_ADDR(5, 0)
 
#define PF1   GPIO_PIN_ADDR(5, 1)
 
#define PF2   GPIO_PIN_ADDR(5, 2)
 
#define PF3   GPIO_PIN_ADDR(5, 3)
 
#define PF4   GPIO_PIN_ADDR(5, 4)
 
#define PF5   GPIO_PIN_ADDR(5, 5)
 
#define PF6   GPIO_PIN_ADDR(5, 6)
 
#define PF7   GPIO_PIN_ADDR(5, 7)
 
#define PF8   GPIO_PIN_ADDR(5, 8)
 
#define PF9   GPIO_PIN_ADDR(5, 9)
 
#define PF10   GPIO_PIN_ADDR(5, 10)
 
#define PF11   GPIO_PIN_ADDR(5, 11)
 
#define PF12   GPIO_PIN_ADDR(5, 12)
 
#define PF13   GPIO_PIN_ADDR(5, 13)
 
#define PF14   GPIO_PIN_ADDR(5, 14)
 
#define PF15   GPIO_PIN_ADDR(5, 15)
 
#define PG0   GPIO_PIN_ADDR(6, 0)
 
#define PG1   GPIO_PIN_ADDR(6, 1)
 
#define PG2   GPIO_PIN_ADDR(6, 2)
 
#define PG3   GPIO_PIN_ADDR(6, 3)
 
#define PG4   GPIO_PIN_ADDR(6, 4)
 
#define PG5   GPIO_PIN_ADDR(6, 5)
 
#define PG6   GPIO_PIN_ADDR(6, 6)
 
#define PG7   GPIO_PIN_ADDR(6, 7)
 
#define PG8   GPIO_PIN_ADDR(6, 8)
 
#define PG9   GPIO_PIN_ADDR(6, 9)
 
#define PG10   GPIO_PIN_ADDR(6, 10)
 
#define PG11   GPIO_PIN_ADDR(6, 11)
 
#define PG12   GPIO_PIN_ADDR(6, 12)
 
#define PG13   GPIO_PIN_ADDR(6, 13)
 
#define PG14   GPIO_PIN_ADDR(6, 14)
 
#define PG15   GPIO_PIN_ADDR(6, 15)
 
#define PH0   GPIO_PIN_ADDR(7, 0)
 
#define PH1   GPIO_PIN_ADDR(7, 1)
 
#define PH2   GPIO_PIN_ADDR(7, 2)
 
#define PH3   GPIO_PIN_ADDR(7, 3)
 
#define PH4   GPIO_PIN_ADDR(7, 4)
 
#define PH5   GPIO_PIN_ADDR(7, 5)
 
#define PH6   GPIO_PIN_ADDR(7, 6)
 
#define PH7   GPIO_PIN_ADDR(7, 7)
 
#define PH8   GPIO_PIN_ADDR(7, 8)
 
#define PH9   GPIO_PIN_ADDR(7, 9)
 
#define PH10   GPIO_PIN_ADDR(7, 10)
 
#define PH11   GPIO_PIN_ADDR(7, 11)
 
#define PH12   GPIO_PIN_ADDR(7, 12)
 
#define PH13   GPIO_PIN_ADDR(7, 13)
 
#define PH14   GPIO_PIN_ADDR(7, 14)
 
#define PH15   GPIO_PIN_ADDR(7, 15)
 
#define PI0   GPIO_PIN_ADDR(8, 0)
 
#define PI1   GPIO_PIN_ADDR(8, 1)
 
#define PI2   GPIO_PIN_ADDR(8, 2)
 
#define PI3   GPIO_PIN_ADDR(8, 3)
 
#define PI4   GPIO_PIN_ADDR(8, 4)
 
#define PI5   GPIO_PIN_ADDR(8, 5)
 
#define PI6   GPIO_PIN_ADDR(8, 6)
 
#define PI7   GPIO_PIN_ADDR(8, 7)
 
#define PI8   GPIO_PIN_ADDR(8, 8)
 
#define PI9   GPIO_PIN_ADDR(8, 9)
 
#define PI10   GPIO_PIN_ADDR(8, 10)
 
#define PI11   GPIO_PIN_ADDR(8, 11)
 
#define PI12   GPIO_PIN_ADDR(8, 12)
 
#define PI13   GPIO_PIN_ADDR(8, 13)
 
#define PI14   GPIO_PIN_ADDR(8, 14)
 
#define PI15   GPIO_PIN_ADDR(8, 15)
 
#define GPIO_CLR_INT_FLAG(gpio, u32PinMask)   ((gpio)->INTSRC = u32PinMask)
 Clear GPIO Pin Interrupt Flag. More...
 
#define GPIO_DISABLE_DEBOUNCE(gpio, u32PinMask)   ((gpio)->DBEN &= ~u32PinMask)
 Disable Pin De-bounce Function. More...
 
#define GPIO_ENABLE_DEBOUNCE(gpio, u32PinMask)   ((gpio)->DBEN |= u32PinMask)
 Enable Pin De-bounce Function. More...
 
#define GPIO_DISABLE_DIGITAL_PATH(gpio, u32PinMask)   ((gpio)->DINOFF |= (u32PinMask << 16))
 Disable I/O Digital Input Path. More...
 
#define GPIO_ENABLE_DIGITAL_PATH(gpio, u32PinMask)   ((gpio)->DINOFF &= ~(u32PinMask << 16))
 Enable I/O Digital Input Path. More...
 
#define GPIO_DISABLE_DOUT_MASK(gpio, u32PinMask)   ((gpio)->DATMSK &= ~u32PinMask)
 Disable I/O DOUT mask. More...
 
#define GPIO_ENABLE_DOUT_MASK(gpio, u32PinMask)   ((gpio)->DATMSK |= u32PinMask)
 Enable I/O DOUT mask. More...
 
#define GPIO_GET_INT_FLAG(gpio, u32PinMask)   ((gpio)->INTSRC & u32PinMask)
 Get GPIO Pin Interrupt Flag. More...
 
#define GPIO_SET_DEBOUNCE_TIME(u32ClkSrc, u32ClkSel)   (GPIO->DBCTL = (GPIO_DBCTL_ICLKON_Msk | u32ClkSrc | u32ClkSel))
 Set De-bounce Sampling Cycle Time. More...
 
#define GPIO_GET_IN_DATA(gpio)   ((gpio)->PIN)
 Get GPIO Port IN Data. More...
 
#define GPIO_SET_OUT_DATA(gpio, u32Data)   ((gpio)->DOUT = (u32Data))
 Set GPIO Port OUT Data. More...
 
#define GPIO_TOGGLE(u32Pin)   ((u32Pin) ^= 1)
 Toggle Specified GPIO pin. More...
 
#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...
 
#define GPIO_EnableEINT   GPIO_EnableInt
 Enable External GPIO interrupt n. More...
 
#define GPIO_DisableEINT   GPIO_DisableInt
 Disable External GPIO interrupt n. More...
 

Functions

void GPIO_SetMode (GPIO_T *gpio, uint32_t u32PinMask, uint32_t u32Mode)
 Set GPIO operation mode. More...
 
void GPIO_EnableInt (GPIO_T *gpio, uint32_t u32Pin, uint32_t u32IntAttribs)
 Enable GPIO interrupt. More...
 
void GPIO_DisableInt (GPIO_T *gpio, uint32_t u32Pin)
 Disable GPIO interrupt. More...
 

Detailed Description

NUC472/NUC442 GPIO driver header file.

Version
V1.00
Revision
13
Date
14/12/01 10:32a
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2014 Nuvoton Technology Corp. All rights reserved.

Definition in file gpio.h.