![]() |
TF-M Reference Manual
1.2.0
TrustedFirmware-M
|
#include "test_ps_nv_counters.h"
#include <limits.h>
#include "nv_counters/ps_nv_counters.h"
#include "ps_utils.h"
Go to the source code of this file.
Macros | |
#define | DISABLE_INCREMENT 0 |
#define | ENABLE_INCREMENT 1 |
#define | TOTAL_PS_NV_COUNTERS 3 |
#define | INIT_NV_COUNTERS_VALUE 42 |
Functions | |
psa_status_t | ps_read_nv_counter (enum tfm_nv_counter_t counter_id, uint32_t *val) |
Reads the given non-volatile (NV) counter. More... | |
psa_status_t | ps_increment_nv_counter (enum tfm_nv_counter_t counter_id) |
Increments the given non-volatile (NV) counter. More... | |
void | test_ps_disable_increment_nv_counter (void) |
Disables PS increment nv counter function to force PSA_ERROR_GENERIC_ERROR return value as an indication that NV counter reaches its maximum value. More... | |
void | test_ps_enable_increment_nv_counter (void) |
Enables PS increment nv counter function to work normally. More... | |
psa_status_t | test_ps_read_nv_counter (enum tfm_nv_counter_t counter_id, uint32_t *val) |
Reads the given non-volatile (NV) counter. More... | |
psa_status_t | test_ps_increment_nv_counter (enum tfm_nv_counter_t counter_id) |
Increments the given non-volatile (NV) counter. More... | |
psa_status_t | test_ps_decrement_nv_counter (enum tfm_nv_counter_t counter_id) |
Decrements the given non-volatile (NV) counter. More... | |
psa_status_t | test_ps_set_nv_counter (enum tfm_nv_counter_t counter_id, uint32_t value) |
Sets a new value into the given non-volatile (NV) counter. More... | |
#define DISABLE_INCREMENT 0 |
Definition at line 14 of file test_ps_nv_counters.c.
#define ENABLE_INCREMENT 1 |
Definition at line 15 of file test_ps_nv_counters.c.
#define INIT_NV_COUNTERS_VALUE 42 |
Definition at line 18 of file test_ps_nv_counters.c.
#define TOTAL_PS_NV_COUNTERS 3 |
Definition at line 17 of file test_ps_nv_counters.c.
psa_status_t ps_increment_nv_counter | ( | enum tfm_nv_counter_t | counter_id | ) |
Increments the given non-volatile (NV) counter.
[in] | counter_id | NV counter ID. |
Definition at line 57 of file test_ps_nv_counters.c.
psa_status_t ps_read_nv_counter | ( | enum tfm_nv_counter_t | counter_id, |
uint32_t * | val | ||
) |
Reads the given non-volatile (NV) counter.
[in] | counter_id | NV counter ID. |
[out] | val | Pointer to store the current NV counter value. |
Definition at line 41 of file test_ps_nv_counters.c.
psa_status_t test_ps_decrement_nv_counter | ( | enum tfm_nv_counter_t | counter_id | ) |
Decrements the given non-volatile (NV) counter.
[in] | counter_id | NV counter ID. |
Definition at line 104 of file test_ps_nv_counters.c.
void test_ps_disable_increment_nv_counter | ( | void | ) |
Disables PS increment nv counter function to force PSA_ERROR_GENERIC_ERROR return value as an indication that NV counter reaches its maximum value.
Definition at line 83 of file test_ps_nv_counters.c.
void test_ps_enable_increment_nv_counter | ( | void | ) |
Enables PS increment nv counter function to work normally.
Definition at line 88 of file test_ps_nv_counters.c.
psa_status_t test_ps_increment_nv_counter | ( | enum tfm_nv_counter_t | counter_id | ) |
Increments the given non-volatile (NV) counter.
[in] | counter_id | NV counter ID. |
Definition at line 99 of file test_ps_nv_counters.c.
psa_status_t test_ps_read_nv_counter | ( | enum tfm_nv_counter_t | counter_id, |
uint32_t * | val | ||
) |
Reads the given non-volatile (NV) counter.
[in] | counter_id | NV counter ID. |
[out] | val | Pointer to store the current NV counter value. |
Definition at line 93 of file test_ps_nv_counters.c.
psa_status_t test_ps_set_nv_counter | ( | enum tfm_nv_counter_t | counter_id, |
uint32_t | value | ||
) |
Sets a new value into the given non-volatile (NV) counter.
[in] | counter_id | NV counter Id. |
[in] | value | New NV counter value. |
Definition at line 123 of file test_ps_nv_counters.c.