iLLD_TC27xC
1.0
IfxGtm_Cmu.h
Go to the documentation of this file.
1
/**
2
* \file IfxGtm_Cmu.h
3
* \brief GTM basic functionality
4
* \ingroup IfxLld_Gtm
5
*
6
* \version iLLD_0_1_0_10
7
* \copyright Copyright (c) 2013 Infineon Technologies AG. All rights reserved.
8
*
9
*
10
* IMPORTANT NOTICE
11
*
12
*
13
* Infineon Technologies AG (Infineon) is supplying this file for use
14
* exclusively with Infineon's microcontroller products. This file can be freely
15
* distributed within development tools that are supporting such microcontroller
16
* products.
17
*
18
* THIS SOFTWARE IS PROVIDED "AS IS". NO WARRANTIES, WHETHER EXPRESS, IMPLIED
19
* OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
20
* MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
21
* INFINEON SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL,
22
* OR CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
23
*
24
* \defgroup IfxLld_Gtm_Std_Cmu CMU Basic Functionality
25
* \ingroup IfxLld_Gtm_Std
26
* \defgroup IfxLld_Gtm_Std_Cmu_Enumerations CMU Enumerations
27
* \ingroup IfxLld_Gtm_Std_Cmu
28
* \defgroup IfxLld_Gtm_Std_Cmu_Basic_Functions CMU Basic Functions
29
* \ingroup IfxLld_Gtm_Std_Cmu
30
*/
31
32
#ifndef IFXGTM_CMU_H
33
#define IFXGTM_CMU_H 1
34
35
/******************************************************************************/
36
/*----------------------------------Includes----------------------------------*/
37
/******************************************************************************/
38
39
#include "
_Impl/IfxGtm_cfg.h
"
40
41
/******************************************************************************/
42
/*--------------------------------Enumerations--------------------------------*/
43
/******************************************************************************/
44
45
/** \addtogroup IfxLld_Gtm_Std_Cmu_Enumerations
46
* \{ */
47
typedef
enum
48
{
49
IfxGtm_Cmu_Clk_0
= 0,
50
IfxGtm_Cmu_Clk_1
,
51
IfxGtm_Cmu_Clk_2
,
52
IfxGtm_Cmu_Clk_3
,
53
IfxGtm_Cmu_Clk_4
,
54
IfxGtm_Cmu_Clk_5
,
55
IfxGtm_Cmu_Clk_6
,
56
IfxGtm_Cmu_Clk_7
,
57
}
IfxGtm_Cmu_Clk
;
58
59
typedef
enum
60
{
61
IfxGtm_Cmu_Eclk_0
= 0,
62
IfxGtm_Cmu_Eclk_1
,
63
IfxGtm_Cmu_Eclk_2
,
64
}
IfxGtm_Cmu_Eclk
;
65
66
typedef
enum
67
{
68
IfxGtm_Cmu_Fxclk_0
= 0,
69
IfxGtm_Cmu_Fxclk_1
,
70
IfxGtm_Cmu_Fxclk_2
,
71
IfxGtm_Cmu_Fxclk_3
,
72
IfxGtm_Cmu_Fxclk_4
,
73
}
IfxGtm_Cmu_Fxclk
;
74
75
/** \} */
76
77
/** \addtogroup IfxLld_Gtm_Std_Cmu_Basic_Functions
78
* \{ */
79
80
/******************************************************************************/
81
/*-------------------------Global Function Prototypes-------------------------*/
82
/******************************************************************************/
83
84
/** \brief Enable / Disable the configurable, fixed, and external clocks
85
*
86
* FIXME chek that CMU register are accessed 32 bitwise (See TS 3.0 27.8.8 CMU Configuration Register Description).
87
* If not use different coding way
88
* \param gtm Pointer to GTM module
89
* \param clkMask Enable / Disable mask. Mask is from \ref IfxLld_Gtm_cfg_cmu_clock_enable_disable
90
* \return None
91
*/
92
IFX_EXTERN
void
IfxGtm_Cmu_enableClocks
(Ifx_GTM *gtm,
uint32
clkMask);
93
94
/** \brief Returns the GTM configurable clock frequency in Hz
95
* \param gtm Pointer to GTM module
96
* \param clkIndex Index of the configurable clock 0=CMU_CLK0, 1=CMU_CLK1, ...
97
* \param assumeEnabled When TRUE, attempt to calculate the frequency as if the clock is enabled.
98
* \return GTM configurable clock frequency in Hz
99
*/
100
IFX_EXTERN
float32
IfxGtm_Cmu_getClkFrequency
(Ifx_GTM *gtm,
IfxGtm_Cmu_Clk
clkIndex,
boolean
assumeEnabled);
101
102
/** \brief Returns the GTM external clock frequency in Hz
103
* \param gtm Pointer to GTM module
104
* \param clkIndex Index of the external clock 0=CMU_ECLK0, 1=CMU_ECLK1, ...
105
* \param assumeEnabled When TRUE, attempt to calculate the frequency as if the clock is enabled.
106
* \return GTM external clock frequency in Hz
107
*/
108
IFX_EXTERN
float32
IfxGtm_Cmu_getEclkFrequency
(Ifx_GTM *gtm,
IfxGtm_Cmu_Eclk
clkIndex,
boolean
assumeEnabled);
109
110
/** \brief Returns the GTM fixed clock frequency in Hz
111
* \param gtm Pointer to GTM module
112
* \param clkIndex Index of the fixed clock 0=CMU_FXCLK0, 1=CMU_FXCLK1, ...
113
* \param assumeEnabled When TRUE, attempt to calculate the frequency as if the clock is enabled.
114
* \return GTM fixed clock frequency in Hz
115
*/
116
IFX_EXTERN
float32
IfxGtm_Cmu_getFxClkFrequency
(Ifx_GTM *gtm,
IfxGtm_Cmu_Fxclk
clkIndex,
boolean
assumeEnabled);
117
118
/** \brief Returns the GTM global clock frequency in Hz
119
* \param gtm Pointer to GTM module
120
* \return GTM global clock frequency in Hz
121
*/
122
IFX_EXTERN
float32
IfxGtm_Cmu_getGclkFrequency
(Ifx_GTM *gtm);
123
124
/** \brief Returns the GTM module frequency in Hz
125
* \param gtm Pointer to GTM module
126
* \return GTM module frequency in Hz
127
*/
128
IFX_EXTERN
float32
IfxGtm_Cmu_getModuleFrequency
(Ifx_GTM *gtm);
129
130
/** \brief Returns the configurable clock enable status
131
* \param gtm Pointer to GTM module
132
* \param clkIndex Index of the configurable clock 0=CMU_CLK0, 1=CMU_CLK1, ...
133
* \return TRUE The clock is enabled, FALSE The clock is disabled
134
*/
135
IFX_EXTERN
boolean
IfxGtm_Cmu_isClkClockEnabled
(Ifx_GTM *gtm,
IfxGtm_Cmu_Clk
clkIndex);
136
137
/** \brief Returns the external clock enable status
138
* \param gtm Pointer to GTM module
139
* \param clkIndex Index of the external clock 0=CMU_ECLK0, 1=CMU_ECLK1, ...
140
* \return TRUE The clock is enabled, FALSE The clock is disabled
141
*/
142
IFX_EXTERN
boolean
IfxGtm_Cmu_isEclkClockEnabled
(Ifx_GTM *gtm,
IfxGtm_Cmu_Eclk
clkIndex);
143
144
/** \brief Returns the fixed clock enable status
145
* \param gtm Pointer to GTM module
146
* \return TRUE The clock is enabled, FALSE The clock is disabled
147
*/
148
IFX_EXTERN
boolean
IfxGtm_Cmu_isFxClockEnabled
(Ifx_GTM *gtm);
149
150
/** \brief Select the clock input for CLK6 and CLK7
151
* note The frequency can only be modified when the corresponding clock is disabled using IfxGtm_Cmu_enableClocks()
152
* \param gtm Pointer to GTM module
153
* \param clkIndex Index of the configurable clock 0=CMU_CLK0, 1=CMU_CLK1, ...
154
* \param useGlobal if TRUE, uses the global clock as an input, else use the SUB_INC input
155
* \return None
156
*/
157
IFX_EXTERN
void
IfxGtm_Cmu_selectClkInput
(Ifx_GTM *gtm,
IfxGtm_Cmu_Clk
clkIndex,
boolean
useGlobal);
158
159
/** \brief Set the GTM configurable clock frequency in Hz
160
* \param gtm Pointer to GTM module
161
* \param clkIndex Index of the configurable clock 0=CMU_CLK0, 1=CMU_CLK1, ...
162
* \param frequency Frequency in Hz
163
* \return None
164
*/
165
IFX_EXTERN
void
IfxGtm_Cmu_setClkFrequency
(Ifx_GTM *gtm,
IfxGtm_Cmu_Clk
clkIndex,
float32
frequency);
166
167
/** \brief Set the GTM external clock frequency in Hz
168
* \param gtm Pointer to GTM module
169
* \param clkIndex Index of the external clock 0=CMU_ECLK0, 1=CMU_ECLK1, ...
170
* \param frequency Frequency in Hz
171
* \return None
172
*/
173
IFX_EXTERN
void
IfxGtm_Cmu_setEclkFrequency
(Ifx_GTM *gtm,
IfxGtm_Cmu_Eclk
clkIndex,
float32
frequency);
174
175
/** \brief Set the GTM global clock frequency in Hz
176
* \param gtm Pointer to GTM module
177
* \param frequency Frequency in Hz
178
* \return None
179
*/
180
IFX_EXTERN
void
IfxGtm_Cmu_setGclkFrequency
(Ifx_GTM *gtm,
float32
frequency);
181
182
/** \} */
183
184
#endif
/* IFXGTM_CMU_H */
home
mclld
Libraries
release
iLLD_0_1_0_10
src
ifx
TC27xC
Gtm
Std
IfxGtm_Cmu.h
Generated by
1.8.4