1 /***************************************************************************//**
2 * \file cyip_profile.h
3 *
4 * \brief
5 * PROFILE IP definitions
6 *
7 ********************************************************************************
8 * \copyright
9 * (c) (2016-2023), Cypress Semiconductor Corporation (an Infineon company) or
10 * an affiliate of Cypress Semiconductor Corporation.
11 *
12 * SPDX-License-Identifier: Apache-2.0
13 *
14 * Licensed under the Apache License, Version 2.0 (the "License");
15 * you may not use this file except in compliance with the License.
16 * You may obtain a copy of the License at
17 *
18 *     http://www.apache.org/licenses/LICENSE-2.0
19 *
20 * Unless required by applicable law or agreed to in writing, software
21 * distributed under the License is distributed on an "AS IS" BASIS,
22 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
23 * See the License for the specific language governing permissions and
24 * limitations under the License.
25 *******************************************************************************/
26 
27 #ifndef _CYIP_PROFILE_H_
28 #define _CYIP_PROFILE_H_
29 
30 #include "cyip_headers.h"
31 
32 /*******************************************************************************
33 *                                   PROFILE
34 *******************************************************************************/
35 
36 #define PROFILE_CNT_STRUCT_SECTION_SIZE         0x00000010UL
37 #define PROFILE_SECTION_SIZE                    0x00010000UL
38 
39 /**
40   * \brief Profile counter structure (PROFILE_CNT_STRUCT)
41   */
42 typedef struct {
43   __IOM uint32_t CTL;                           /*!< 0x00000000 Profile counter configuration */
44    __IM uint32_t RESERVED;
45   __IOM uint32_t CNT;                           /*!< 0x00000008 Profile counter value */
46    __IM uint32_t RESERVED1;
47 } PROFILE_CNT_STRUCT_V1_Type;                   /*!< Size = 16 (0x10) */
48 
49 /**
50   * \brief Energy Profiler IP (PROFILE)
51   */
52 typedef struct {
53   __IOM uint32_t CTL;                           /*!< 0x00000000 Profile control */
54    __IM uint32_t STATUS;                        /*!< 0x00000004 Profile status */
55    __IM uint32_t RESERVED[2];
56   __IOM uint32_t CMD;                           /*!< 0x00000010 Profile command */
57    __IM uint32_t RESERVED1[491];
58   __IOM uint32_t INTR;                          /*!< 0x000007C0 Profile interrupt */
59   __IOM uint32_t INTR_SET;                      /*!< 0x000007C4 Profile interrupt set */
60   __IOM uint32_t INTR_MASK;                     /*!< 0x000007C8 Profile interrupt mask */
61    __IM uint32_t INTR_MASKED;                   /*!< 0x000007CC Profile interrupt masked */
62    __IM uint32_t RESERVED2[12];
63         PROFILE_CNT_STRUCT_V1_Type CNT_STRUCT[16]; /*!< 0x00000800 Profile counter structure */
64 } PROFILE_V1_Type;                              /*!< Size = 2304 (0x900) */
65 
66 
67 /* PROFILE_CNT_STRUCT.CTL */
68 #define PROFILE_CNT_STRUCT_CTL_CNT_DURATION_Pos 0UL
69 #define PROFILE_CNT_STRUCT_CTL_CNT_DURATION_Msk 0x1UL
70 #define PROFILE_CNT_STRUCT_CTL_REF_CLK_SEL_Pos  4UL
71 #define PROFILE_CNT_STRUCT_CTL_REF_CLK_SEL_Msk  0x70UL
72 #define PROFILE_CNT_STRUCT_CTL_MON_SEL_Pos      16UL
73 #define PROFILE_CNT_STRUCT_CTL_MON_SEL_Msk      0x7F0000UL
74 #define PROFILE_CNT_STRUCT_CTL_ENABLED_Pos      31UL
75 #define PROFILE_CNT_STRUCT_CTL_ENABLED_Msk      0x80000000UL
76 /* PROFILE_CNT_STRUCT.CNT */
77 #define PROFILE_CNT_STRUCT_CNT_CNT_Pos          0UL
78 #define PROFILE_CNT_STRUCT_CNT_CNT_Msk          0xFFFFFFFFUL
79 
80 
81 /* PROFILE.CTL */
82 #define PROFILE_CTL_WIN_MODE_Pos                0UL
83 #define PROFILE_CTL_WIN_MODE_Msk                0x1UL
84 #define PROFILE_CTL_ENABLED_Pos                 31UL
85 #define PROFILE_CTL_ENABLED_Msk                 0x80000000UL
86 /* PROFILE.STATUS */
87 #define PROFILE_STATUS_WIN_ACTIVE_Pos           0UL
88 #define PROFILE_STATUS_WIN_ACTIVE_Msk           0x1UL
89 /* PROFILE.CMD */
90 #define PROFILE_CMD_START_TR_Pos                0UL
91 #define PROFILE_CMD_START_TR_Msk                0x1UL
92 #define PROFILE_CMD_STOP_TR_Pos                 1UL
93 #define PROFILE_CMD_STOP_TR_Msk                 0x2UL
94 #define PROFILE_CMD_CLR_ALL_CNT_Pos             8UL
95 #define PROFILE_CMD_CLR_ALL_CNT_Msk             0x100UL
96 /* PROFILE.INTR */
97 #define PROFILE_INTR_CNT_OVFLW_Pos              0UL
98 #define PROFILE_INTR_CNT_OVFLW_Msk              0xFFFFFFFFUL
99 /* PROFILE.INTR_SET */
100 #define PROFILE_INTR_SET_CNT_OVFLW_Pos          0UL
101 #define PROFILE_INTR_SET_CNT_OVFLW_Msk          0xFFFFFFFFUL
102 /* PROFILE.INTR_MASK */
103 #define PROFILE_INTR_MASK_CNT_OVFLW_Pos         0UL
104 #define PROFILE_INTR_MASK_CNT_OVFLW_Msk         0xFFFFFFFFUL
105 /* PROFILE.INTR_MASKED */
106 #define PROFILE_INTR_MASKED_CNT_OVFLW_Pos       0UL
107 #define PROFILE_INTR_MASKED_CNT_OVFLW_Msk       0xFFFFFFFFUL
108 
109 
110 #endif /* _CYIP_PROFILE_H_ */
111 
112 
113 /* [] END OF FILE */
114