mirror of
https://github.com/apache/nuttx.git
synced 2026-06-06 00:14:22 +08:00
Sabre-6Quad: Add LED GPIO/IOMUX definitions
This commit is contained in:
@@ -142,7 +142,9 @@ LEDs and Buttons
|
|||||||
|
|
||||||
LEDs
|
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
|
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
|
defined. In that case, the usage by the board port is defined in
|
||||||
|
|||||||
@@ -50,17 +50,19 @@
|
|||||||
/* LED definitions ******************************************************************/
|
/* LED definitions ******************************************************************/
|
||||||
/* LEDs
|
/* 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() */
|
/* LED index values for use with board_userled() */
|
||||||
|
|
||||||
#define BOARD_LED0 0
|
#define BOARD_LED 0
|
||||||
#define BOARD_NLEDS 1
|
#define BOARD_NLEDS 1
|
||||||
|
|
||||||
/* LED bits for use with board_userled_all() */
|
/* 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
|
/* 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
|
* defined. In that case, the usage by the board port is defined in
|
||||||
|
|||||||
@@ -106,7 +106,7 @@ void board_autoled_initialize(void)
|
|||||||
{
|
{
|
||||||
/* Configure LED PIOs for output */
|
/* 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)
|
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)
|
if (led == 3)
|
||||||
{
|
{
|
||||||
imx_gpio_write(GPIO_LED0, true); /* High extinguishes */
|
imx_gpio_write(GPIO_LED, true); /* High extinguishes */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -59,7 +59,7 @@ void board_userled_initialize(void)
|
|||||||
{
|
{
|
||||||
/* Configure LED PIOs for output */
|
/* 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)
|
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 */
|
/* Low illuminates */
|
||||||
|
|
||||||
imx_gpio_write(GPIO_LED0, (ledset & BOARD_LED0_BIT) == 0));
|
imx_gpio_write(GPIO_LED, (ledset & BOARD_LED_BIT) == 0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,14 +44,26 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include "imx_gpio.h"
|
||||||
|
#include "imx_iomuxc.h"
|
||||||
|
|
||||||
/************************************************************************************
|
/************************************************************************************
|
||||||
* Pre-processor Definitions
|
* Pre-processor Definitions
|
||||||
************************************************************************************/
|
************************************************************************************/
|
||||||
/* Configuration ********************************************************************/
|
/* Configuration ********************************************************************/
|
||||||
|
|
||||||
/* SABRE-6QUAD GPIO Pin Definitions *************************************************/
|
/* 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
|
* Public Types
|
||||||
|
|||||||
Reference in New Issue
Block a user