Nano100BN Series BSP  V3.03.002
The Board Support Package for Nano100BN Series
NuEdu-Basic01_LED.c
Go to the documentation of this file.
1 /**************************************************************************/
12 #include <stdio.h>
13 #include "Nano100Series.h"
14 #include "NuEdu-Basic01_LED.h"
15 
28 /*---------------------------------------------------------------------------------------------------------*/
29 /* Porting Define */
30 /*---------------------------------------------------------------------------------------------------------*/
31 #define LED1_ON PB0=0 //control LED1 on
32 #define LED2_ON PB1=0 //control LED2 on
33 #define LED3_ON PE9=0 //control LED3 on
34 #define LED4_ON PE10=0 //control LED4 on
35 #define LED5_ON PE11=0 //control LED5 on
36 #define LED6_ON PD8=0 //control LED6 on
37 #define LED7_ON PD9=0 //control LED7 on
38 #define LED8_ON PC7=0 //control LED8 on
39 
40 #define LED1_OFF PB0=1 //control LED1 off
41 #define LED2_OFF PB1=1 //control LED2 off
42 #define LED3_OFF PE9=1 //control LED3 off
43 #define LED4_OFF PE10=1 //control LED4 off
44 #define LED5_OFF PE11=1 //control LED5 off
45 #define LED6_OFF PD8=1 //control LED6 off
46 #define LED7_OFF PD9=1 //control LED7 off
47 #define LED8_OFF PC7=1 //control LED8 off
48 
49 
54 void initial_led(void)
55 {
64 
65 }
66 
67 
75 void LED_on(unsigned int temp)
76 {
77  if((temp&1)!=1)
78  LED1_OFF;
79  else
80  LED1_ON;
81 
82  temp=temp>>1;
83 
84  if((temp&1)!=1)
85  LED2_OFF;
86  else
87  LED2_ON;
88 
89  temp=temp>>1;
90  if((temp&1)!=1)
91  LED3_OFF;
92  else
93  LED3_ON;
94 
95  temp=temp>>1;
96  if((temp&1)!=1)
97  LED4_OFF;
98  else
99  LED4_ON;
100 
101  temp=temp>>1;
102  if((temp&1)!=1)
103  LED5_OFF;
104  else
105  LED5_ON;
106 
107  temp=temp>>1;
108  if((temp&1)!=1)
109  LED6_OFF;
110  else
111  LED6_ON;
112 
113  temp=temp>>1;
114  if((temp&1)!=1)
115  LED7_OFF;
116  else
117  LED7_ON;
118 
119  temp=temp>>1;
120  if((temp&1)!=1)
121  LED8_OFF;
122  else
123  LED8_ON;
124 
125 }
126 
131 void initial_close(void)
132 {
133 
142 
143 }
144  /* end of group Nano130_Basic01_FUNCTIONS Buzzer Exported Functions */
146  /* end of group NuEdu-SDK-Nano130_Basic01 Nano130_Basic01 Library */
148  /* end of group NANO100_Library NANO100 Library */
150 /*** (C) COPYRIGHT 2013 Nuvoton Technology Corp. ***/
#define PD
Pointer to GPIO port D register structure.
#define LED2_OFF
#define LED1_ON
#define GPIO_PMD_INPUT
Definition: gpio.h:37
#define BIT7
Bit 7 mask of an 32 bit integer.
#define LED4_ON
Nano100 series peripheral access layer header file. This file contains all the peripheral register's ...
#define LED6_OFF
#define BIT0
Bit 0 mask of an 32 bit integer.
#define LED8_ON
#define LED8_OFF
#define BIT11
Bit 11 mask of an 32 bit integer.
#define LED6_ON
Nano100 series Basic01 board LED driver header file.
void initial_close(void)
Set LED GPIO to input mode.
void initial_led(void)
Set LED GPIO to output mode.
#define LED3_OFF
#define BIT8
Bit 8 mask of an 32 bit integer.
#define BIT1
Bit 1 mask of an 32 bit integer.
#define LED7_ON
void LED_on(unsigned int temp)
This function turn on LED numbers to open or close.
#define LED5_OFF
#define PC
Pointer to GPIO port C register structure.
#define LED5_ON
#define LED3_ON
#define GPIO_PMD_OUTPUT
Definition: gpio.h:38
#define LED7_OFF
#define LED4_OFF
#define BIT9
Bit 9 mask of an 32 bit integer.
#define PE
Pointer to GPIO port E register structure.
#define LED2_ON
#define PB
Pointer to GPIO port B register structure.
#define LED1_OFF
void GPIO_SetMode(GPIO_T *gpio, uint32_t u32PinMask, uint32_t u32Mode)
Set GPIO operation mode.
Definition: gpio.c:40
#define BIT10
Bit 10 mask of an 32 bit integer.