RTEMS 6.1-rc6
Loading...
Searching...
No Matches
Data Structures | Functions
Snvs_lp

Data Structures

struct  snvs_lp_passive_tamper_t
 Structure is used to configure SNVS LP passive tamper pins. More...
 
struct  _snvs_lp_srtc_datetime
 Structure is used to hold the date and time. More...
 
struct  _snvs_lp_srtc_config
 SNVS_LP config structure. More...
 

Functions

void SNVS_LP_SRTC_Init (SNVS_Type *base, const snvs_lp_srtc_config_t *config)
 Ungates the SNVS clock and configures the peripheral for basic operation.
 
void SNVS_LP_SRTC_Deinit (SNVS_Type *base)
 Stops the SRTC timer.
 
void SNVS_LP_SRTC_GetDefaultConfig (snvs_lp_srtc_config_t *config)
 Fills in the SNVS_LP config struct with the default settings.
 

Driver version

enum  _snvs_lp_srtc_interrupts { kSNVS_SRTC_AlarmInterrupt = SNVS_LPCR_LPTA_EN_MASK }
 List of SNVS_LP interrupts. More...
 
enum  _snvs_lp_srtc_status_flags { kSNVS_SRTC_AlarmInterruptFlag = SNVS_LPSR_LPTA_MASK }
 List of SNVS_LP flags. More...
 
enum  _snvs_lp_external_tamper_status { kSNVS_TamperNotDetected = 0U , kSNVS_TamperDetected = 1U }
 List of SNVS_LP external tampers status.
 
enum  _snvs_lp_external_tamper_polarity { kSNVS_ExternalTamperActiveLow = 0U , kSNVS_ExternalTamperActiveHigh = 1U }
 SNVS_LP external tamper polarity.
 
enum  _snvs_lp_zmk_program_mode { kSNVS_ZMKSoftwareProgram , kSNVS_ZMKHardwareProgram }
 SNVS_LP Zeroizable Master Key programming mode. More...
 
enum  _snvs_lp_master_key_mode { kSNVS_OTPMK = 0 , kSNVS_ZMK = 2 , kSNVS_CMK = 3 }
 SNVS_LP Master Key mode. More...
 
typedef enum _snvs_lp_srtc_interrupts snvs_lp_srtc_interrupts_t
 List of SNVS_LP interrupts.
 
typedef enum _snvs_lp_srtc_status_flags snvs_lp_srtc_status_flags_t
 List of SNVS_LP flags.
 
typedef enum _snvs_lp_external_tamper_status snvs_lp_external_tamper_status_t
 List of SNVS_LP external tampers status.
 
typedef enum _snvs_lp_external_tamper_polarity snvs_lp_external_tamper_polarity_t
 SNVS_LP external tamper polarity.
 
typedef struct _snvs_lp_srtc_datetime snvs_lp_srtc_datetime_t
 Structure is used to hold the date and time.
 
typedef struct _snvs_lp_srtc_config snvs_lp_srtc_config_t
 SNVS_LP config structure.
 
typedef enum _snvs_lp_zmk_program_mode snvs_lp_zmk_program_mode_t
 SNVS_LP Zeroizable Master Key programming mode.
 
typedef enum _snvs_lp_master_key_mode snvs_lp_master_key_mode_t
 SNVS_LP Master Key mode.
 
#define FSL_SNVS_LP_DRIVER_VERSION   (MAKE_VERSION(2, 4, 4))
 
#define SNVS_ZMK_REG_COUNT   8U /* 8 Zeroizable Master Key registers. */
 Define of SNVS_LP Zeroizable Master Key registers.
 
#define SNVS_LP_MAX_TAMPER   kSNVS_ExternalTamper1
 Define of SNVS_LP Max possible tamper.
 

Initialization and deinitialization

void SNVS_LP_Init (SNVS_Type *base)
 Ungates the SNVS clock and configures the peripheral for basic operation.
 
void SNVS_LP_Deinit (SNVS_Type *base)
 Deinit the SNVS LP section.
 

Secure RTC (SRTC) current Time & Alarm

status_t SNVS_LP_SRTC_SetDatetime (SNVS_Type *base, const snvs_lp_srtc_datetime_t *datetime)
 Sets the SNVS SRTC date and time according to the given time structure.
 
void SNVS_LP_SRTC_GetDatetime (SNVS_Type *base, snvs_lp_srtc_datetime_t *datetime)
 Gets the SNVS SRTC time and stores it in the given time structure.
 
status_t SNVS_LP_SRTC_SetAlarm (SNVS_Type *base, const snvs_lp_srtc_datetime_t *alarmTime)
 Sets the SNVS SRTC alarm time.
 
void SNVS_LP_SRTC_GetAlarm (SNVS_Type *base, snvs_lp_srtc_datetime_t *datetime)
 Returns the SNVS SRTC alarm time.
 

Interrupt Interface

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

Status Interface

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

External tampering

void SNVS_LP_PassiveTamperPin_GetDefaultConfig (snvs_lp_passive_tamper_t *config)
 Fills in the SNVS tamper pin config struct with the default settings.
 

Monotonic Counter (MC)

uint64_t SNVS_LP_GetMonotonicCounter (SNVS_Type *base)
 Get the current Monotonic Counter.
 

Zeroizable Master Key (ZMK)

void SNVS_LP_WriteZeroizableMasterKey (SNVS_Type *base, uint32_t ZMKey[SNVS_ZMK_REG_COUNT])
 Write Zeroizable Master Key (ZMK) to the SNVS registers.
 

Detailed Description

Macro Definition Documentation

◆ FSL_SNVS_LP_DRIVER_VERSION

#define FSL_SNVS_LP_DRIVER_VERSION   (MAKE_VERSION(2, 4, 4))

Version 2.4.4

Typedef Documentation

◆ snvs_lp_srtc_config_t

SNVS_LP config structure.

This structure holds the configuration settings for the SNVS_LP peripheral. To initialize this structure to reasonable defaults, call the SNVS_LP_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_lp_master_key_mode

SNVS_LP Master Key mode.

Enumerator
kSNVS_OTPMK 

One Time Programmable Master Key.

kSNVS_ZMK 

Zeroizable Master Key.

kSNVS_CMK 

Combined Master Key, it is XOR of OPTMK and ZMK.

◆ _snvs_lp_srtc_interrupts

List of SNVS_LP interrupts.

Enumerator
kSNVS_SRTC_AlarmInterrupt 

SRTC time alarm.

◆ _snvs_lp_srtc_status_flags

List of SNVS_LP flags.

Enumerator
kSNVS_SRTC_AlarmInterruptFlag 

SRTC time alarm flag

◆ _snvs_lp_zmk_program_mode

SNVS_LP Zeroizable Master Key programming mode.

Enumerator
kSNVS_ZMKSoftwareProgram 

Software programming mode.

kSNVS_ZMKHardwareProgram 

Hardware programming mode.

Function Documentation

◆ SNVS_LP_Deinit()

void SNVS_LP_Deinit ( SNVS_Type base)

Deinit the SNVS LP section.

Parameters
baseSNVS peripheral base address

brief Deinit the SNVS LP section.

param base SNVS peripheral base address

◆ SNVS_LP_GetMonotonicCounter()

uint64_t SNVS_LP_GetMonotonicCounter ( SNVS_Type base)

Get the current Monotonic Counter.

Parameters
baseSNVS peripheral base address
Returns
Current Monotonic Counter value.

brief Get the current Monotonic Counter.

param base SNVS peripheral base address return Current Monotonic Counter value.

◆ SNVS_LP_Init()

void SNVS_LP_Init ( SNVS_Type base)

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

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_LP_PassiveTamperPin_GetDefaultConfig()

void SNVS_LP_PassiveTamperPin_GetDefaultConfig ( snvs_lp_passive_tamper_t config)

Fills in the SNVS tamper pin config struct with the default settings.

The default values are as follows. code config->polarity = 0U; config->filterenable = 0U; if available on SoC config->filter = 0U; if available on SoC endcode

Parameters
configPointer to the user's SNVS configuration structure.

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

The default values are as follows. code config->polarity = 0U; config->filterenable = 0U; config->filter = 0U; endcode param config Pointer to the user's SNVS configuration structure.

◆ SNVS_LP_SRTC_Deinit()

void SNVS_LP_SRTC_Deinit ( SNVS_Type base)

Stops the SRTC timer.

Parameters
baseSNVS peripheral base address

brief Stops the SRTC timer.

param base SNVS peripheral base address

◆ SNVS_LP_SRTC_GetAlarm()

void SNVS_LP_SRTC_GetAlarm ( SNVS_Type base,
snvs_lp_srtc_datetime_t datetime 
)

Returns the SNVS SRTC alarm time.

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

brief Returns the SNVS SRTC alarm time.

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

◆ SNVS_LP_SRTC_GetDatetime()

void SNVS_LP_SRTC_GetDatetime ( SNVS_Type base,
snvs_lp_srtc_datetime_t datetime 
)

Gets the SNVS SRTC 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 SRTC 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_LP_SRTC_GetDefaultConfig()

void SNVS_LP_SRTC_GetDefaultConfig ( snvs_lp_srtc_config_t config)

Fills in the SNVS_LP config struct with the default settings.

The default values are as follows.

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

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

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

◆ SNVS_LP_SRTC_GetEnabledInterrupts()

uint32_t SNVS_LP_SRTC_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_lp_srtc_interrupts

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_LP_SRTC_GetStatusFlags()

uint32_t SNVS_LP_SRTC_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_lp_srtc_status_flags

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_LP_SRTC_Init()

void SNVS_LP_SRTC_Init ( SNVS_Type base,
const snvs_lp_srtc_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_LP_SRTC_SetAlarm()

status_t SNVS_LP_SRTC_SetAlarm ( SNVS_Type base,
const snvs_lp_srtc_datetime_t alarmTime 
)

Sets the SNVS SRTC alarm time.

The function sets the SRTC 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. Please note, that SRTC alarm has limited resolution because only 32 most significant bits of SRTC counter are compared to SRTC Alarm register. If the alarm time is beyond SRTC resolution, 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 SRTC alarm kStatus_InvalidArgument: Error because the alarm datetime format is incorrect kStatus_Fail: Error because the alarm time has already passed or is beyond resolution

brief Sets the SNVS SRTC alarm time.

The function sets the SRTC 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. Please note, that SRTC alarm has limited resolution because only 32 most significant bits of SRTC counter are compared to SRTC Alarm register. If the alarm time is beyond SRTC resolution, 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 SRTC alarm kStatus_InvalidArgument: Error because the alarm datetime format is incorrect kStatus_Fail: Error because the alarm time has already passed or is beyond resolution

◆ SNVS_LP_SRTC_SetDatetime()

status_t SNVS_LP_SRTC_SetDatetime ( SNVS_Type base,
const snvs_lp_srtc_datetime_t datetime 
)

Sets the SNVS SRTC 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 SRTC kStatus_InvalidArgument: Error because the datetime format is incorrect

brief Sets the SNVS SRTC 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 SRTC kStatus_InvalidArgument: Error because the datetime format is incorrect

◆ SNVS_LP_WriteZeroizableMasterKey()

void SNVS_LP_WriteZeroizableMasterKey ( SNVS_Type base,
uint32_t  ZMKey[SNVS_ZMK_REG_COUNT] 
)

Write Zeroizable Master Key (ZMK) to the SNVS registers.

Parameters
baseSNVS peripheral base address
ZMKeyThe ZMK write to the SNVS register.

brief Write Zeroizable Master Key (ZMK) to the SNVS registers.

param base SNVS peripheral base address param ZMKey The ZMK write to the SNVS register.