Nano100BN Series BSP  V3.03.002
The Board Support Package for Nano100BN Series
NuEdu-Basic01_Button.c
Go to the documentation of this file.
1 /**************************************************************************/
12 #include <stdio.h>
13 #include "Nano100Series.h"
25 /*---------------------------------------------------------------------------------------------------------*/
26 /* GPIO for Button Definitions */
27 /*---------------------------------------------------------------------------------------------------------*/
28 #define KEY1_INPUT PD12
29 #define KEY2_INPUT PE12
30 #define KEY3_INPUT PD0
31 #define KEY4_INPUT PD1
37 void Initial_KEY_INPUT(void)
38 {
43 }
48 unsigned char Get_KEY_INPUT(void)
49 {
50  unsigned char temp=0;
51  if (KEY1_INPUT == 1)
52  temp|=0x1;
53 
54  if (KEY2_INPUT == 1)
55  temp|=0x2;
56 
57  if (KEY3_INPUT == 1)
58  temp|=0x4;
59 
60  if (KEY4_INPUT == 1)
61  temp|=0x8;
62  return temp;
63 } /* end of group Nano130_Basic01_FUNCTIONS */
65  /* end of group NuEdu-SDK-Nano130_Basic01 */
67  /* end of group NANO100_Library */
69 
70 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
#define KEY4_INPUT
#define PD
Pointer to GPIO port D register structure.
#define KEY1_INPUT
#define KEY3_INPUT
#define BIT12
Bit 12 mask of an 32 bit integer.
#define GPIO_PMD_INPUT
Definition: gpio.h:37
Nano100 series peripheral access layer header file. This file contains all the peripheral register's ...
#define BIT0
Bit 0 mask of an 32 bit integer.
#define BIT1
Bit 1 mask of an 32 bit integer.
#define KEY2_INPUT
#define PE
Pointer to GPIO port E register structure.
void GPIO_SetMode(GPIO_T *gpio, uint32_t u32PinMask, uint32_t u32Mode)
Set GPIO operation mode.
Definition: gpio.c:40
unsigned char Get_KEY_INPUT(void)
This function get button status.