Sabre-6Quad: Add LED GPIO/IOMUX definitions

This commit is contained in:
Gregory Nutt 2016-03-07 17:44:55 -06:00
parent cb0b518042
commit 7b20b7ec5d
5 changed files with 28 additions and 12 deletions

View File

@ -142,7 +142,9 @@ LEDs and Buttons
LEDs
----
A single LED is available driven by USR_DEF_RED_LED.
A single LED is available driven GPIO1_IO02. On the schematic this is
USR_DEF_RED_LED signal to pin T1 (GPIO_2). This signal is shared with
KEY_ROW6 (ALT2). A low value illuminates the LED.
This LED is not used by the board port unless CONFIG_ARCH_LEDS is
defined. In that case, the usage by the board port is defined in

View File

@ -50,17 +50,19 @@
/* LED definitions ******************************************************************/
/* LEDs
*
* A single LED is available driven by USR_DEF_RED_LED.
* A single LED is available driven GPIO1_IO02. On the schematic this is
* USR_DEF_RED_LED signal to pin T1 (GPIO_2). This signal is shared with KEY_ROW6
* (ALT2). A low value illuminates the LED.
*/
/* LED index values for use with board_userled() */
#define BOARD_LED0 0
#define BOARD_LED 0
#define BOARD_NLEDS 1
/* LED bits for use with board_userled_all() */
#define BOARD_LED0_BIT (1 << BOARD_LED0)
#define BOARD_LED_BIT (1 << BOARD_LED)
/* These LEDs are not used by the board port unless CONFIG_ARCH_LEDS is
* defined. In that case, the usage by the board port is defined in

View File

@ -106,7 +106,7 @@ void board_autoled_initialize(void)
{
/* Configure LED PIOs for output */
imx_config_gpio(GPIO_LED0);
imx_config_gpio(GPIO_LED);
}
/****************************************************************************
@ -117,7 +117,7 @@ void board_autoled_on(int led)
{
if (led == 1 || led == 3)
{
imx_gpio_write(GPIO_LED0, false); /* Low illuminates */
imx_gpio_write(GPIO_LED, false); /* Low illuminates */
}
}
@ -129,7 +129,7 @@ void board_autoled_off(int led)
{
if (led == 3)
{
imx_gpio_write(GPIO_LED0, true); /* High extinguishes */
imx_gpio_write(GPIO_LED, true); /* High extinguishes */
}
}

View File

@ -59,7 +59,7 @@ void board_userled_initialize(void)
{
/* Configure LED PIOs for output */
imx_config_gpio(GPIO_LED0);
imx_config_gpio(GPIO_LED);
}
/****************************************************************************
@ -68,9 +68,9 @@ void board_userled_initialize(void)
void board_userled(int led, bool ledon)
{
if (led == BOARD_LED0)
if (led == BOARD_LED)
{
imx_gpio_write(GPIO_LED0, !ledon); /* Low illuminates */
imx_gpio_write(GPIO_LED, !ledon); /* Low illuminates */
}
}
@ -82,5 +82,5 @@ void board_userled_all(uint8_t ledset)
{
/* Low illuminates */
imx_gpio_write(GPIO_LED0, (ledset & BOARD_LED0_BIT) == 0));
imx_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0));
}

View File

@ -44,14 +44,26 @@
#include <stdint.h>
#include "imx_gpio.h"
#include "imx_iomuxc.h"
/************************************************************************************
* Pre-processor Definitions
************************************************************************************/
/* Configuration ********************************************************************/
/* SABRE-6QUAD GPIO Pin Definitions *************************************************/
/* LED
*
* A single LED is available driven GPIO1_IO02. On the schematic this is
* USR_DEF_RED_LED signal to pin T1 (GPIO_2). This signal is shared with KEY_ROW6
* (ALT2). A low value illuminates the LED.
*/
#define GPIO_LED0 0 /* To be provided */
#define IOMUX_LED (IOMUX_PULL_NONE | IOMUX_CMOS_OUTPUT | IOMUX_DRIVE_40OHM | \
IOMUX_SPEED_MEDIUM | IOMUX_SLEW_SLOW)
#define GPIO_LED (GPIO_OUTPUT | GPIO_OUTPUT_ONE | GPIO_PORT1 | GPIO_PIN2 | \
IOMUX_LED)
/************************************************************************************
* Public Types