Merge pull request #321 from neilt6/master

[LPC11UXX ] gpio_api.c - pin expansion
pull/323/merge
Martin Kojtal 2014-05-23 08:31:58 +01:00
commit b5c244f51b
3 changed files with 14 additions and 6 deletions

View File

@ -26,10 +26,15 @@ static void gpio_enable(void) {
}
uint32_t gpio_set(PinName pin) {
if (!gpio_enabled)
gpio_enable();
int f = ((pin == P0_0) ||
(pin == P0_10) ||
(pin == P0_15)) ? (1) : (0);
pin_function(pin, f);
return (1UL << ((int)pin >> PIN_SHIFT & 0x1F));
}

View File

@ -17,10 +17,13 @@
#include "pinmap.h"
uint32_t gpio_set(PinName pin) {
int f = ((pin == P0_11) ||
int f = ((pin == P0_0) ||
(pin == P0_10) ||
(pin == P0_11) ||
(pin == P0_12) ||
(pin == P0_13) ||
(pin == P0_14)) ? (1) : (0);
(pin == P0_14) ||
(pin == P0_15)) ? (1) : (0);
pin_function(pin, f);

View File

@ -39,10 +39,10 @@ typedef enum {
LED_BLUE = P1_1,
// mbed original LED naming
LED1 = LED_BLUE,
LED1 = LED_RED,
LED2 = LED_GREEN,
LED3 = LED_RED,
LED4 = LED_RED,
LED3 = LED_BLUE,
LED4 = LED_BLUE,
// Serial to USB pins
USBTX = P0_18,