1 /* -------------------------------------------------------------------------- */
2 /*                           Copyright 2023 NXP                               */
3 /*                            All rights reserved.                            */
4 /*                    SPDX-License-Identifier: BSD-3-Clause                   */
5 /* -------------------------------------------------------------------------- */
6 
7 #ifndef _FWK_PLATFORM_H_
8 #define _FWK_PLATFORM_H_
9 
10 /* -------------------------------------------------------------------------- */
11 /*                                  Includes                                  */
12 /* -------------------------------------------------------------------------- */
13 
14 #include <stdint.h>
15 
16 /* -------------------------------------------------------------------------- */
17 /*                                Public macros                               */
18 /* -------------------------------------------------------------------------- */
19 
20 #define PLATFORM_OSTIMER_CLK kOSC32K_to_OSTIMER_CLK
21 
22 /* -------------------------------------------------------------------------- */
23 /*                              Public prototypes                             */
24 /* -------------------------------------------------------------------------- */
25 
26 /*!
27  * \brief Initializes timestamp module
28  *
29  */
30 void PLATFORM_InitTimeStamp(void);
31 
32 /*!
33  * \brief Returns current timestamp in us
34  *
35  * \return uint64_t timestamp in us
36  */
37 uint64_t PLATFORM_GetTimeStamp(void);
38 
39 /*!
40  * \brief Returns the max timestamp value that can be returned by PLATFORM_GetTimeStamp
41  *        Can be used by the user to handle timestamp wrapping
42  *
43  * \return uint64_t the max timestamp value
44  */
45 uint64_t PLATFORM_GetMaxTimeStamp(void);
46 
47 /*!
48  * \brief Save timestamp module before entering power down
49  *
50  */
51 void PLATFORM_TimeStampEnterLowPower(void);
52 
53 /*!
54  * \brief Restore timestamp module after exit from power down
55  *
56  */
57 void PLATFORM_TimeStampExitPowerDown(void);
58 
59 #endif /* _FWK_PLATFORM_H_ */
60