RTEMS 6.1-rc5
|
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. | |
#define FSL_SNVS_LP_DRIVER_VERSION (MAKE_VERSION(2, 4, 4)) |
Version 2.4.4
typedef struct _snvs_lp_srtc_config 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
void SNVS_LP_Deinit | ( | SNVS_Type * | base | ) |
Deinit the SNVS LP section.
base | SNVS peripheral base address |
brief Deinit the SNVS LP section.
param base SNVS peripheral base address
uint64_t SNVS_LP_GetMonotonicCounter | ( | SNVS_Type * | base | ) |
Get the current Monotonic Counter.
base | SNVS peripheral base address |
brief Get the current Monotonic Counter.
param base SNVS peripheral base address return Current Monotonic Counter value.
void SNVS_LP_Init | ( | SNVS_Type * | base | ) |
Ungates the SNVS clock and configures the peripheral for basic operation.
base | SNVS 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.
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
config | Pointer 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.
void SNVS_LP_SRTC_Deinit | ( | SNVS_Type * | base | ) |
Stops the SRTC timer.
base | SNVS peripheral base address |
brief Stops the SRTC timer.
param base SNVS peripheral base address
void SNVS_LP_SRTC_GetAlarm | ( | SNVS_Type * | base, |
snvs_lp_srtc_datetime_t * | datetime | ||
) |
Returns the SNVS SRTC 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 SRTC 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_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.
base | SNVS peripheral base address |
datetime | Pointer 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.
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 | Pointer 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.
uint32_t SNVS_LP_SRTC_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_LP_SRTC_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_LP_SRTC_Init | ( | SNVS_Type * | base, |
const snvs_lp_srtc_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_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.
base | SNVS peripheral base address |
alarmTime | Pointer to the structure where the alarm time is stored. |
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
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.
base | SNVS peripheral base address |
datetime | Pointer to the structure where the date and time details are stored. |
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
void SNVS_LP_WriteZeroizableMasterKey | ( | SNVS_Type * | base, |
uint32_t | ZMKey[SNVS_ZMK_REG_COUNT] | ||
) |
Write Zeroizable Master Key (ZMK) to the SNVS registers.
base | SNVS peripheral base address |
ZMKey | The 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.