bernard.xiong@gmail.com 19645fd350 prepare RT-Thread 1.1.0 alpha release.
git-svn-id: https://rt-thread.googlecode.com/svn/trunk@2059 bbd45198-f89e-11dd-88c7-29a3b14d5316
2012-04-15 06:57:09 +00:00

39 lines
704 B
C

#include "LPC17xx.h"
#include "led.h"
void rt_hw_led_init(void)
{
LPC_GPIO2->FIODIR0 |= 1<<0; /* led0:P2.0 */
LPC_GPIO2->FIODIR0 |= 1<<1; /* led1:P2.1 */
}
void rt_hw_led_on(rt_uint32_t led)
{
switch(led)
{
case 0: /* P2.0 = 1 */
LPC_GPIO2->FIOSET0 = 1<<0;
break;
case 1: /* P2.1 = 1 */
LPC_GPIO2->FIOSET0 = 1<<1;
break;
default:
break;
}
}
void rt_hw_led_off(rt_uint32_t led)
{
switch(led)
{
case 0: /* P2.0 = 0 */
LPC_GPIO2->FIOCLR0 = 1<<0;
break;
case 1: /* P2.1 = 0 */
LPC_GPIO2->FIOCLR0 = 1<<1;
break;
default:
break;
}
}