summaryrefslogtreecommitdiff
path: root/nuttx/arch/arm/src/lm
diff options
context:
space:
mode:
authorpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-01 19:10:02 +0000
committerpatacongo <patacongo@42af7a65-404d-4744-a932-0658087f49c3>2013-03-01 19:10:02 +0000
commit7b9858c44c827799d2d4c898fc081b907bce7b49 (patch)
tree1764a99eb1971176a2b242949ec23c742b46dd83 /nuttx/arch/arm/src/lm
parent632648b224dfcefbf70347d7fb3a60d8f6e7fad4 (diff)
downloadpx4-nuttx-7b9858c44c827799d2d4c898fc081b907bce7b49.tar.gz
px4-nuttx-7b9858c44c827799d2d4c898fc081b907bce7b49.tar.bz2
px4-nuttx-7b9858c44c827799d2d4c898fc081b907bce7b49.zip
Add a configuration to begin development of an LM4F120 LaunchPad port
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5692 42af7a65-404d-4744-a932-0658087f49c3
Diffstat (limited to 'nuttx/arch/arm/src/lm')
-rw-r--r--nuttx/arch/arm/src/lm/lm_gpio.c6
-rw-r--r--nuttx/arch/arm/src/lm/lm_gpio.h14
2 files changed, 14 insertions, 6 deletions
diff --git a/nuttx/arch/arm/src/lm/lm_gpio.c b/nuttx/arch/arm/src/lm/lm_gpio.c
index be851e67c..5b49f5a6c 100644
--- a/nuttx/arch/arm/src/lm/lm_gpio.c
+++ b/nuttx/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 <<pinno);
DEBUGASSERT(func <= GPIO_FUNC_MAX);
@@ -792,7 +792,7 @@ void lm_gpiowrite(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 */
@@ -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/nuttx/arch/arm/src/lm/lm_gpio.h b/nuttx/arch/arm/src/lm/lm_gpio.h
index 1447eb065..5938b7891 100644
--- a/nuttx/arch/arm/src/lm/lm_gpio.h
+++ b/nuttx/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