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
This commit is contained in:
patacongo
2013-03-01 19:10:02 +00:00
parent e22f90aa29
commit a19de48731
2 changed files with 14 additions and 6 deletions
+3 -3
View File
@@ -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 */
+11 -3
View File
@@ -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