RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures
Snvs_hp

Data Structures

struct  _snvs_hp_rtc_datetime
 Structure is used to hold the date and time. More...
 
struct  _snvs_hp_rtc_config
 SNVS config structure. More...
 

Driver version

enum  _snvs_hp_interrupts { kSNVS_RTC_AlarmInterrupt = SNVS_HPCR_HPTA_EN_MASK , kSNVS_RTC_PeriodicInterrupt = SNVS_HPCR_PI_EN_MASK }
 List of SNVS interrupts. More...
 
enum  _snvs_hp_status_flags { kSNVS_RTC_AlarmInterruptFlag = SNVS_HPSR_HPTA_MASK , kSNVS_RTC_PeriodicInterruptFlag = SNVS_HPSR_PI_MASK , kSNVS_ZMK_ZeroFlag = (int)SNVS_HPSR_ZMK_ZERO_MASK , kSNVS_OTPMK_ZeroFlag = SNVS_HPSR_OTPMK_ZERO_MASK }
 List of SNVS flags. More...
 
enum  _snvs_hp_sv_status_flags {
  kSNVS_LP_ViolationFlag = SNVS_HPSVSR_SW_LPSV_MASK , kSNVS_ZMK_EccFailFlag = SNVS_HPSVSR_ZMK_ECC_FAIL_MASK , kSNVS_LP_SoftwareViolationFlag = SNVS_HPSVSR_SW_LPSV_MASK , kSNVS_FatalSoftwareViolationFlag = SNVS_HPSVSR_SW_FSV_MASK ,
  kSNVS_SoftwareViolationFlag = SNVS_HPSVSR_SW_SV_MASK , kSNVS_Violation0Flag = SNVS_HPSVSR_SV0_MASK , kSNVS_Violation1Flag = SNVS_HPSVSR_SV1_MASK , kSNVS_Violation2Flag = SNVS_HPSVSR_SV2_MASK ,
  kSNVS_Violation4Flag = SNVS_HPSVSR_SV4_MASK , kSNVS_Violation5Flag = SNVS_HPSVSR_SV5_MASK
}
 List of SNVS security violation flags. More...
 
enum  _snvs_hp_ssm_state {
  kSNVS_SSMInit = 0x00 , kSNVS_SSMHardFail = 0x01 , kSNVS_SSMSoftFail = 0x03 , kSNVS_SSMInitInter = 0x08 ,
  kSNVS_SSMCheck = 0x09 , kSNVS_SSMNonSecure = 0x0B , kSNVS_SSMTrusted = 0x0D , kSNVS_SSMSecure = 0x0F
}
 List of SNVS Security State Machine State. More...
 
typedef enum _snvs_hp_interrupts snvs_hp_interrupts_t
 List of SNVS interrupts.
 
typedef enum _snvs_hp_status_flags snvs_hp_status_flags_t
 List of SNVS flags.
 
typedef enum _snvs_hp_sv_status_flags snvs_hp_sv_status_flags_t
 List of SNVS security violation flags.
 
typedef struct _snvs_hp_rtc_datetime snvs_hp_rtc_datetime_t
 Structure is used to hold the date and time.
 
typedef struct _snvs_hp_rtc_config snvs_hp_rtc_config_t
 SNVS config structure.
 
typedef enum _snvs_hp_ssm_state snvs_hp_ssm_state_t
 List of SNVS Security State Machine State.
 
#define FSL_SNVS_HP_DRIVER_VERSION   (MAKE_VERSION(2, 3, 2))
 
#define SNVS_HPSVSR_SV0_MASK   SNVS_HPSVSR_CAAM_MASK
 
#define SNVS_HPSVSR_SV1_MASK   SNVS_HPSVSR_JTAGC_MASK
 
#define SNVS_HPSVSR_SV2_MASK   SNVS_HPSVSR_WDOG2_MASK
 
#define SNVS_HPSVSR_SV4_MASK   SNVS_HPSVSR_SRC_MASK
 
#define SNVS_HPSVSR_SV5_MASK   SNVS_HPSVSR_OCOTP_MASK
 
#define SNVS_MAKE_HP_SV_FLAG(x)   (1U << (SNVS_HPSVSR_SV0_SHIFT + (x)))
 Macro to make security violation flag.
 

Initialization and deinitialization

void SNVS_HP_Init (SNVS_Type *base)
 Initialize the SNVS.
 
void SNVS_HP_Deinit (SNVS_Type *base)
 Deinitialize the SNVS.
 
void SNVS_HP_RTC_Init (SNVS_Type *base, const snvs_hp_rtc_config_t *config)
 Ungates the SNVS clock and configures the peripheral for basic operation.
 
void SNVS_HP_RTC_Deinit (SNVS_Type *base)
 Stops the RTC and SRTC timers.
 
void SNVS_HP_RTC_GetDefaultConfig (snvs_hp_rtc_config_t *config)
 Fills in the SNVS config struct with the default settings.
 

Non secure RTC current Time & Alarm

status_t SNVS_HP_RTC_SetDatetime (SNVS_Type *base, const snvs_hp_rtc_datetime_t *datetime)
 Sets the SNVS RTC date and time according to the given time structure.
 
void SNVS_HP_RTC_GetDatetime (SNVS_Type *base, snvs_hp_rtc_datetime_t *datetime)
 Gets the SNVS RTC time and stores it in the given time structure.
 
status_t SNVS_HP_RTC_SetAlarm (SNVS_Type *base, const snvs_hp_rtc_datetime_t *alarmTime)
 Sets the SNVS RTC alarm time.
 
void SNVS_HP_RTC_GetAlarm (SNVS_Type *base, snvs_hp_rtc_datetime_t *datetime)
 Returns the SNVS RTC alarm time.
 

Interrupt Interface

uint32_t SNVS_HP_RTC_GetEnabledInterrupts (SNVS_Type *base)
 Gets the enabled SNVS interrupts.
 

Status Interface

uint32_t SNVS_HP_RTC_GetStatusFlags (SNVS_Type *base)
 Gets the SNVS status flags.
 

Detailed Description

Macro Definition Documentation

◆ FSL_SNVS_HP_DRIVER_VERSION

#define FSL_SNVS_HP_DRIVER_VERSION   (MAKE_VERSION(2, 3, 2))

Version 2.3.2

◆ SNVS_MAKE_HP_SV_FLAG

#define SNVS_MAKE_HP_SV_FLAG (   x)    (1U << (SNVS_HPSVSR_SV0_SHIFT + (x)))

Macro to make security violation flag.

Macro help to make security violation flag kSNVS_Violation0Flag to kSNVS_Violation5Flag, For example, SNVS_MAKE_HP_SV_FLAG(0) is kSNVS_Violation0Flag.

Typedef Documentation

◆ snvs_hp_rtc_config_t

SNVS config structure.

This structure holds the configuration settings for the SNVS peripheral. To initialize this structure to reasonable defaults, call the SNVS_GetDefaultConfig() function and pass a pointer to your config structure instance.

The config struct can be made const so it resides in flash

Enumeration Type Documentation

◆ _snvs_hp_interrupts

List of SNVS interrupts.

Enumerator
kSNVS_RTC_AlarmInterrupt 

RTC time alarm

kSNVS_RTC_PeriodicInterrupt 

RTC periodic interrupt

◆ _snvs_hp_ssm_state

List of SNVS Security State Machine State.

Enumerator
kSNVS_SSMInit 

Init

kSNVS_SSMHardFail 

Hard Fail

kSNVS_SSMSoftFail 

Soft Fail

kSNVS_SSMInitInter 

Init Intermediate (transition state between Init and Check)

kSNVS_SSMCheck 

Check

kSNVS_SSMNonSecure 

Non-Secure

kSNVS_SSMTrusted 

Trusted

kSNVS_SSMSecure 

Secure

◆ _snvs_hp_status_flags

List of SNVS flags.

Enumerator
kSNVS_RTC_AlarmInterruptFlag 

RTC time alarm flag

kSNVS_RTC_PeriodicInterruptFlag 

RTC periodic interrupt flag

kSNVS_ZMK_ZeroFlag 

The ZMK is zero

kSNVS_OTPMK_ZeroFlag 

The OTPMK is zero

◆ _snvs_hp_sv_status_flags

List of SNVS security violation flags.

Enumerator
kSNVS_LP_ViolationFlag 

Low Power section Security Violation

kSNVS_ZMK_EccFailFlag 

Zeroizable Master Key Error Correcting Code Check Failure

kSNVS_LP_SoftwareViolationFlag 

LP Software Security Violation

kSNVS_FatalSoftwareViolationFlag 

Software Fatal Security Violation

kSNVS_SoftwareViolationFlag 

Software Security Violation

kSNVS_Violation0Flag 

Security Violation 0

kSNVS_Violation1Flag 

Security Violation 1

kSNVS_Violation2Flag 

Security Violation 2

kSNVS_Violation4Flag 

Security Violation 4

kSNVS_Violation5Flag 

Security Violation 5

Function Documentation

◆ SNVS_HP_Deinit()

void SNVS_HP_Deinit ( SNVS_Type base)

Deinitialize the SNVS.

Parameters
baseSNVS peripheral base address

brief Deinitialize the SNVS.

param base SNVS peripheral base address

◆ SNVS_HP_Init()

void SNVS_HP_Init ( SNVS_Type base)

Initialize the SNVS.

Note
This API should be called at the beginning of the application using the SNVS driver.
Parameters
baseSNVS peripheral base address

brief Initialize the SNVS.

note This API should be called at the beginning of the application using the SNVS driver.

param base SNVS peripheral base address

◆ SNVS_HP_RTC_Deinit()

void SNVS_HP_RTC_Deinit ( SNVS_Type base)

Stops the RTC and SRTC timers.

Parameters
baseSNVS peripheral base address

brief Stops the RTC and SRTC timers.

param base SNVS peripheral base address

◆ SNVS_HP_RTC_GetAlarm()

void SNVS_HP_RTC_GetAlarm ( SNVS_Type base,
snvs_hp_rtc_datetime_t datetime 
)

Returns the SNVS RTC alarm time.

Parameters
baseSNVS peripheral base address
datetimePointer to the structure where the alarm date and time details are stored.

brief Returns the SNVS RTC alarm time.

param base SNVS peripheral base address param datetime Pointer to the structure where the alarm date and time details are stored.

◆ SNVS_HP_RTC_GetDatetime()

void SNVS_HP_RTC_GetDatetime ( SNVS_Type base,
snvs_hp_rtc_datetime_t datetime 
)

Gets the SNVS RTC time and stores it in the given time structure.

Parameters
baseSNVS peripheral base address
datetimePointer to the structure where the date and time details are stored.

brief Gets the SNVS RTC time and stores it in the given time structure.

param base SNVS peripheral base address param datetime Pointer to the structure where the date and time details are stored.

◆ SNVS_HP_RTC_GetDefaultConfig()

void SNVS_HP_RTC_GetDefaultConfig ( snvs_hp_rtc_config_t config)

Fills in the SNVS config struct with the default settings.

The default values are as follows.

config->rtccalenable = false;
config->rtccalvalue = 0U;
config->PIFreq = 0U;
Definition: deflate.c:114
Parameters
configPointer to the user's SNVS configuration structure.

brief Fills in the SNVS config struct with the default settings.

The default values are as follows. code config->rtccalenable = false; config->rtccalvalue = 0U; config->PIFreq = 0U; endcode param config Pointer to the user's SNVS configuration structure.

◆ SNVS_HP_RTC_GetEnabledInterrupts()

uint32_t SNVS_HP_RTC_GetEnabledInterrupts ( SNVS_Type base)

Gets the enabled SNVS interrupts.

Parameters
baseSNVS peripheral base address
Returns
The enabled interrupts. This is the logical OR of members of the enumeration :: _snvs_hp_interrupts_t

brief Gets the enabled SNVS interrupts.

param base SNVS peripheral base address

return The enabled interrupts. This is the logical OR of members of the enumeration ::snvs_interrupt_enable_t

◆ SNVS_HP_RTC_GetStatusFlags()

uint32_t SNVS_HP_RTC_GetStatusFlags ( SNVS_Type base)

Gets the SNVS status flags.

Parameters
baseSNVS peripheral base address
Returns
The status flags. This is the logical OR of members of the enumeration :: _snvs_hp_status_flags_t

brief Gets the SNVS status flags.

param base SNVS peripheral base address

return The status flags. This is the logical OR of members of the enumeration ::snvs_status_flags_t

◆ SNVS_HP_RTC_Init()

void SNVS_HP_RTC_Init ( SNVS_Type base,
const snvs_hp_rtc_config_t config 
)

Ungates the SNVS clock and configures the peripheral for basic operation.

Note
This API should be called at the beginning of the application using the SNVS driver.
Parameters
baseSNVS peripheral base address
configPointer to the user's SNVS configuration structure.

brief Ungates the SNVS clock and configures the peripheral for basic operation.

note This API should be called at the beginning of the application using the SNVS driver.

param base SNVS peripheral base address param config Pointer to the user's SNVS configuration structure.

◆ SNVS_HP_RTC_SetAlarm()

status_t SNVS_HP_RTC_SetAlarm ( SNVS_Type base,
const snvs_hp_rtc_datetime_t alarmTime 
)

Sets the SNVS RTC alarm time.

The function sets the RTC alarm. It also checks whether the specified alarm time is greater than the present time. If not, the function does not set the alarm and returns an error.

Parameters
baseSNVS peripheral base address
alarmTimePointer to the structure where the alarm time is stored.
Returns
kStatus_Success: success in setting the SNVS RTC alarm kStatus_InvalidArgument: Error because the alarm datetime format is incorrect kStatus_Fail: Error because the alarm time has already passed

brief Sets the SNVS RTC alarm time.

The function sets the RTC alarm. It also checks whether the specified alarm time is greater than the present time. If not, the function does not set the alarm and returns an error.

param base SNVS peripheral base address param alarmTime Pointer to the structure where the alarm time is stored.

return kStatus_Success: success in setting the SNVS RTC alarm kStatus_InvalidArgument: Error because the alarm datetime format is incorrect kStatus_Fail: Error because the alarm time has already passed

◆ SNVS_HP_RTC_SetDatetime()

status_t SNVS_HP_RTC_SetDatetime ( SNVS_Type base,
const snvs_hp_rtc_datetime_t datetime 
)

Sets the SNVS RTC date and time according to the given time structure.

Parameters
baseSNVS peripheral base address
datetimePointer to the structure where the date and time details are stored.
Returns
kStatus_Success: Success in setting the time and starting the SNVS RTC kStatus_InvalidArgument: Error because the datetime format is incorrect

brief Sets the SNVS RTC date and time according to the given time structure.

param base SNVS peripheral base address param datetime Pointer to the structure where the date and time details are stored.

return kStatus_Success: Success in setting the time and starting the SNVS RTC kStatus_InvalidArgument: Error because the datetime format is incorrect