![]() |
MCUXpresso SDK API Reference Manual
Rev. 0
NXP Semiconductors
|
The MCUXpresso SDK provides a peripheral driver for the Multicore System Mode Controller (MSMC) module of MCUXpresso SDK devices.
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/msmc
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/msmc
Refer to the driver examples codes located at <SDK_ROOT>/boards/<BOARD>/driver_examples/msmc
SMC driver provides APIs to set MCU to different wait modes and stop modes. At the same time, there are pre-function and post-function for the modes setting. The pre-function and post-function are used for:
For other use cases, please refer to the comments of the MSMC driver header file. Some example codes are also provided.
Files | |
file | fsl_msmc.h |
Data Structures | |
struct | smc_reset_pin_filter_config_t |
Reset pin filter configuration. More... | |
Enumerations | |
enum | smc_power_mode_protection_t { kSMC_AllowPowerModeVlls = SMC_PMPROT_AVLLS_MASK, kSMC_AllowPowerModeLls = SMC_PMPROT_ALLS_MASK, kSMC_AllowPowerModeVlp = SMC_PMPROT_AVLP_MASK, kSMC_AllowPowerModeHsrun = SMC_PMPROT_AHSRUN_MASK, kSMC_AllowPowerModeAll } |
Power Modes Protection. More... | |
enum | smc_power_state_t { kSMC_PowerStateRun = 1U, kSMC_PowerStateStop = 1U << 1U, kSMC_PowerStateVlpr = 1U << 2U, kSMC_PowerStateHsrun = 1U << 7U } |
Power Modes in PMSTAT. More... | |
enum | smc_power_stop_entry_status_t { kSMC_PowerStopEntryAlt0 = 1U, kSMC_PowerStopEntryAlt1 = 1U << 1, kSMC_PowerStopEntryAlt2 = 1U << 2, kSMC_PowerStopEntryAlt3 = 1U << 3, kSMC_PowerStopEntryAlt4 = 1U << 4, kSMC_PowerStopEntryAlt5 = 1U << 5 } |
Power Stop Entry Status in PMSTAT. More... | |
enum | smc_run_mode_t { kSMC_RunNormal = 0U, kSMC_RunVlpr = 2U, kSMC_Hsrun = 3U } |
Run mode definition. More... | |
enum | smc_stop_mode_t { kSMC_StopNormal = 0U, kSMC_StopVlps = 2U, kSMC_StopLls = 3U, kSMC_StopVlls = 4U } |
Stop mode definition. More... | |
enum | smc_partial_stop_option_t { kSMC_PartialStop = 0U, kSMC_PartialStop1 = 1U, kSMC_PartialStop2 = 2U, kSMC_PartialStop3 = 3U } |
Partial STOP option. More... | |
enum | _smc_status { kStatus_SMC_StopAbort = MAKE_STATUS(kStatusGroup_POWER, 0) } |
SMC configuration status. More... | |
enum | smc_reset_source_t { kSMC_SourceWakeup = SMC_SRS_WAKEUP_MASK, kSMC_SourcePor = SMC_SRS_POR_MASK, kSMC_SourceLvd = SMC_SRS_LVD_MASK, kSMC_SourceHvd = SMC_SRS_HVD_MASK, kSMC_SourceWarm = SMC_SRS_WARM_MASK, kSMC_SourceFatal = SMC_SRS_FATAL_MASK, kSMC_SourceCore, kSMC_SourcePin = SMC_SRS_PIN_MASK, kSMC_SourceMdm = SMC_SRS_MDM_MASK, kSMC_SourceRstAck = SMC_SRS_RSTACK_MASK, kSMC_SourceStopAck = SMC_SRS_STOPACK_MASK, kSMC_SourceScg = SMC_SRS_SCG_MASK, kSMC_SourceWdog = SMC_SRS_WDOG_MASK, kSMC_SourceSoftware = SMC_SRS_SW_MASK, kSMC_SourceLockup = SMC_SRS_LOCKUP_MASK, kSMC_SourceJtag = SMC_SRS_JTAG_MASK , kSMC_SourceSecVio = SMC_SRS_SECVIO_MASK, kSMC_SourceTamper = SMC_SRS_TAMPER_MASK, kSMC_SourceCore0 = SMC_SRS_CORE0_MASK, kSMC_SourceCore1 = SMC_SRS_CORE1_MASK } |
System Reset Source Name definitions. More... | |
enum | smc_interrupt_enable_t { kSMC_IntNone = 0U, kSMC_IntPin = SMC_SRIE_PIN_MASK, kSMC_IntMdm = SMC_SRIE_MDM_MASK, kSMC_IntStopAck = SMC_SRIE_STOPACK_MASK, kSMC_IntWdog = SMC_SRIE_WDOG_MASK, kSMC_IntSoftware = SMC_SRIE_SW_MASK, kSMC_IntLockup = SMC_SRIE_LOCKUP_MASK , kSMC_IntAll } |
System reset interrupt enable bit definitions. More... | |
Driver version | |
#define | FSL_MSMC_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) |
MSMC driver version. More... | |
System mode controller APIs | |
static void | SMC_SetPowerModeProtection (SMC_Type *base, uint8_t allowedModes) |
Configures all power mode protection settings. More... | |
static smc_power_state_t | SMC_GetPowerModeState (SMC_Type *base) |
Gets the current power mode status. More... | |
static void | SMC_PreEnterStopModes (void) |
Prepare to enter stop modes. More... | |
static void | SMC_PostExitStopModes (void) |
Recovering after wake up from stop modes. More... | |
static void | SMC_PreEnterWaitModes (void) |
Prepare to enter wait modes. More... | |
static void | SMC_PostExitWaitModes (void) |
Recovering after wake up from stop modes. More... | |
status_t | SMC_SetPowerModeRun (SMC_Type *base) |
Configure the system to RUN power mode. More... | |
status_t | SMC_SetPowerModeHsrun (SMC_Type *base) |
Configure the system to HSRUN power mode. More... | |
status_t | SMC_SetPowerModeWait (SMC_Type *base) |
Configure the system to WAIT power mode. More... | |
status_t | SMC_SetPowerModeStop (SMC_Type *base, smc_partial_stop_option_t option) |
Configure the system to Stop power mode. More... | |
status_t | SMC_SetPowerModeVlpr (SMC_Type *base) |
Configure the system to VLPR power mode. More... | |
status_t | SMC_SetPowerModeVlpw (SMC_Type *base) |
Configure the system to VLPW power mode. More... | |
status_t | SMC_SetPowerModeVlps (SMC_Type *base) |
Configure the system to VLPS power mode. More... | |
status_t | SMC_SetPowerModeLls (SMC_Type *base) |
Configure the system to LLS power mode. More... | |
status_t | SMC_SetPowerModeVlls (SMC_Type *base) |
Configure the system to VLLS power mode. More... | |
static uint32_t | SMC_GetPreviousResetSources (SMC_Type *base) |
Gets the reset source status which caused a previous reset. More... | |
static uint32_t | SMC_GetStickyResetSources (SMC_Type *base) |
Gets the sticky reset source status. More... | |
static void | SMC_ClearStickyResetSources (SMC_Type *base, uint32_t sourceMasks) |
Clears the sticky reset source status. More... | |
void | SMC_ConfigureResetPinFilter (SMC_Type *base, const smc_reset_pin_filter_config_t *config) |
Configures the reset pin filter. More... | |
static void | SMC_SetSystemResetInterruptConfig (SMC_Type *base, uint32_t intMask) |
Sets the system reset interrupt configuration. More... | |
static uint32_t | SMC_GetResetInterruptSourcesStatus (SMC_Type *base) |
Gets the source status of the system reset interrupt. More... | |
static void | SMC_ClearResetInterruptSourcesStatus (SMC_Type *base, uint32_t intMask) |
Clears the source status of the system reset interrupt. More... | |
static void | SMC_SetCoreSoftwareResetConfig (SMC_Type *base, uint32_t intMask) |
Sets the core software reset feature configuration. More... | |
static uint32_t | SMC_GetBootOptionConfig (SMC_Type *base) |
Gets the boot option configuration. More... | |
struct smc_reset_pin_filter_config_t |
Data Fields | |
uint8_t | slowClockFilterCount |
Reset pin bus clock filter width from 1 to 32 slow clock cycles. More... | |
bool | enableFilter |
Reset pin filter enable/disable. More... | |
uint8_t smc_reset_pin_filter_config_t::slowClockFilterCount |
bool smc_reset_pin_filter_config_t::enableFilter |
#define FSL_MSMC_DRIVER_VERSION (MAKE_VERSION(2, 1, 1)) |
enum smc_power_state_t |
enum smc_run_mode_t |
enum smc_stop_mode_t |
enum _smc_status |
enum smc_reset_source_t |
|
inlinestatic |
This function configures the power mode protection settings for supported power modes in the specified chip family. The available power modes are defined in the smc_power_mode_protection_t. This should be done at an early system level initialization stage. See the reference manual for details. This register can only write once after the power reset.
The allowed modes are passed as bit map, for example, to allow LLS and VLLS, use SMC_SetPowerModeProtection(kSMC_AllowPowerModeLls | kSMC_AllowPowerModeVlls). To allow all modes, use SMC_SetPowerModeProtection(kSMC_AllowPowerModeAll).
allowedModes | Bitmap of the allowed power modes. |
|
inlinestatic |
This function returns the current power mode stat. Once application switches the power mode, it should always check the stat to check whether it runs into the specified mode or not. An application should check this mode before switching to a different mode. The system requires that only certain modes can switch to other specific modes. See the reference manual for details and the smc_power_state_t for information about the power stat.
base | SMC peripheral base address. |
|
inlinestatic |
This function should be called before entering STOP/VLPS/LLS/VLLS modes.
|
inlinestatic |
This function should be called after wake up from STOP/VLPS/LLS/VLLS modes. It is used together with SMC_PreEnterStopModes.
|
inlinestatic |
This function should be called before entering WAIT/VLPW modes..
|
inlinestatic |
This function should be called after wake up from WAIT/VLPW modes. It is used together with SMC_PreEnterWaitModes.
status_t SMC_SetPowerModeRun | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeHsrun | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeWait | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeStop | ( | SMC_Type * | base, |
smc_partial_stop_option_t | option | ||
) |
base | SMC peripheral base address. |
option | Partial Stop mode option. |
status_t SMC_SetPowerModeVlpr | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeVlpw | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeVlps | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeLls | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
status_t SMC_SetPowerModeVlls | ( | SMC_Type * | base | ) |
base | SMC peripheral base address. |
|
inlinestatic |
This function gets the current reset source status. Use source masks defined in the smc_reset_source_t to get the desired source status.
Example: To get all reset source statuses.
Example: To test whether the MCU is reset using Watchdog.
Example: To test multiple reset sources. uint32_t resetStatus;
resetStatus = SMC_GetPreviousResetSources(SMC0) & (kSMC_SourceWdog | kSMC_SourcePin);
base | SMC peripheral base address. |
|
inlinestatic |
This function gets the current reset source status that has not been cleared by software for some specific source.
Example: To get all reset source statuses.
Example, To test whether the MCU is reset using Watchdog.
Example To test multiple reset sources.
base | SMC peripheral base address. |
|
inlinestatic |
This function clears the sticky system reset flags indicated by source masks.
Example: Clears multiple reset sources.
base | SMC peripheral base address. |
sourceMasks | reset source status bit map |
void SMC_ConfigureResetPinFilter | ( | SMC_Type * | base, |
const smc_reset_pin_filter_config_t * | config | ||
) |
This function sets the reset pin filter including the enablement/disablement and filter width.
base | SMC peripheral base address. |
config | Pointer to the configuration structure. |
|
inlinestatic |
For a graceful shut down, the MSMC supports delaying the assertion of the system reset for a period of time when the reset interrupt is generated. This function can be used to enable the interrupt. The interrupts are passed in as bit mask. See smc_interrupt_enable_t for details. For example, to delay a reset after the WDOG timeout or PIN reset occurs, configure as follows: SMC_SetSystemResetInterruptConfig(SMC0, (kSMC_IntWdog | kSMC_IntPin));
base | SMC peripheral base address. |
intMask | Bit mask of the system reset interrupts to enable. See smc_interrupt_enable_t for details. |
|
inlinestatic |
This function gets the source status of the reset interrupt. Use source masks defined in the smc_interrupt_enable_t to get the desired source status.
Example: To get all reset interrupt source statuses.
Example: To test whether the reset interrupt of Watchdog is pending.
Example: To test multiple reset interrupt sources.
base | SMC peripheral base address. |
|
inlinestatic |
This function clears the source status of the reset interrupt. Use source masks defined in the smc_interrupt_enable_t to get the desired source status.
Example: To clear all reset interrupt source statuses.
Example, To clear the reset interrupt of Watchdog.
Example, To clear multiple reset interrupt sources status.
base | SMC peripheral base address. |
All | reset interrupt source status bit map to clear. |
|
inlinestatic |
The MSMC supports delaying the assertion of the system reset for a period of time while a core software reset is generated. This allows software to recover without reseting the entire system. This function can be used to enable/disable the core software reset feature. The interrupts are passed in as bit mask. See smc_interrupt_enable_t for details. For example, to delay a system after the WDOG timeout or PIN core software reset occurs, configure as follows: SMC_SetCoreSoftwareResetConfig(SMC0, (kSMC_IntWdog | kSMC_IntPin));
base | SMC peripheral base address. |
intMask | Bit mask of the core software reset to enable. See smc_interrupt_enable_t for details. |
|
inlinestatic |
This function gets the boot option configuration of MSMC.
base | SMC peripheral base address. |