1 /* -------------------------------------------------------------------------- */
2 /*                           Copyright 2022-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  * @addtogroup FWK_Platform_module
12  * The FWK_Platform module
13  *
14  * FWK_Platform module provides APIs to set platform parameters.
15  * @{
16  */
17 /*!
18  * @addtogroup FWK_Platform
19  * The FWK_Platform main module
20  *
21  * FWK_Platform main module provides APIs to set main platform parameters.
22  * @{
23  */
24 
25 /* -------------------------------------------------------------------------- */
26 /*                                  Includes                                  */
27 /* -------------------------------------------------------------------------- */
28 #include "fsl_clock.h"
29 #include "fsl_component_timer_manager.h"
30 
31 /* -------------------------------------------------------------------------- */
32 /*                                 Definitions                                */
33 /* -------------------------------------------------------------------------- */
34 
35 /*! @brief The configuration of timer. */
36 
37 #ifndef PLATFORM_TM_INSTANCE
38 #define PLATFORM_TM_INSTANCE 0
39 #endif
40 
41 /* -------------------------------------------------------------------------- */
42 /*                         Public memory declarations                         */
43 /* -------------------------------------------------------------------------- */
44 
45 #if defined(__cplusplus)
46 extern "C" {
47 #endif /* __cplusplus */
48 
49 /* -------------------------------------------------------------------------- */
50 /*                        Public functions declaration                        */
51 /* -------------------------------------------------------------------------- */
52 
53 /*!
54  * \brief  Initialize Timer Manager
55  *
56  *    This API will initialize the Timer Manager and the required clocks
57  *
58  */
59 timer_status_t PLATFORM_InitTimerManager(void);
60 
61 /*!
62  * \brief  Deinitialize Timer Manager
63  *
64  *    This API will deinitialize the Timer Manager
65  *
66  */
67 void PLATFORM_DeinitTimerManager(void);
68 
69 /*!
70  * \brief Initializes timestamp module
71  *
72  */
73 void PLATFORM_InitTimeStamp(void);
74 
75 /*!
76  * \brief Returns current timestamp in us
77  *
78  * \return uint64_t timestamp in us
79  */
80 uint64_t PLATFORM_GetTimeStamp(void);
81 
82 /*!
83  * \brief Returns the max timestamp value that can be returned by PLATFORM_GetTimeStamp
84  *        Can be used by the user to handle timestamp wrapping
85  *
86  * \return uint64_t the max timestamp value
87  */
88 uint64_t PLATFORM_GetMaxTimeStamp(void);
89 
90 #if defined(__cplusplus)
91 }
92 #endif /* __cplusplus */
93 
94 /*!
95  * @}  end of FWK_Platform addtogroup
96  */
97 /*!
98  * @}  end of FWK_Platform_module addtogroup
99  */
100 #endif /* _FWK_PLATFORM_H_ */