Add LPC43 GPIO configurtion logic

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@4912 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-07-06 14:50:43 +00:00
parent e0b01efe74
commit 2486de1e02
3 changed files with 22 additions and 22 deletions

View File

@ -124,8 +124,8 @@
#ifdef LED_VERBOSE
static void led_dumppins(FAR const char *msg)
{
lpc43_dumppinconfig(PINCONFIG_LED1, msg);
lpc43_dumpgpio(GPIO_LED2, msg);
lpc43_pin_dump(PINCONFIG_LED1, msg);
lpc43_gpio_dump(GPIO_LED2, msg);
}
#else
# define led_dumppins(m)
@ -147,11 +147,11 @@ void up_ledinit(void)
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */
lpc43_pinconfig(PINCONFIG_LED1);
lpc43_gpioconfig(GPIO_LED1);
lpc43_pin_config(PINCONFIG_LED1);
lpc43_gpio_config(GPIO_LED1);
lpc43_pinconfig(PINCONFIG_LED2);
lpc43_gpioconfig(GPIO_LED2);
lpc43_pin_config(PINCONFIG_LED2);
lpc43_gpio_config(GPIO_LED2);
led_dumppins("up_ledinit() Exit");
}
@ -166,17 +166,17 @@ void up_ledon(int led)
{
default:
case 0:
lpc43_gpiowrite(GPIO_LED1, true); /* LED1 OFF */
lpc43_gpiowrite(GPIO_LED2, true); /* LED2 OFF */
lpc43_gpio_write(GPIO_LED1, true); /* LED1 OFF */
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
break;
case 1:
lpc43_gpiowrite(GPIO_LED1, false); /* LED1 ON */
lpc43_gpiowrite(GPIO_LED2, true); /* LED2 OFF */
lpc43_gpio_write(GPIO_LED1, false); /* LED1 ON */
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
break;
case 2:
lpc43_gpiowrite(GPIO_LED2, false); /* LED2 ON */
lpc43_gpio_write(GPIO_LED2, false); /* LED2 ON */
break;
}
}
@ -195,7 +195,7 @@ void up_ledoff(int led)
break;
case 2:
lpc43_gpiowrite(GPIO_LED2, true); /* LED2 OFF */
lpc43_gpio_write(GPIO_LED2, true); /* LED2 OFF */
break;
}
}

View File

@ -142,7 +142,7 @@ uint8_t up_buttons(void)
{
/* A LOW value means that the key is pressed. */
bool released = lpc43_gpioread(g_buttoncfg[i]);
bool released = lpc43_gpio_read(g_buttoncfg[i]);
/* Accumulate the set of depressed (not released) keys */

View File

@ -102,8 +102,8 @@
#ifdef LED_VERBOSE
static void led_dumppins(FAR const char *msg)
{
lpc43_dumppinconfig(PINCONFIG_LED1, msg);
lpc43_dumpgpio(GPIO_LED2, msg);
lpc43_pin_dump(PINCONFIG_LED1, msg);
lpc43_gpio_dump(GPIO_LED2, msg);
}
#else
# define led_dumppins(m)
@ -125,11 +125,11 @@ void lpc43_ledinit(void)
/* Configure LED pins as GPIOs, then configure GPIOs as outputs */
lpc43_pinconfig(PINCONFIG_LED1);
lpc43_gpioconfig(GPIO_LED1);
lpc43_pin_config(PINCONFIG_LED1);
lpc43_gpio_config(GPIO_LED1);
lpc43_pinconfig(PINCONFIG_LED2);
lpc43_gpioconfig(GPIO_LED2);
lpc43_pin_config(PINCONFIG_LED2);
lpc43_gpio_config(GPIO_LED2);
led_dumppins("lpc43_ledinit() Exit");
}
@ -141,7 +141,7 @@ void lpc43_ledinit(void)
void lpc43_setled(int led, bool ledon)
{
uint16_t gpiocfg = (led == BOARD_LED1 ? BOARD_LED1 : BOARD_LED2);
lpc43_gpiowrite(GPIO_LED1, !ledon);
lpc43_gpio_write(GPIO_LED1, !ledon);
}
/****************************************************************************
@ -150,8 +150,8 @@ void lpc43_setled(int led, bool ledon)
void lpc43_setleds(uint8_t ledset)
{
lpc43_gpiowrite(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
lpc43_gpiowrite(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
lpc43_gpio_write(BOARD_LED1, (ledset & BOARD_LED1_BIT) == 0);
lpc43_gpio_write(BOARD_LED2, (ledset & BOARD_LED2_BIT) == 0);
}
#endif /* !CONFIG_ARCH_LEDS */