4
0
mirror of https://github.com/RT-Thread/rt-thread.git synced 2025-01-15 06:19:22 +08:00
2013-01-08 22:40:58 +08:00

39 lines
666 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;
}
}