NANO103 BSP V3.01.004
The Board Support Package for Nano103 Series
Macros | Functions
gpio.h File Reference

NANO103 series 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_PMD_INPUT   0x0UL
 
#define GPIO_PMD_OUTPUT   0x1UL
 
#define GPIO_PMD_OPEN_DRAIN   0x2UL
 
#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_ICLK_ON   0x00000020UL
 
#define GPIO_ICLK_OFF   0x00000000UL
 
#define GPIO_DBCLKSRC_IRC10K   0x00000010UL
 
#define GPIO_DBCLKSRC_HCLK   0x00000000UL
 
#define GPIO_DBCLKSEL_1   0x00000000UL
 
#define GPIO_DBCLKSEL_2   0x00000001UL
 
#define GPIO_DBCLKSEL_4   0x00000002UL
 
#define GPIO_DBCLKSEL_8   0x00000003UL
 
#define GPIO_DBCLKSEL_16   0x00000004UL
 
#define GPIO_DBCLKSEL_32   0x00000005UL
 
#define GPIO_DBCLKSEL_64   0x00000006UL
 
#define GPIO_DBCLKSEL_128   0x00000007UL
 
#define GPIO_DBCLKSEL_256   0x00000008UL
 
#define GPIO_DBCLKSEL_512   0x00000009UL
 
#define GPIO_DBCLKSEL_1024   0x0000000AUL
 
#define GPIO_DBCLKSEL_2048   0x0000000BUL
 
#define GPIO_DBCLKSEL_4096   0x0000000CUL
 
#define GPIO_DBCLKSEL_8192   0x0000000DUL
 
#define GPIO_DBCLKSEL_16384   0x0000000EUL
 
#define GPIO_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 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 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_DISABLE_PULL_UP(gpio, u32PinMask)   ((gpio)->PUEN &= ~u32PinMask)
 Disable Pin Pull-up resistor Function. More...
 
#define GPIO_ENABLE_PULL_UP(gpio, u32PinMask)   ((gpio)->PUEN |= u32PinMask)
 Enable Pin Pull-up resistor Function. 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...
 

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

NANO103 series GPIO driver header file.

Version
V1.00
Revision
4
Date
15/12/15 9:30a
Note
SPDX-License-Identifier: Apache-2.0 Copyright (C) 2015 Nuvoton Technology Corp. All rights reserved.

Definition in file gpio.h.