diff --git a/arch/arm/src/lm/lm_gpio.c b/arch/arm/src/lm/lm_gpio.c index be851e67c46..5b49f5a6cc3 100644 --- a/arch/arm/src/lm/lm_gpio.c +++ b/arch/arm/src/lm/lm_gpio.c @@ -715,7 +715,7 @@ int lm_configgpio(uint32_t cfgset) func = (cfgset & GPIO_FUNC_MASK) >> GPIO_FUNC_SHIFT; port = (cfgset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; - pinno = (cfgset & GPIO_NUMBER_MASK); + pinno = (cfgset & GPIO_PIN_MASK); pin = (1 <> GPIO_PORT_SHIFT; - pinno = (pinset & GPIO_NUMBER_MASK); + pinno = (pinset & GPIO_PIN_MASK); /* Get the base address associated with the GPIO port */ @@ -830,7 +830,7 @@ bool lm_gpioread(uint32_t pinset, bool value) /* Decode the basics */ port = (pinset & GPIO_PORT_MASK) >> GPIO_PORT_SHIFT; - pinno = (pinset & GPIO_NUMBER_MASK); + pinno = (pinset & GPIO_PIN_MASK); /* Get the base address associated with the GPIO port */ diff --git a/arch/arm/src/lm/lm_gpio.h b/arch/arm/src/lm/lm_gpio.h index 1447eb06548..5938b7891a5 100644 --- a/arch/arm/src/lm/lm_gpio.h +++ b/arch/arm/src/lm/lm_gpio.h @@ -135,12 +135,20 @@ #define GPIO_PORTH (7 << GPIO_PORT_SHIFT) /* GPIOH */ #define GPIO_PORTJ (8 << GPIO_PORT_SHIFT) /* GPIOJ */ -/* This identifies the bit in the port: +/* This identifies the pin number in the port: * nnnn nnnn nnnn nnnn nnnn nnnn nnnn nBBB */ -#define GPIO_NUMBER_SHIFT 0 /* Bits 0-2: GPIO number: 0-7 */ -#define GPIO_NUMBER_MASK (7 << GPIO_NUMBER_SHIFT) +#define GPIO_PIN_SHIFT 0 /* Bits 0-2: GPIO pin: 0-7 */ +#define GPIO_PIN_MASK (7 << GPIO_PIN_SHIFT) +# define GPIO_PIN_0 (0 << GPIO_PIN_SHIFT) +# define GPIO_PIN_1 (1 << GPIO_PIN_SHIFT) +# define GPIO_PIN_2 (2 << GPIO_PIN_SHIFT) +# define GPIO_PIN_3 (3 << GPIO_PIN_SHIFT) +# define GPIO_PIN_4 (4 << GPIO_PIN_SHIFT) +# define GPIO_PIN_5 (5 << GPIO_PIN_SHIFT) +# define GPIO_PIN_6 (6 << GPIO_PIN_SHIFT) +# define GPIO_PIN_7 (7 << GPIO_PIN_SHIFT) /************************************************************************************ * Public Types