diff --git a/configs/imxrt1050-evk/src/imxrt1050-evk.h b/configs/imxrt1050-evk/src/imxrt1050-evk.h index 755db2f8b0..9c4b662736 100644 --- a/configs/imxrt1050-evk/src/imxrt1050-evk.h +++ b/configs/imxrt1050-evk/src/imxrt1050-evk.h @@ -48,6 +48,8 @@ #include #include +#include "imxrt_gpio.h" + /************************************************************************************ * Pre-processor Definitions ************************************************************************************/ @@ -55,6 +57,23 @@ /* i.MX RT 1050 GPIO Pin Definitions ************************************************/ +/* LEDs + * + * There is only 1 user LED available on the IMXRT board that + * can be turned on and off. The LEDs can be activated by driving the + * connected I/O line to GND.. + * + * ---------- ----------- --------------------- + * IMXRT Function Shared functionality + * GPIO + * ---------- ----------- --------------------- + * GPIO1 PIN9 USER LED + * ---------- ----------- --------------------- + */ + +#define GPIO_LED0 (GPIO_OUTPUT | GPIO_OUTPUT_ZERO | \ + GPIO_PORT1 | GPIO_PIN9) + /************************************************************************************ * Public Types ************************************************************************************/ diff --git a/configs/imxrt1050-evk/src/imxrt_userleds.c b/configs/imxrt1050-evk/src/imxrt_userleds.c index 20d76109c8..e55900fe57 100644 --- a/configs/imxrt1050-evk/src/imxrt_userleds.c +++ b/configs/imxrt1050-evk/src/imxrt_userleds.c @@ -41,6 +41,7 @@ #include +#include "imxrt_gpio.h" #include "imxrt1050-evk.h" /**************************************************************************** @@ -62,7 +63,8 @@ void board_userled_initialize(void) { /* Configure LED GPIOs for output */ -#warning Missing logic + + imxrt_config_gpio(GPIO_LED0); } /**************************************************************************** @@ -71,7 +73,7 @@ void board_userled_initialize(void) void board_userled(int led, bool ledon) { -#warning Missing logic + imxrt_gpio_write(GPIO_LED0, !ledon); /* Low illuminates */ } /**************************************************************************** @@ -80,5 +82,7 @@ void board_userled(int led, bool ledon) void board_userled_all(uint8_t ledset) { -#warning Missing logic + /* Low illuminates */ + + imxrt_gpio_write(GPIO_LED0, (ledset & BOARD_USERLED_BIT) == 0); }