boards/arm/s32k1xx/s32k118evb, s32k146evb, and s32148evb: Correct the 'sense' of the LED discrete output. A high level illuminates the LED.

This commit is contained in:
Gregory Nutt
2019-08-22 12:12:22 -06:00
parent 686ef9b317
commit 3613ae33a7
12 changed files with 71 additions and 78 deletions
+2
View File
@@ -57,6 +57,8 @@ LEDs and Buttons
GreenLED PTD15 (FTM0 CH0)
BlueLED PTE8 (FTM0 CH6)
An output of '1' illuminates the LED.
If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
any way. The following definitions are used to access individual RGB
components.
@@ -38,6 +38,7 @@
* GreenLED PTD15 (FTM0CH0)
* BlueLED PTE8 (FTM0CH6)
*
* An output of '1' illuminates the LED.
*
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
* the Freedom K66F. The following definitions describe how NuttX controls
@@ -92,14 +93,6 @@
#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */
#define LED_ON_OFF_OFF 4 /* LED_PANIC */
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -125,9 +118,9 @@ void board_autoled_on(int led)
{
if (led != LED_NOCHANGE)
{
bool redoff = true;
bool greenoff = true;
bool blueoff = true;
bool redon = false;
bool greenon = false;
bool blueon = false;
switch (led)
{
@@ -136,21 +129,21 @@ void board_autoled_on(int led)
break;
case LED_OFF_OFF_ON:
blueoff = false;
blueon = true;
break;
case LED_OFF_ON_OFF:
greenoff = false;
greenon = true;
break;
case LED_ON_OFF_OFF:
redoff = false;
redon = true;
break;
}
s32k1xx_gpiowrite(GPIO_LED_R, redoff);
s32k1xx_gpiowrite(GPIO_LED_G, greenoff);
s32k1xx_gpiowrite(GPIO_LED_B, blueoff);
s32k1xx_gpiowrite(GPIO_LED_R, redon);
s32k1xx_gpiowrite(GPIO_LED_G, greenon);
s32k1xx_gpiowrite(GPIO_LED_B, blueon);
}
}
@@ -163,8 +156,8 @@ void board_autoled_off(int led)
if (led == LED_ON_OFF_OFF)
{
s32k1xx_gpiowrite(GPIO_LED_R, true);
s32k1xx_gpiowrite(GPIO_LED_G, true);
s32k1xx_gpiowrite(GPIO_LED_B, true);
s32k1xx_gpiowrite(GPIO_LED_G, false);
s32k1xx_gpiowrite(GPIO_LED_B, false);
}
}
@@ -97,7 +97,7 @@ void board_userled(int led, bool ledon)
return;
}
s32k1xx_gpiowrite(ledcfg, !ledon); /* Low illuminates */
s32k1xx_gpiowrite(ledcfg, ledon); /* High illuminates */
}
/****************************************************************************
@@ -108,9 +108,9 @@ void board_userled_all(uint8_t ledset)
{
/* Low illuminates */
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */
@@ -61,11 +61,13 @@
* RedLED PTD16 (FTM0CH1)
* GreenLED PTD15 (FTM0CH0)
* BlueLED PTE8 (FTM0CH6)
*
* An output of '1' illuminates the LED.
*/
#define GPIO_LED_R (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_G (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_B (PIN_PTE8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_R (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_G (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_B (PIN_PTE8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
/* Buttons. The S32K118EVB supports two buttons:
*
+2
View File
@@ -51,6 +51,8 @@ LEDs and Buttons
GreenLED PTD16 (FTM0 CH1)
BlueLED PTD0 (FTM0 CH2)
An output of '1' illuminates the LED.
If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
any way. The following definitions are used to access individual RGB
components.
@@ -38,6 +38,8 @@
* GreenLED PTD16 (FTM0 CH1)
* BlueLED PTD0 (FTM0 CH2)
*
* An output of '1' illuminates the LED.
*
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
* the Freedom K66F. The following definitions describe how NuttX controls
* the LEDs:
@@ -91,14 +93,6 @@
#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */
#define LED_ON_OFF_OFF 4 /* LED_PANIC */
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -124,9 +118,9 @@ void board_autoled_on(int led)
{
if (led != LED_NOCHANGE)
{
bool redoff = true;
bool greenoff = true;
bool blueoff = true;
bool redon = false;
bool greenon = false;
bool blueon = false;
switch (led)
{
@@ -135,21 +129,21 @@ void board_autoled_on(int led)
break;
case LED_OFF_OFF_ON:
blueoff = false;
blueon = true;
break;
case LED_OFF_ON_OFF:
greenoff = false;
greenon = true;
break;
case LED_ON_OFF_OFF:
redoff = false;
redon = true;
break;
}
s32k1xx_gpiowrite(GPIO_LED_R, redoff);
s32k1xx_gpiowrite(GPIO_LED_G, greenoff);
s32k1xx_gpiowrite(GPIO_LED_B, blueoff);
s32k1xx_gpiowrite(GPIO_LED_R, redon);
s32k1xx_gpiowrite(GPIO_LED_G, greenon);
s32k1xx_gpiowrite(GPIO_LED_B, blueon);
}
}
@@ -162,8 +156,8 @@ void board_autoled_off(int led)
if (led == LED_ON_OFF_OFF)
{
s32k1xx_gpiowrite(GPIO_LED_R, true);
s32k1xx_gpiowrite(GPIO_LED_G, true);
s32k1xx_gpiowrite(GPIO_LED_B, true);
s32k1xx_gpiowrite(GPIO_LED_G, false);
s32k1xx_gpiowrite(GPIO_LED_B, false);
}
}
@@ -97,7 +97,7 @@ void board_userled(int led, bool ledon)
return;
}
s32k1xx_gpiowrite(ledcfg, !ledon); /* Low illuminates */
s32k1xx_gpiowrite(ledcfg, ledon); /* High illuminates */
}
/****************************************************************************
@@ -108,9 +108,9 @@ void board_userled_all(uint8_t ledset)
{
/* Low illuminates */
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */
@@ -61,11 +61,13 @@
* RedLED PTD15 (FTM0 CH0)
* GreenLED PTD16 (FTM0 CH1)
* BlueLED PTD0 (FTM0 CH2)
*
* An output of '1' illuminates the LED.
*/
#define GPIO_LED_R (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_G (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_B (PIN_PTE8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_R (PIN_PTD15 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_G (PIN_PTD16 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_B (PIN_PTE8 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
/* Buttons. The S32K146EVB supports two buttons:
*
+2
View File
@@ -39,6 +39,8 @@ LEDs and Buttons
GreenLED PTE22
BlueLED PTE23
An output of '1' illuminates the LED.
If CONFIG_ARCH_LEDS is not defined, then the user can control the LEDs in
any way. The following definitions are used to access individual RGB
components.
@@ -38,6 +38,8 @@
* GreenLED PTE22
* BlueLED PTE23
*
* An output of '1' illuminates the LED.
*
* If CONFIG_ARCH_LEDs is defined, then NuttX will control the LED on board
* the Freedom K66F. The following definitions describe how NuttX controls
* the LEDs:
@@ -91,14 +93,6 @@
#define LED_OFF_ON_OFF 3 /* LED_STACKCREATED */
#define LED_ON_OFF_OFF 4 /* LED_PANIC */
/****************************************************************************
* Private Data
****************************************************************************/
/****************************************************************************
* Private Functions
****************************************************************************/
/****************************************************************************
* Public Functions
****************************************************************************/
@@ -124,9 +118,9 @@ void board_autoled_on(int led)
{
if (led != LED_NOCHANGE)
{
bool redoff = true;
bool greenoff = true;
bool blueoff = true;
bool redon = false;
bool greenon = false;
bool blueon = false;
switch (led)
{
@@ -135,21 +129,21 @@ void board_autoled_on(int led)
break;
case LED_OFF_OFF_ON:
blueoff = false;
blueon = true;
break;
case LED_OFF_ON_OFF:
greenoff = false;
greenon = true;
break;
case LED_ON_OFF_OFF:
redoff = false;
redon = true;
break;
}
s32k1xx_gpiowrite(GPIO_LED_R, redoff);
s32k1xx_gpiowrite(GPIO_LED_G, greenoff);
s32k1xx_gpiowrite(GPIO_LED_B, blueoff);
s32k1xx_gpiowrite(GPIO_LED_R, redon);
s32k1xx_gpiowrite(GPIO_LED_G, greenon);
s32k1xx_gpiowrite(GPIO_LED_B, blueon);
}
}
@@ -162,8 +156,8 @@ void board_autoled_off(int led)
if (led == LED_ON_OFF_OFF)
{
s32k1xx_gpiowrite(GPIO_LED_R, true);
s32k1xx_gpiowrite(GPIO_LED_G, true);
s32k1xx_gpiowrite(GPIO_LED_B, true);
s32k1xx_gpiowrite(GPIO_LED_G, false);
s32k1xx_gpiowrite(GPIO_LED_B, false);
}
}
@@ -97,7 +97,7 @@ void board_userled(int led, bool ledon)
return;
}
s32k1xx_gpiowrite(ledcfg, !ledon); /* Low illuminates */
s32k1xx_gpiowrite(ledcfg, ledon); /* High illuminates */
}
/****************************************************************************
@@ -108,9 +108,9 @@ void board_userled_all(uint8_t ledset)
{
/* Low illuminates */
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) == 0);
s32k1xx_gpiowrite(GPIO_LED_R, (ledset & BOARD_LED_R_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_G, (ledset & BOARD_LED_G_BIT) != 0);
s32k1xx_gpiowrite(GPIO_LED_B, (ledset & BOARD_LED_B_BIT) != 0);
}
#endif /* !CONFIG_ARCH_LEDS */
@@ -61,11 +61,13 @@
* RedLED PTE21
* GreenLED PTE22
* BlueLED PTE23
*
* An output of '1' illuminates the LED.
*/
#define GPIO_LED_R (PIN_PTE21 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_G (PIN_PTE22 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_B (PIN_PTE23 | GPIO_LOWDRIVE | GPIO_OUTPUT_ONE)
#define GPIO_LED_R (PIN_PTE21 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_G (PIN_PTE22 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
#define GPIO_LED_B (PIN_PTE23 | GPIO_LOWDRIVE | GPIO_OUTPUT_ZERO)
/* Buttons. The S32K148EVB supports two buttons:
*