MCUXpresso SDK API Reference Manual  Rev. 0
NXP Semiconductors
 All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
SSARC: State Save and Restore Controller

Overview

The MCUXpresso SDK provides a peripheral driver for the State Save and Restore Controller(SSARC) module of MCUXpresso SDK devices.

The SSARC driver supports the setting of descriptors and groups. For the setting of descriptors, the function SSARC_SetDescriptorConfig() can be used to config the type of descriptors' operation. For the setting of groups, the function SSARC_GroupInit() can be used to config the groups and enable the groups. The function SSARC_GroupDeinit() can be used to disable the groups.

Data Structures

struct  ssarc_descriptor_config_t
 The config of descriptor. More...
 
struct  ssarc_group_config_t
 The config of the group. More...
 

Enumerations

enum  _ssarc_interrupt_status_flags {
  kSSARC_AddressErrorFlag,
  kSSARC_AHBErrorFlag,
  kSSARC_SoftwareRequestDoneFlag = SSARC_LP_INT_STATUS_SW_REQ_DONE_MASK,
  kSSARC_TimeoutFlag = SSARC_LP_INT_STATUS_TIMEOUT_MASK,
  kSSARC_GroupConflictFlag = SSARC_LP_INT_STATUS_GROUP_CONFLICT_MASK
}
 The enumeration of ssarc status flags. More...
 
enum  ssarc_descriptor_register_size_t {
  kSSARC_DescriptorRegister8bitWidth = 0x0U,
  kSSARC_DescriptorRegister16bitWidth = 0x1U,
  kSSARC_DescriptorRegister32bitWidth = 0x2U
}
 The size of the register to be saved/restored. More...
 
enum  ssarc_descriptor_operation_t {
  kSSARC_SaveDisableRestoreDisable = 0x0U,
  kSSARC_SaveEnableRestoreDisable,
  kSSARC_SaveDisableRestoreEnable,
  kSSARC_SaveEnableRestoreEnable
}
 The operation of the descriptor. More...
 
enum  ssarc_descriptor_type_t {
  kSSARC_ReadValueWriteBack = 0x00U,
  kSSARC_WriteFixedValue = 0x01U,
  kSSARC_RMWOr = 0x02U,
  kSSARC_RMWAnd = 0x03U,
  kSSARC_DelayCycles = 0x04U,
  kSSARC_Polling0 = 0x05U,
  kSSARC_Polling1 = 0x06U
}
 The type of operation. More...
 
enum  ssarc_save_restore_order_t {
  kSSARC_ProcessFromStartToEnd = 0U,
  kSSARC_ProcessFromEndToStart = 1U
}
 The order of the restore/save operation. More...
 
enum  ssarc_software_trigger_mode_t {
  kSSARC_TriggerSaveRequest = SSARC_LP_DESC_CTRL1_SW_TRIG_SV_MASK,
  kSSARC_TriggerRestoreRequest
}
 Software trigger mode. More...
 

Driver version

#define FSL_SSARC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))
 SSARC driver version 2.0.0. More...
 

Descriptor related APIs.

static uint32_t SSARC_GetDescriptorRegisterAddress (SSARC_HP_Type *base, uint32_t index)
 Gets the address of the register to be saved/restored. More...
 
static uint32_t SSARC_GetDescriptorRegisterData (SSARC_HP_Type *base, uint32_t index)
 Gets the value of the register to be saved/restored. More...
 
void SSARC_SetDescriptorConfig (SSARC_HP_Type *base, uint32_t index, const ssarc_descriptor_config_t *config)
 Sets the configuration of the descriptor. More...
 

Group related APIs

void SSARC_GroupInit (SSARC_LP_Type *base, uint8_t groupID, const ssarc_group_config_t *config)
 Init the selected group. More...
 
static void SSARC_GroupDeinit (SSARC_LP_Type *base, uint8_t groupID)
 De-init the selected group. More...
 
static void SSARC_LockGroupDomain (SSARC_LP_Type *base, uint8_t groupID)
 Locks the configuration of the domain. More...
 
static void SSARC_LockGroupWrite (SSARC_LP_Type *base, uint8_t groupID)
 Locks the write access to the control registers and descriptors for the selected group. More...
 
static void SSARC_LockGroupRead (SSARC_LP_Type *base, uint8_t groupID)
 Locks the read access to the control registers and descriptors for the selected group. More...
 
void SSARC_TriggerSoftwareRequest (SSARC_LP_Type *base, uint8_t groupID, ssarc_software_trigger_mode_t mode)
 Triggers software request. More...
 

Global setting related APIs.

static void SSARC_ResetWholeBlock (SSARC_LP_Type *base)
 Resets the whole SSARC block by software. More...
 
static void SSARC_EnableHardwareRequest (SSARC_LP_Type *base, bool enable)
 Enable/Disable save/restore request from the GPC module. More...
 

Status related APIs.

static uint32_t SSARC_GetStatusFlags (SSARC_LP_Type *base)
 Clears status flags. More...
 
static void SSARC_ClearStatusFlags (SSARC_LP_Type *base, uint32_t mask)
 Clears status flags. More...
 
static uint32_t SSARC_GetErrorIndex (SSARC_LP_Type *base)
 Gets the error index that indicates which descriptor will trigger the AHB_ERR or ADDR_ERR interrupt. More...
 

Time out related APIs.

static void SSARC_SetTimeoutValue (SSARC_LP_Type *base, uint32_t value)
 Sets timeout value for the entire group to complete. More...
 
static uint32_t SSARC_GetTimeoutValue (SSARC_LP_Type *base)
 Gets timeout value. More...
 

Pending group related APIs.

static uint16_t SSARC_GetHardwareRequestRestorePendingGroup (SSARC_LP_Type *base)
 Gets the value that indicates which groups are pending for restore from hardware request. More...
 
static uint16_t SSARC_GetHardwareRequestSavePendingGroup (SSARC_LP_Type *base)
 Gets the value that indicates which groups are pending for save from hardware request. More...
 
static uint16_t SSARC_GetSoftwareRequestRestorePendingGroup (SSARC_LP_Type *base)
 Gets the value that indicates which groups are pending for restore from software request. More...
 
static uint16_t SSARC_GetSoftwareRequestSavePendingGroup (SSARC_LP_Type *base)
 Gets the value that indicates which groups are pending for save from software request. More...
 

Data Structure Documentation

struct ssarc_descriptor_config_t

Data Fields

ssarc_descriptor_register_size_t size
 The size of register to be saved/restored. More...
 
uint32_t registerAddress
 The address of the register/memory to be saved/restored. More...
 
uint32_t * registerDataPtr
 The pointer to the value of the register/memory to be saved/restored. More...
 
ssarc_descriptor_operation_t operation
 The operation mode of descriptor. More...
 
ssarc_descriptor_type_t type
 The type of operation. More...
 

Field Documentation

ssarc_descriptor_register_size_t ssarc_descriptor_config_t::size
uint32_t ssarc_descriptor_config_t::registerAddress
uint32_t* ssarc_descriptor_config_t::registerDataPtr

Normally, it is no need to set the value of the register/memory and set this parameter as NULL.

ssarc_descriptor_operation_t ssarc_descriptor_config_t::operation
ssarc_descriptor_type_t ssarc_descriptor_config_t::type
struct ssarc_group_config_t

Data Fields

ssarc_restore_resource_domain_name_t restoreDomain
 Restore resource domain. More...
 
uint32_t startIndex
 The index of the first descriptor of the group. More...
 
uint32_t endIndex
 The index of the last descriptor of the group. More...
 
ssarc_save_restore_order_t restoreOrder
 The restore order. More...
 
ssarc_save_restore_order_t saveOrder
 The save order. More...
 
uint8_t restorePriority
 Restore priority of current group. More...
 
uint8_t savePriority
 Save priority of current group. More...
 
ssarc_power_domain_name_t powerDomain
 Power domain. More...
 
uint32_t highestAddress
 Highest address that can be accessed for the descriptors in the group. More...
 
uint32_t lowestAddress
 Lowest address that can be accessed for the descriptors in the group. More...
 

Field Documentation

ssarc_restore_resource_domain_name_t ssarc_group_config_t::restoreDomain
uint32_t ssarc_group_config_t::startIndex
uint32_t ssarc_group_config_t::endIndex
ssarc_save_restore_order_t ssarc_group_config_t::restoreOrder
ssarc_save_restore_order_t ssarc_group_config_t::saveOrder
uint8_t ssarc_group_config_t::restorePriority

0 is the highest priority, 15 is the lowest priority

uint8_t ssarc_group_config_t::savePriority

0 is the highest priority, 15 is the lowest priority.

ssarc_power_domain_name_t ssarc_group_config_t::powerDomain
uint32_t ssarc_group_config_t::highestAddress
uint32_t ssarc_group_config_t::lowestAddress

Macro Definition Documentation

#define FSL_SSARC_DRIVER_VERSION   (MAKE_VERSION(2, 0, 0))

Enumeration Type Documentation

Enumerator
kSSARC_AddressErrorFlag 

If the descriptor is not in the range, assert address error.

kSSARC_AHBErrorFlag 

If any AHB master access receives none-OKAY, assert AHB error.

kSSARC_SoftwareRequestDoneFlag 

If a software triggered save or restore process is completed, assert sofware request done .

kSSARC_TimeoutFlag 

If processing of a group has exceeded the timeout value, assert timeout.

kSSARC_GroupConflictFlag 

Group conflict.

Enumerator
kSSARC_DescriptorRegister8bitWidth 

The register to be saved/restored is 8 bit width.

kSSARC_DescriptorRegister16bitWidth 

The register to be saved/restored is 16 bit width.

kSSARC_DescriptorRegister32bitWidth 

The register to be saved/restored is 32 bit width.

Enumerator
kSSARC_SaveDisableRestoreDisable 

Disable Save operation, disable restore operation.

kSSARC_SaveEnableRestoreDisable 

Enable Save operation, disable restore operation.

kSSARC_SaveDisableRestoreEnable 

Disable Save operation, enable restore operation.

kSSARC_SaveEnableRestoreEnable 

Enable Save operation, enable restore operation.

Enumerator
kSSARC_ReadValueWriteBack 

Read the register value on save operation and write it back on restore operation.

kSSARC_WriteFixedValue 

Always write a fixed value from DATA[31:0].

kSSARC_RMWOr 

Read register, OR with the DATA[31:0], and write it back.

kSSARC_RMWAnd 

Read register, AND with the DATA[31:0], and write it back.

kSSARC_DelayCycles 

Delay for number of cycles based on the DATA[31:0].

kSSARC_Polling0 

Read the register until read_data[31:0] & DATA[31:0] == 0.

kSSARC_Polling1 

Read the register until read_data[31:0] & DATA[31:0] != 0.

Enumerator
kSSARC_ProcessFromStartToEnd 

Descriptors within the group are processed from start to end.

kSSARC_ProcessFromEndToStart 

Descriptors within the group are processed from end to start.

Enumerator
kSSARC_TriggerSaveRequest 

Don't trigger restore operation, trigger the save operation by software.

kSSARC_TriggerRestoreRequest 

Trigger the restore operation, don't trigger the save operation.

Function Documentation

static uint32_t SSARC_GetDescriptorRegisterAddress ( SSARC_HP_Type *  base,
uint32_t  index 
)
inlinestatic
Parameters
baseSSARC_HP peripheral base address.
indexThe index of descriptor. Range from 0 to 1023.
Returns
The address of the register.
static uint32_t SSARC_GetDescriptorRegisterData ( SSARC_HP_Type *  base,
uint32_t  index 
)
inlinestatic
Parameters
baseSSARC_HP peripheral base address.
indexThe index of descriptor. Range from 0 to 1023.
Returns
The value of the register.
void SSARC_SetDescriptorConfig ( SSARC_HP_Type *  base,
uint32_t  index,
const ssarc_descriptor_config_t config 
)
Parameters
baseSSARC_HP peripheral base address.
indexThe index of descriptor. Range from 0 to 1023.
configPointer to the structure ssarc_descriptor_config_t. Please refer to ssarc_descriptor_config_t for details.
void SSARC_GroupInit ( SSARC_LP_Type *  base,
uint8_t  groupID,
const ssarc_group_config_t config 
)
Note
For the groups with the same save priority or restore priority, the save/restore operation runs in the group order.
Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
configPointer to the structure ssarc_group_config_t. Please refer to ssarc_group_config_t for details.
static void SSARC_GroupDeinit ( SSARC_LP_Type *  base,
uint8_t  groupID 
)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
static void SSARC_LockGroupDomain ( SSARC_LP_Type *  base,
uint8_t  groupID 
)
inlinestatic

This function locks the configuration of the domain. Once locked, only the access from the same domain is allowed, access from other domains will be blocked. Once locked, it can only be unlocked by a hardware reset.

Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
static void SSARC_LockGroupWrite ( SSARC_LP_Type *  base,
uint8_t  groupID 
)
inlinestatic

This function Locks the write access to the control registers and descriptors for the selected group. All writes are blocked. Once locked, it can only be unlocked by a hardware reset.

Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
static void SSARC_LockGroupRead ( SSARC_LP_Type *  base,
uint8_t  groupID 
)
inlinestatic

This function Locks the read access to the control registers and descriptors for the selected group. All reads are blocked. Once locked, it can only be unlocked by a hardware reset.

Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
void SSARC_TriggerSoftwareRequest ( SSARC_LP_Type *  base,
uint8_t  groupID,
ssarc_software_trigger_mode_t  mode 
)
Note
Each group allows software to trigger the save/restore operation without getting the request from basic power controller.
Parameters
baseSSARC_LP peripheral base address.
groupIDThe index of the group. Range from 0 to 15.
mode.Software trigger mode. Please refer to ssarc_software_trigger_mode_t for details.
static void SSARC_ResetWholeBlock ( SSARC_LP_Type *  base)
inlinestatic
Note
Only reset the SSARC registers, not include the DESC in SRAM.
Parameters
baseSSARC_LP peripheral base address.
static void SSARC_EnableHardwareRequest ( SSARC_LP_Type *  base,
bool  enable 
)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
enabletrue - Enable GPC save/restore requests. false - Disable GPC save/restore requests.
static uint32_t SSARC_GetStatusFlags ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The value of status flags. See _ssarc_interrupt_status_flags for details.
static void SSARC_ClearStatusFlags ( SSARC_LP_Type *  base,
uint32_t  mask 
)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
maskThe mask value for flags to be cleared. See _ssarc_interrupt_status_flags for details.
static uint32_t SSARC_GetErrorIndex ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The error index.
static void SSARC_SetTimeoutValue ( SSARC_LP_Type *  base,
uint32_t  value 
)
inlinestatic

This function sets timeout value for the entire group to complete. Setting timeout value to 0 will disable this feature.

Parameters
baseSSARC_LP peripheral base address.
valueThe timeout value
static uint32_t SSARC_GetTimeoutValue ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The timeout value.
static uint16_t SSARC_GetHardwareRequestRestorePendingGroup ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The value of the pending groups.
static uint16_t SSARC_GetHardwareRequestSavePendingGroup ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The value of the pending groups.
static uint16_t SSARC_GetSoftwareRequestRestorePendingGroup ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The value of the pending groups.
static uint16_t SSARC_GetSoftwareRequestSavePendingGroup ( SSARC_LP_Type *  base)
inlinestatic
Parameters
baseSSARC_LP peripheral base address.
Returns
The value of the pending groups.