RTEMS 6.1-rc4
|
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. | |
#define FSL_SNVS_HP_DRIVER_VERSION (MAKE_VERSION(2, 3, 2)) |
Version 2.3.2
#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 struct _snvs_hp_rtc_config 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
enum _snvs_hp_interrupts |
enum _snvs_hp_ssm_state |
List of SNVS Security State Machine State.
List of SNVS security violation flags.
void SNVS_HP_Deinit | ( | SNVS_Type * | base | ) |
Deinitialize the SNVS.
base | SNVS peripheral base address |
brief Deinitialize the SNVS.
param base SNVS peripheral base address
void SNVS_HP_Init | ( | SNVS_Type * | base | ) |
Initialize the SNVS.
base | SNVS 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
void SNVS_HP_RTC_Deinit | ( | SNVS_Type * | base | ) |
Stops the RTC and SRTC timers.
base | SNVS peripheral base address |
brief Stops the RTC and SRTC timers.
param base SNVS peripheral base address
void SNVS_HP_RTC_GetAlarm | ( | SNVS_Type * | base, |
snvs_hp_rtc_datetime_t * | datetime | ||
) |
Returns the SNVS RTC alarm time.
base | SNVS peripheral base address |
datetime | Pointer 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.
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.
base | SNVS peripheral base address |
datetime | Pointer 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.
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 | Pointer 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.
uint32_t SNVS_HP_RTC_GetEnabledInterrupts | ( | SNVS_Type * | base | ) |
Gets the enabled SNVS interrupts.
base | SNVS peripheral base address |
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
uint32_t SNVS_HP_RTC_GetStatusFlags | ( | SNVS_Type * | base | ) |
Gets the SNVS status flags.
base | SNVS peripheral base address |
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
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.
base | SNVS peripheral base address |
config | Pointer 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.
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.
base | SNVS peripheral base address |
alarmTime | Pointer to the structure where the alarm time is stored. |
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
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.
base | SNVS peripheral base address |
datetime | Pointer to the structure where the date and time details are stored. |
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