Skip to content

Commit 132cb92

Browse files
ZhaoxiangJinNeilChen93
authored andcommitted
[MCUX-85549] Update MCX SPC driver and adjust conditional macro logic
1. Add feature macro FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REFTRIM_REG to be compatible with some platforms where SPC has no SRAMRETLDO_REFTRIM register. 2. FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REFTRIM_REG is used to indicate whether SRAMRETLDO_REFTRIM exists or not. FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG is used to indicate whether SRAMRETLDO_CNTRL exists or not. Signed-off-by: Zhaoxiang Jin <Zhaoxiang.Jin_1@nxp.com>
1 parent b3a25e8 commit 132cb92

3 files changed

Lines changed: 14 additions & 10 deletions

File tree

drivers/mcx_spc/CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
# Copyright 2024-2025 NXP
1+
# Copyright 2024-2026 NXP
22
#
33
# SPDX-License-Identifier: BSD-3-Clause
44

55
if(CONFIG_MCUX_COMPONENT_driver.mcx_spc)
6-
mcux_component_version(2.10.1)
6+
mcux_component_version(2.11.0)
77

88
mcux_add_source(SOURCES fsl_spc.h fsl_spc.c)
99

drivers/mcx_spc/doxygen/ChangeLog_spc.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# MCX_SPC
22

3+
## [2.11.0]
4+
5+
- New Features
6+
- Add feature macro FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REFTRIM_REG to be
7+
compatible with some platforms where SPC has no SRAMRETLDO_REFTRIM register.
8+
39
## [2.10.1]
410

511
- Improvements

drivers/mcx_spc/fsl_spc.h

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*
2-
* Copyright 2022-2025 NXP
2+
* Copyright 2022-2026 NXP
33
*
44
* SPDX-License-Identifier: BSD-3-Clause
55
*/
@@ -19,8 +19,8 @@
1919

2020
/*! @name Driver version */
2121
/*! @{ */
22-
/*! @brief SPC driver version 2.10.1. */
23-
#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 10, 1))
22+
/*! @brief SPC driver version 2.11.0. */
23+
#define FSL_SPC_DRIVER_VERSION (MAKE_VERSION(2, 11, 0))
2424
/*! @} */
2525

2626
#define SPC_EVD_CFG_REG_EVDISO_SHIFT 0UL
@@ -664,13 +664,11 @@ static inline void SPC_ClearPowerDomainLowPowerRequestFlag(SPC_Type *base, spc_p
664664

665665
/*! @} */
666666

667-
#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG)
668667
/*!
669668
* @name SRAM Retention LDO Control APIs
670669
* @{
671670
*/
672-
673-
#ifdef SPC_SRAMRETLDO_REFTRIM_REFTRIM_MASK
671+
#if !(defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REFTRIM_REG) && (FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REFTRIM_REG == 0U))
674672
/*!
675673
* @brief Trims SRAM retention regulator reference voltage, trim step is 12 mV, range is around 0.48V to 0.85V.
676674
*
@@ -684,6 +682,7 @@ static inline void SPC_TrimSRAMLdoRefVoltage(SPC_Type *base, uint8_t trimValue)
684682
}
685683
#endif
686684

685+
#if (defined(FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG) && FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG)
687686
/*!
688687
* @brief Enables/disables SRAM retention LDO.
689688
*
@@ -727,9 +726,8 @@ static inline void SPC_UnRetainSRAMArray(SPC_Type *base, uint8_t mask)
727726
{
728727
base->SRAMRETLDO_CNTRL &= ~SPC_SRAMRETLDO_CNTRL_SRAM_RET_EN(mask);
729728
}
730-
731-
/*! @} */
732729
#endif /* FSL_FEATURE_MCX_SPC_HAS_SRAMRETLDO_REG */
730+
/*! @} */
733731

734732
/*!
735733
* @name Low Power Request configuration

0 commit comments

Comments
 (0)