From 5a3c6a05a9ef3066cd183e29abb6b9a1f16b6066 Mon Sep 17 00:00:00 2001 From: WANGYU Date: Sat, 11 Jul 2026 08:41:15 +0800 Subject: [PATCH 1/4] SLCD BSP driver support --- bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig | 6 + .../board/MCUX_Config/board/pin_mux.c | 28 +++ .../board/MCUX_Config/board/pin_mux.h | 6 + .../mcxa/frdm-mcxa366/board/ports/SConscript | 7 +- .../mcxa/frdm-mcxa366/board/ports/drv_slcd.c | 236 ++++++++++++++++++ .../mcxa/frdm-mcxa366/board/ports/drv_slcd.h | 46 ++++ 6 files changed, 327 insertions(+), 2 deletions(-) create mode 100644 bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c create mode 100644 bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig index 0f040234a6d..bd7ecf5f75a 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig @@ -133,6 +133,12 @@ menu "On-chip Peripheral Drivers" endmenu menu "Onboard Peripheral Drivers" + config BSP_USING_SLCD + bool "Enable onboard SLCD display" + default y + help + Enable FRDM-MCXA366 onboard segment LCD (6 digits). + config BSP_USING_ARDUINO bool "Compatible with Arduino Ecosystem (RTduino)" select PKG_USING_RTDUINO diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c index 57004a9c156..08212d17ca6 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c @@ -436,3 +436,31 @@ void BOARD_InitPins(void) /* PORT1_2 (pin 137) is configured as CAN0_TXD */ PORT_SetPinConfig(PORT1, 2U, &port1_2_pin137_config); } + +void BOARD_InitSLCDPins(void) +{ + uint8_t pin; + + /* LCD_P16~LCD_P31 are routed on PORT0_12~PORT0_27 (Alt9). */ + const port_pin_config_t slcd_pin_config = { + .pullSelect = kPORT_PullDisable, + .pullValueSelect = kPORT_LowPullResistor, + .slewRate = kPORT_FastSlewRate, + .passiveFilterEnable = kPORT_PassiveFilterDisable, + .openDrainEnable = kPORT_OpenDrainDisable, + .driveStrength = kPORT_LowDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, + .mux = kPORT_MuxAlt9, + .inputBuffer = kPORT_InputBufferEnable, + .invertInput = kPORT_InputNormal, + .lockRegister = kPORT_UnlockRegister, + }; + + CLOCK_EnableClock(kCLOCK_GatePORT0); + RESET_ReleasePeripheralReset(kPORT0_RST_SHIFT_RSTn); + + for (pin = 12U; pin <= 27U; pin++) + { + PORT_SetPinConfig(PORT0, pin, &slcd_pin_config); + } +} diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h index a1b26915021..b57711d6164 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h @@ -77,6 +77,12 @@ void BOARD_InitBootPins(void); */ void BOARD_InitPins(void); +/*! + * @brief Configures PORT0_12~PORT0_27 as LCD_P16~LCD_P31 for onboard SLCD. + * + */ +void BOARD_InitSLCDPins(void); + #if defined(__cplusplus) } #endif diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/SConscript b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/SConscript index 57b0ba37f9b..05efacee6f7 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/SConscript +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/SConscript @@ -1,10 +1,13 @@ from building import * +import os cwd = GetCurrentDir() -# add the general drivers. -src = Glob('*.c') +src = [] CPPPATH = [cwd] +if GetDepend(['BSP_USING_SLCD']): + src += ['drv_slcd.c'] + group = DefineGroup('Drivers', src, depend = [''], CPPPATH = CPPPATH) list = os.listdir(cwd) diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c new file mode 100644 index 00000000000..b3e80028fb8 --- /dev/null +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c @@ -0,0 +1,236 @@ +/* + * Copyright (c) 2006-2026, RT-Thread Development Team + * Copyright 2024-2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + * + * Board-level SLCD helper for FRDM-MCXA366, built on NXP fsl_slcd. + * + * Segment mapping (8 bits per front-plane pair in num_matrix): + * 7 6 5 4 | 3 2 1 0 + * E G F P | D C B A + * + * Front plane: digit6..digit1 use LCD_P27/P26 .. LCD_P17/P16 + * Back plane: COM1..COM4 use LCD_P28..LCD_P31 + */ + +#include + +#ifdef BSP_USING_SLCD + +#include "drv_slcd.h" +#include "pin_mux.h" +#include "fsl_clock.h" +#include "fsl_reset.h" +#include "fsl_slcd.h" + +#define BOARD_SLCD LCD0 + +#define SEGA 0x0001u +#define SEGB 0x0002u +#define SEGC 0x0004u +#define SEGD 0x0008u +#define SEGP 0x0100u +#define SEGF 0x0200u +#define SEGG 0x0400u +#define SEGE 0x0800u + +/* Low byte -> pin_lo (A/B/C/D), high byte -> pin_hi (P/F/G/E). */ +static const uint16_t num_matrix[] = +{ + SEGA | SEGB | SEGC | SEGD | SEGE | SEGF, /* 0 */ + SEGB | SEGC, /* 1 */ + SEGA | SEGB | SEGG | SEGE | SEGD, /* 2 */ + SEGA | SEGB | SEGG | SEGC | SEGD, /* 3 */ + SEGF | SEGG | SEGB | SEGC, /* 4 */ + SEGA | SEGF | SEGG | SEGC | SEGD, /* 5 */ + SEGA | SEGF | SEGE | SEGD | SEGC | SEGG, /* 6 */ + SEGA | SEGB | SEGC, /* 7 */ + SEGA | SEGB | SEGC | SEGD | SEGE | SEGF | SEGG, /* 8 */ + SEGA | SEGF | SEGG | SEGB | SEGC | SEGD, /* 9 */ + 0 /* space / blank */ +}; + +/* digit 1..6 -> low front-plane pin (high pin is low+1) */ +static const uint8_t digit_pin_lo[] = {0, 16, 18, 20, 22, 24, 26}; + +/* SLCD_Px point -> front-plane pin (phase A / SEGP) */ +static const uint8_t point_pin[] = +{ + 23, /* P1 */ + 21, /* P2 */ + 19, /* P3 */ + 25, /* P4 */ + 27, /* P5 */ + 17, /* P6 */ +}; + +static rt_bool_t g_slcd_inited = RT_FALSE; + +static void slcd_set_digit_segments(uint8_t digit, uint16_t seg) +{ + uint8_t pin_lo; + + if ((digit < 1U) || (digit > 6U)) + { + return; + } + + pin_lo = digit_pin_lo[digit]; + SLCD_SetFrontPlaneSegments(BOARD_SLCD, pin_lo, (uint8_t)(seg & 0xFFU)); + SLCD_SetFrontPlaneSegments(BOARD_SLCD, pin_lo + 1U, (uint8_t)((seg >> 8) & 0xFFU)); +} + +int rt_hw_slcd_init(void) +{ + slcd_config_t config; + + if (g_slcd_inited) + { + return RT_EOK; + } + + BOARD_InitSLCDPins(); + + /* SLCD function clock on MCXA366. */ + CLOCK_SetupFRO16KClocking(kCLKE_16K_COREMAIN); + RESET_ReleasePeripheralReset(kSLCD0_RST_SHIFT_RSTn); + + SLCD_GetDefaultConfig(&config); + config.dutyCycle = kSLCD_1Div4DutyCycle; + config.slcdLowPinEnabled = 0xFFFF0000U; /* LCD_P16~P31 */ + config.slcdHighPinEnabled = 0U; + config.backPlaneLowPin = 0xF0000000U; /* LCD_P28~P31 */ + config.backPlaneHighPin = 0U; + config.faultConfig = RT_NULL; + SLCD_Init(BOARD_SLCD, &config); + + SLCD_SetBackPlanePhase(BOARD_SLCD, 28U, kSLCD_PhaseAActivate); + SLCD_SetBackPlanePhase(BOARD_SLCD, 29U, kSLCD_PhaseBActivate); + SLCD_SetBackPlanePhase(BOARD_SLCD, 30U, kSLCD_PhaseCActivate); + SLCD_SetBackPlanePhase(BOARD_SLCD, 31U, kSLCD_PhaseDActivate); + + SLCD_StartDisplay(BOARD_SLCD); + + g_slcd_inited = RT_TRUE; + return RT_EOK; +} + +void rt_hw_slcd_display_all(void) +{ + uint8_t pin; + + for (pin = 16U; pin <= 27U; pin++) + { + SLCD_SetFrontPlaneSegments(BOARD_SLCD, pin, + (uint8_t)(kSLCD_PhaseAActivate | kSLCD_PhaseBActivate | + kSLCD_PhaseCActivate | kSLCD_PhaseDActivate)); + } +} + +void rt_hw_slcd_clear(void) +{ + uint8_t pin; + + for (pin = 16U; pin <= 27U; pin++) + { + SLCD_SetFrontPlaneSegments(BOARD_SLCD, pin, (uint8_t)kSLCD_NoPhaseActivate); + } +} + +void rt_hw_slcd_display_num(uint8_t digit, uint8_t num) +{ + uint16_t seg = (num <= 9U) ? num_matrix[num] : num_matrix[10]; + + slcd_set_digit_segments(digit, seg); +} + +void rt_hw_slcd_display_string(const char *str) +{ + uint8_t digit; + uint8_t num; + uint8_t points = 0U; + + if (str == RT_NULL) + { + return; + } + + for (digit = 6U; digit >= 1U; digit--) + { + while ((*str == ':') || (*str == '.')) + { + if (*str == ':') + { + points |= SLCD_COLON; + } + else + { + points |= SLCD_DOT; + } + str++; + } + + if (*str == '\0') + { + num = 10U; + } + else if (*str == ' ') + { + num = 10U; + str++; + } + else + { + num = (uint8_t)(*str - '0'); + str++; + if (num > 9U) + { + num = 10U; + } + } + rt_hw_slcd_display_num(digit, num); + if (digit == 1U) + { + break; + } + } + + if (points != 0U) + { + rt_hw_slcd_display_point(points); + } +} + +void rt_hw_slcd_display_time(uint8_t hour, uint8_t minute) +{ + char buf[8]; + + if (hour > 99U) + { + hour = 99U; + } + if (minute > 99U) + { + minute = 99U; + } + + rt_snprintf(buf, sizeof(buf), "%02u:%02u", hour, minute); + rt_hw_slcd_clear(); + rt_hw_slcd_display_string(buf); +} + +void rt_hw_slcd_display_point(uint8_t point) +{ + uint8_t i; + + for (i = 0U; i < 6U; i++) + { + if (point & (1U << i)) + { + SLCD_SetFrontPlaneOnePhase(BOARD_SLCD, point_pin[i], kSLCD_PhaseAIndex, true); + } + } +} + +#endif /* BSP_USING_SLCD */ diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h new file mode 100644 index 00000000000..c99ffcba170 --- /dev/null +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h @@ -0,0 +1,46 @@ +/* + * Copyright (c) 2006-2026, RT-Thread Development Team + * Copyright 2024-2025 NXP + * + * SPDX-License-Identifier: Apache-2.0 + * + * FRDM-MCXA366 onboard segment LCD helper (wraps NXP fsl_slcd). + * Digit layout (left -> right): digit6 digit5 digit4 digit3 digit2 digit1 + * Points: P1/P2/P3 (upper) and P4/P5/P6 (lower). + */ + +#ifndef __DRV_SLCD_H__ +#define __DRV_SLCD_H__ + +#include + +#ifdef __cplusplus +extern "C" { +#endif + +#define SLCD_P1 0x01u +#define SLCD_P2 0x02u +#define SLCD_P3 0x04u +#define SLCD_P4 0x08u +#define SLCD_P5 0x10u +#define SLCD_P6 0x20u + +/* Colon between digit5 and digit4 (HH:MM / MM:SS). */ +#define SLCD_COLON (SLCD_P1 | SLCD_P4) +/* Decimal point between digit3 and digit2. */ +#define SLCD_DOT (SLCD_P6) + +int rt_hw_slcd_init(void); +void rt_hw_slcd_clear(void); +void rt_hw_slcd_display_all(void); +void rt_hw_slcd_display_num(uint8_t digit, uint8_t num); +void rt_hw_slcd_display_string(const char *str); +void rt_hw_slcd_display_point(uint8_t point); +/* Show HH:MM, e.g. rt_hw_slcd_display_time(12, 30) -> 12:30 */ +void rt_hw_slcd_display_time(uint8_t hour, uint8_t minute); + +#ifdef __cplusplus +} +#endif + +#endif /* __DRV_SLCD_H__ */ From b070c11474cff27168f1feee97c417435b4407ca Mon Sep 17 00:00:00 2001 From: yuplus Date: Thu, 16 Jul 2026 06:43:15 +0000 Subject: [PATCH 2/4] style: format code with clang-format [skip ci] --- .../board/MCUX_Config/board/pin_mux.c | 351 +++++++++--------- .../board/MCUX_Config/board/pin_mux.h | 24 +- .../mcxa/frdm-mcxa366/board/ports/drv_slcd.c | 8 +- .../mcxa/frdm-mcxa366/board/ports/drv_slcd.h | 2 +- 4 files changed, 200 insertions(+), 185 deletions(-) diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c index 08212d17ca6..c18475dbf10 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.c @@ -25,7 +25,8 @@ void BOARD_InitBootPins(void) static void release_reset_array(const reset_ip_name_t *resets, uint32_t count) { - for (uint32_t i = 0; i < count; i++) { + for (uint32_t i = 0; i < count; i++) + { RESET_ReleasePeripheralReset(resets[i]); } } @@ -36,7 +37,8 @@ void BOARD_InitPins(void) static const clock_ip_name_t gpio_clocks[] = GPIO_CLOCKS; // Enable clocks - for (uint32_t i = 0; i < ARRAY_SIZE(port_clocks); i++) { + for (uint32_t i = 0; i < ARRAY_SIZE(port_clocks); i++) + { CLOCK_EnableClock(port_clocks[i]); CLOCK_EnableClock(gpio_clocks[i]); } @@ -60,379 +62,394 @@ void BOARD_InitPins(void) release_reset_array(can_resets, ARRAY_SIZE(can_resets)); const port_pin_config_t port2_2_pin35_config = {/* Internal pull-up resistor is enabled */ - .pullSelect = kPORT_PullUp, + .pullSelect = kPORT_PullUp, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPUART2_TXD */ - .mux = kPORT_MuxAlt3, + .mux = kPORT_MuxAlt3, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT2_2 (pin 35) is configured as LPUART2_TXD */ PORT_SetPinConfig(PORT2, 2U, &port2_2_pin35_config); const port_pin_config_t port2_3_pin36_config = {/* Internal pull-up resistor is enabled */ - .pullSelect = kPORT_PullUp, + .pullSelect = kPORT_PullUp, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPUART2_RXD */ - .mux = kPORT_MuxAlt3, + .mux = kPORT_MuxAlt3, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT2_3 (pin 36) is configured as LPUART2_RXD */ PORT_SetPinConfig(PORT2, 3U, &port2_3_pin36_config); const port_pin_config_t LED_RED = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as P3_18 */ - .mux = kPORT_MuxAlt0, + .mux = kPORT_MuxAlt0, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_18 (pin 86) is configured as P3_18 */ PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_RED_PORT, BOARD_INITLEDSPINS_LED_RED_PIN, &LED_RED); const port_pin_config_t LED_GREEN = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as P3_19 */ - .mux = kPORT_MuxAlt0, + .mux = kPORT_MuxAlt0, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_19 (pin 85) is configured as P3_19 */ PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_GREEN_PORT, BOARD_INITLEDSPINS_LED_GREEN_PIN, &LED_GREEN); const port_pin_config_t LED_BLUE = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as P3_21 */ - .mux = kPORT_MuxAlt0, + .mux = kPORT_MuxAlt0, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_21 (pin 82) is configured as P3_21 */ PORT_SetPinConfig(BOARD_INITLEDSPINS_LED_BLUE_PORT, BOARD_INITLEDSPINS_LED_BLUE_PIN, &LED_BLUE); const port_pin_config_t port1_8_pin1_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPI2C2_SDA */ - .mux = kPORT_MuxAlt3, + .mux = kPORT_MuxAlt3, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT1_8 (pin 1) is configured as LPI2C2_SDA */ PORT_SetPinConfig(PORT1, 8U, &port1_8_pin1_config); const port_pin_config_t port1_9_pin2_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPI2C2_SCL */ - .mux = kPORT_MuxAlt3, + .mux = kPORT_MuxAlt3, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT1_9 (pin 2) is configured as LPI2C2_SCL */ PORT_SetPinConfig(PORT1, 9U, &port1_9_pin2_config); const port_pin_config_t port3_27_pin74_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPI2C3_SCL */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_27 (pin 74) is configured as LPI2C3_SCL */ PORT_SetPinConfig(PORT3, 27U, &port3_27_pin74_config); const port_pin_config_t port3_28_pin73_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPI2C3_SDA */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_28 (pin 73) is configured as LPI2C3_SDA */ PORT_SetPinConfig(PORT3, 28U, &port3_28_pin73_config); const port_pin_config_t port3_10_pin96_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPSPI1_SCK */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_10 (pin 96) is configured as LPSPI1_SCK */ PORT_SetPinConfig(PORT3, 10U, &port3_10_pin96_config); const port_pin_config_t port3_11_pin95_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPSPI1_PCS0 */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_11 (pin 95) is configured as LPSPI1_PCS0 */ PORT_SetPinConfig(PORT3, 11U, &port3_11_pin95_config); const port_pin_config_t port3_8_pin98_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPSPI1_SDO */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_8 (pin 98) is configured as LPSPI1_SDO */ PORT_SetPinConfig(PORT3, 8U, &port3_8_pin98_config); const port_pin_config_t port3_9_pin97_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as LPSPI1_SDI */ - .mux = kPORT_MuxAlt2, + .mux = kPORT_MuxAlt2, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT3_9 (pin 97) is configured as LPSPI1_SDI */ PORT_SetPinConfig(PORT3, 9U, &port3_9_pin97_config); const port_pin_config_t port1_11_pin4_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as CAN0_RXD */ - .mux = kPORT_MuxAlt11, + .mux = kPORT_MuxAlt11, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT1_11 (pin 4) is configured as CAN0_RXD */ PORT_SetPinConfig(PORT1, 11U, &port1_11_pin4_config); const port_pin_config_t port1_2_pin137_config = {/* Internal pull-up/down resistor is disabled */ - .pullSelect = kPORT_PullDisable, + .pullSelect = kPORT_PullDisable, /* Low internal pull resistor value is selected. */ - .pullValueSelect = kPORT_LowPullResistor, + .pullValueSelect = kPORT_LowPullResistor, /* Fast slew rate is configured */ - .slewRate = kPORT_FastSlewRate, + .slewRate = kPORT_FastSlewRate, /* Passive input filter is disabled */ - .passiveFilterEnable = kPORT_PassiveFilterDisable, + .passiveFilterEnable = kPORT_PassiveFilterDisable, /* Open drain output is disabled */ - .openDrainEnable = kPORT_OpenDrainDisable, + .openDrainEnable = kPORT_OpenDrainDisable, /* Low drive strength is configured */ - .driveStrength = kPORT_LowDriveStrength, + .driveStrength = kPORT_LowDriveStrength, /* Normal drive strength is configured */ - .driveStrength1 = kPORT_NormalDriveStrength, + .driveStrength1 = kPORT_NormalDriveStrength, /* Pin is configured as CAN0_TXD */ - .mux = kPORT_MuxAlt11, + .mux = kPORT_MuxAlt11, /* Digital input enabled */ - .inputBuffer = kPORT_InputBufferEnable, + .inputBuffer = kPORT_InputBufferEnable, /* Digital input is not inverted */ - .invertInput = kPORT_InputNormal, + .invertInput = kPORT_InputNormal, /* Pin Control Register fields [15:0] are not locked */ - .lockRegister = kPORT_UnlockRegister}; + .lockRegister = kPORT_UnlockRegister + }; /* PORT1_2 (pin 137) is configured as CAN0_TXD */ PORT_SetPinConfig(PORT1, 2U, &port1_2_pin137_config); } diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h index b57711d6164..55bbbc7fd6f 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/MCUX_Config/board/pin_mux.h @@ -18,13 +18,13 @@ */ /* Symbols to be used with GPIO driver */ -#define BOARD_INITLEDSPINS_LED_RED_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_RED_GPIO_PIN 18U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_RED_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_RED_GPIO_PIN 18U /*!<@brief GPIO pin number */ #define BOARD_INITLEDSPINS_LED_RED_GPIO_PIN_MASK (1U << 18U) /*!<@brief GPIO pin mask */ /* Symbols to be used with PORT driver */ -#define BOARD_INITLEDSPINS_LED_RED_PORT PORT3 /*!<@brief PORT peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_RED_PIN 18U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_RED_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_RED_PIN 18U /*!<@brief PORT pin number */ #define BOARD_INITLEDSPINS_LED_RED_PIN_MASK (1U << 18U) /*!<@brief PORT pin mask */ /* @} */ @@ -32,13 +32,13 @@ @{ */ /* Symbols to be used with GPIO driver */ -#define BOARD_INITLEDSPINS_LED_GREEN_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_GREEN_GPIO_PIN 19U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_GREEN_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_GREEN_GPIO_PIN 19U /*!<@brief GPIO pin number */ #define BOARD_INITLEDSPINS_LED_GREEN_GPIO_PIN_MASK (1U << 19U) /*!<@brief GPIO pin mask */ /* Symbols to be used with PORT driver */ -#define BOARD_INITLEDSPINS_LED_GREEN_PORT PORT3 /*!<@brief PORT peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_GREEN_PIN 19U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_GREEN_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_GREEN_PIN 19U /*!<@brief PORT pin number */ #define BOARD_INITLEDSPINS_LED_GREEN_PIN_MASK (1U << 19U) /*!<@brief PORT pin mask */ /* @} */ @@ -46,13 +46,13 @@ @{ */ /* Symbols to be used with GPIO driver */ -#define BOARD_INITLEDSPINS_LED_BLUE_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_BLUE_GPIO_PIN 21U /*!<@brief GPIO pin number */ +#define BOARD_INITLEDSPINS_LED_BLUE_GPIO GPIO3 /*!<@brief GPIO peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_BLUE_GPIO_PIN 21U /*!<@brief GPIO pin number */ #define BOARD_INITLEDSPINS_LED_BLUE_GPIO_PIN_MASK (1U << 21U) /*!<@brief GPIO pin mask */ /* Symbols to be used with PORT driver */ -#define BOARD_INITLEDSPINS_LED_BLUE_PORT PORT3 /*!<@brief PORT peripheral base pointer */ -#define BOARD_INITLEDSPINS_LED_BLUE_PIN 21U /*!<@brief PORT pin number */ +#define BOARD_INITLEDSPINS_LED_BLUE_PORT PORT3 /*!<@brief PORT peripheral base pointer */ +#define BOARD_INITLEDSPINS_LED_BLUE_PIN 21U /*!<@brief PORT pin number */ #define BOARD_INITLEDSPINS_LED_BLUE_PIN_MASK (1U << 21U) /*!<@brief PORT pin mask */ /* @} */ diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c index b3e80028fb8..c3d9e9a41cd 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.c @@ -36,8 +36,7 @@ #define SEGE 0x0800u /* Low byte -> pin_lo (A/B/C/D), high byte -> pin_hi (P/F/G/E). */ -static const uint16_t num_matrix[] = -{ +static const uint16_t num_matrix[] = { SEGA | SEGB | SEGC | SEGD | SEGE | SEGF, /* 0 */ SEGB | SEGC, /* 1 */ SEGA | SEGB | SEGG | SEGE | SEGD, /* 2 */ @@ -52,11 +51,10 @@ static const uint16_t num_matrix[] = }; /* digit 1..6 -> low front-plane pin (high pin is low+1) */ -static const uint8_t digit_pin_lo[] = {0, 16, 18, 20, 22, 24, 26}; +static const uint8_t digit_pin_lo[] = { 0, 16, 18, 20, 22, 24, 26 }; /* SLCD_Px point -> front-plane pin (phase A / SEGP) */ -static const uint8_t point_pin[] = -{ +static const uint8_t point_pin[] = { 23, /* P1 */ 21, /* P2 */ 19, /* P3 */ diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h index c99ffcba170..6b0cb563016 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/ports/drv_slcd.h @@ -28,7 +28,7 @@ extern "C" { /* Colon between digit5 and digit4 (HH:MM / MM:SS). */ #define SLCD_COLON (SLCD_P1 | SLCD_P4) /* Decimal point between digit3 and digit2. */ -#define SLCD_DOT (SLCD_P6) +#define SLCD_DOT (SLCD_P6) int rt_hw_slcd_init(void); void rt_hw_slcd_clear(void); From 7873696b29b38204e54251a9323d461484ad4fce Mon Sep 17 00:00:00 2001 From: Yu+ Date: Thu, 16 Jul 2026 15:26:46 +0800 Subject: [PATCH 3/4] Update default for SLCD display configuration Change default setting for onboard SLCD display to 'n'. --- bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig index bd7ecf5f75a..23600339311 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/board/Kconfig @@ -135,7 +135,7 @@ endmenu menu "Onboard Peripheral Drivers" config BSP_USING_SLCD bool "Enable onboard SLCD display" - default y + default n help Enable FRDM-MCXA366 onboard segment LCD (6 digits). From da7de0d0a1ab8c0a05204c456f7bd72c8e6e7fba Mon Sep 17 00:00:00 2001 From: WANGYU Date: Fri, 17 Jul 2026 16:15:26 +0800 Subject: [PATCH 4/4] add ci.attach for slcd --- .../.ci/attachconfig/ci.attachconfig.yml | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/bsp/nxp/mcx/mcxa/frdm-mcxa366/.ci/attachconfig/ci.attachconfig.yml b/bsp/nxp/mcx/mcxa/frdm-mcxa366/.ci/attachconfig/ci.attachconfig.yml index adc44d20453..e7a22c8b981 100644 --- a/bsp/nxp/mcx/mcxa/frdm-mcxa366/.ci/attachconfig/ci.attachconfig.yml +++ b/bsp/nxp/mcx/mcxa/frdm-mcxa366/.ci/attachconfig/ci.attachconfig.yml @@ -31,6 +31,23 @@ Peripheral.arduino: kconfig: - CONFIG_BSP_USING_ARDUINO=y +Peripheral.canfd: + kconfig: + - CONFIG_BSP_USING_CAN=y + - CONFIG_BSP_USING_CAN0=y + - CONFIG_BSP_USING_CAN1=y + - CONFIG_RT_USING_CAN=y + - CONFIG_RT_CAN_USING_HDR=y + - CONFIG_RT_CAN_USING_CANFD=y + - CONFIG_RT_CANMSG_BOX_SZ=16 + - CONFIG_RT_CANSND_BOX_NUM=1 + - CONFIG_RT_CANSND_MSG_TIMEOUT=100 + - CONFIG_RT_CAN_NB_TX_FIFO_SIZE=1024 + +Peripheral.slcd: + kconfig: + - CONFIG_BSP_USING_SLCD=y + # ------ utest CI ------ utest.pin: <<: *scons