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.
|
enum | _ssarc_interrupt_status_flags {
kSSARC_AddressErrorFlag = SSARC_LP_INT_STATUS_ADDR_ERR_MASK,
kSSARC_AHBErrorFlag = SSARC_LP_INT_STATUS_AHB_ERR_MASK,
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 = SSARC_HP_SRAM2_SV_EN_MASK,
kSSARC_SaveDisableRestoreEnable = SSARC_HP_SRAM2_RT_EN_MASK,
kSSARC_SaveEnableRestoreEnable = (SSARC_HP_SRAM2_RT_EN_MASK | SSARC_HP_SRAM2_SV_EN_MASK)
} |
| 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 = SSARC_LP_DESC_CTRL1_SW_TRIG_RT_MASK
} |
| Software trigger mode. More...
|
|
struct ssarc_descriptor_config_t |
uint32_t ssarc_descriptor_config_t::address |
uint32_t ssarc_descriptor_config_t::data |
struct ssarc_group_config_t |
ssarc_cpu_domain_name_t ssarc_group_config_t::cpuDomain |
uint32_t ssarc_group_config_t::startIndex |
uint32_t ssarc_group_config_t::endIndex |
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 |
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.
|
static uint32_t SSARC_GetDescriptorRegisterAddress |
( |
SSARC_HP_Type * |
base, |
|
|
uint32_t |
index |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SSARC_HP peripheral base address. |
index | The 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
-
base | SSARC_HP peripheral base address. |
index | The index of descriptor. Range from 0 to 1023. |
- Returns
- The value of the register.
- Note
- For the groups with the same save priority or restore priority, the save/restore operation runs in the group order.
- Parameters
-
static void SSARC_GroupDeinit |
( |
SSARC_LP_Type * |
base, |
|
|
uint8_t |
groupID |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
groupID | The 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
-
base | SSARC_LP peripheral base address. |
groupID | The 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
-
base | SSARC_LP peripheral base address. |
groupID | The 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
-
base | SSARC_LP peripheral base address. |
groupID | The index of the group. Range from 0 to 15. |
- Note
- Each group allows software to trigger the save/restore operation without getting the request from basic power controller.
- Parameters
-
base | SSARC_LP peripheral base address. |
groupID | The 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
-
base | SSARC_LP peripheral base address. |
static void SSARC_EnableHardwareRequest |
( |
SSARC_LP_Type * |
base, |
|
|
bool |
enable |
|
) |
| |
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
enable | Used to enable/disable save/restore hardware request.
- true Enable GPC save/restore requests.
- false Disable GPC save/restore requests.
|
static uint32_t SSARC_GetStatusFlags |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
static void SSARC_ClearStatusFlags |
( |
SSARC_LP_Type * |
base, |
|
|
uint32_t |
mask |
|
) |
| |
|
inlinestatic |
static uint32_t SSARC_GetErrorIndex |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_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
-
base | SSARC_LP peripheral base address. |
value | The timeout value, 0 means disable time out feature. |
static uint32_t SSARC_GetTimeoutValue |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
- Returns
- The timeout value.
static uint16_t SSARC_GetHardwareRequestRestorePendingGroup |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
- Returns
- The value of the pending groups.
static uint16_t SSARC_GetHardwareRequestSavePendingGroup |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
- Returns
- The value of the pending groups.
static uint16_t SSARC_GetSoftwareRequestRestorePendingGroup |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
- Returns
- The value of the pending groups.
static uint16_t SSARC_GetSoftwareRequestSavePendingGroup |
( |
SSARC_LP_Type * |
base | ) |
|
|
inlinestatic |
- Parameters
-
base | SSARC_LP peripheral base address. |
- Returns
- The value of the pending groups.