The Kinetis GPIO logic had some of the same issues as did the Kinetis L

This commit is contained in:
Gregory Nutt 2013-05-06 11:49:28 -06:00
parent 7628d3aa57
commit fae527deef
6 changed files with 44 additions and 33 deletions

View File

@ -4680,4 +4680,6 @@
* arch/arm/src/kl/kl_gpio.c and .h, configs/freedom-kl25z/src/freedom-kl25z.h,
and configs/freedom-kl25z/src/kl_led.c: Fixes LEDs on the Freedom KL25Z
board (2013-5-6).
* arch/arm/src/kinetis/kinetis_pin.c and arch/arm/src/kinetis/kinetis_internal.h:
The Kinetis GPIO logic had some of the same issues as did the
Kinetis L (2013-5-6).

View File

@ -1,7 +1,7 @@
/************************************************************************************
* arch/arm/src/kinetis/kinetis_internal.h
*
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -69,7 +69,6 @@
/* Bits 25-31: 7 bits are used to encode the basic pin configuration:
*
* oooo mmm- ---- ---- ---- ---- ---- ----
* oooommm:
* | `--- mmm: mode
* `------- oooo: options (may be combined)
*/
@ -80,7 +79,16 @@
#define _PIN_OPTIONS_MASK (15 << _PIN_OPTIONS_SHIFT)
/* Port Modes */
/* Unshifted versions: */
#define PIN_MODE_ANALOG (0) /* 000 Pin Disabled (Analog) */
#define PIN_MODE_GPIO (1) /* 001 Alternative 1 (GPIO) */
#define PIN_MODE_ALT2 (2) /* 010 Alternative 2 */
#define PIN_MODE_ALT3 (3) /* 011 Alternative 3 */
#define PIN_MODE_ALT4 (4) /* 100 Alternative 4 */
#define PIN_MODE_ALT5 (5) /* 101 Alternative 5 */
#define PIN_MODE_ALT6 (6) /* 110 Alternative 6 */
#define PIN_MODE_ALT7 (7) /* 111 Alternative 7 */
/* Shifted versions: */
#define _PIN_MODE_ANALOG (0 << _PIN_MODE_SHIFT) /* 000 Pin Disabled (Analog) */
#define _PIN_MODE_GPIO (1 << _PIN_MODE_SHIFT) /* 001 Alternative 1 (GPIO) */
#define _PIN_MODE_ALT2 (2 << _PIN_MODE_SHIFT) /* 010 Alternative 2 */

View File

@ -106,7 +106,7 @@ int kinetis_pinconfig(uint32_t cfgset)
* options are applicable.
*/
if (mode == _PIN_MODE_ANALOG)
if (mode == PIN_MODE_ANALOG)
{
/* Set the analog mode with all digital options zeroed */
@ -187,7 +187,7 @@ int kinetis_pinconfig(uint32_t cfgset)
/* Additional configuration for the case of Alternative 1 (GPIO) modes */
if (mode == _PIN_MODE_GPIO)
if (mode == PIN_MODE_GPIO)
{
/* Set the GPIO port direction */
@ -216,6 +216,7 @@ int kinetis_pinconfig(uint32_t cfgset)
return OK;
}
return -EINVAL;
}

View File

@ -151,14 +151,14 @@
* SYMBOL Meaning LED state
* Initially all LED is OFF
* ------------------- ----------------------- --------------------------
* LED_STARTED NuttX has been started
* LED_HEAPALLOCATE Heap has been allocated
* LED_IRQSENABLED Interrupts enabled
* LED_STACKCREATED Idle stack created
* LED_INIRQ In an interrupt
* LED_SIGNAL In a signal handler
* LED_ASSERTION An assertion failed
* LED_PANIC The system has crashed
* LED_STARTED NuttX has been started R=OFF G=OFF B=OFF
* LED_HEAPALLOCATE Heap has been allocated (no change)
* LED_IRQSENABLED Interrupts enabled (no change)
* LED_STACKCREATED Idle stack created R=OFF G=OFF B=ON
* LED_INIRQ In an interrupt (no change)
* LED_SIGNAL In a signal handler (no change)
* LED_ASSERTION An assertion failed (no change)
* LED_PANIC The system has crashed R=FLASHING G=OFF B=OFF
* LED_IDLE K25Z1XX is in sleep mode (Optional, not used)
*/