TF-M Reference Manual  1.2.0
TrustedFirmware-M
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
test_ps_nv_counters.h File Reference
#include <stdint.h>
#include "psa/protected_storage.h"
#include "tfm_plat_nv_counters.h"
Include dependency graph for test_ps_nv_counters.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

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...
 
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_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...
 

Function Documentation

psa_status_t test_ps_decrement_nv_counter ( enum tfm_nv_counter_t  counter_id)

Decrements the given non-volatile (NV) counter.

Parameters
[in]counter_idNV counter ID.
Returns
When the NV counter reaches its minimum value, the PSA_ERROR_GENERIC_ERROR error is returned to indicate the value cannot be decremented. Otherwise, PSA_SUCCESS.

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.

Parameters
[in]counter_idNV counter ID.
Returns
When the NV counter reaches its maximum value, the PSA_ERROR_GENERIC_ERROR error is returned to indicate the value cannot be incremented. Otherwise, PSA_SUCCESS.

Definition at line 99 of file test_ps_nv_counters.c.

Here is the call graph for this function:

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.

Parameters
[in]counter_idNV counter ID.
[out]valPointer to store the current NV counter value.
Returns
PSA_SUCCESS if the value is read correctly, otherwise PSA_ERROR_GENERIC_ERROR

Definition at line 93 of file test_ps_nv_counters.c.

Here is the call graph for this function:

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.

Parameters
[in]counter_idNV counter Id.
[in]valueNew NV counter value.
Returns
When the NV counter reaches its maximum value, the PSA_ERROR_GENERIC_ERROR error is returned to indicate the value cannot be set. Otherwise, PSA_SUCCESS.

Definition at line 123 of file test_ps_nv_counters.c.