1 /*
2  * Copyright (c) 2020, Cypress Semiconductor Corporation. All rights reserved.
3  *
4  * SPDX-License-Identifier: BSD-3-Clause
5  *
6  */
7 
8 #ifndef __NV_COUNTERS_H__
9 #define __NV_COUNTERS_H__
10 
11 #include <stdint.h>
12 #include "cmsis_compiler.h"
13 /**
14  * \brief magic for NV_COUNTERS INIT.
15  */
16 #define NV_COUNTERS_INITIALIZED 0xC0DE0042
17 
18 #define DEVICE_NUM_NV_COUNTERS 6
19 
20 /**
21  * \brief Struct representing the NV counter data in flash.
22  */
23 struct nv_counters_t {
24     uint32_t checksum;
25     uint32_t init_value; /**< Watermark to indicate if the NV counters have been
26                           *   initialised
27                           */
28     uint32_t counters[DEVICE_NUM_NV_COUNTERS]; /**< Array of NV counters */
29 };
30 
31 #endif /* __NV_COUNTERS_H__ */
32