iLLD_TC29x
1.0
IfxFce.h
Go to the documentation of this file.
1
/**
2
* \file IfxFce.h
3
* \brief FCE basic functionality
4
* \ingroup IfxLld_Fce
5
*
6
* \version iLLD_1_0_0_11_0
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
*
25
* \defgroup IfxLld_Fce_Std_Enum Enumerations
26
* \ingroup IfxLld_Fce_Std
27
* \defgroup IfxLld_Fce_Std_Module Module Functions
28
* \ingroup IfxLld_Fce_Std
29
* \defgroup IfxLld_Fce_Std_Support Support Function
30
* \ingroup IfxLld_Fce_Std
31
* \defgroup IfxLld_Fce_Std_InterruptStatus Interrupt Status Functions
32
* \ingroup IfxLld_Fce_Std
33
*/
34
35
#ifndef IFXFCE_H
36
#define IFXFCE_H 1
37
38
/******************************************************************************/
39
/*----------------------------------Includes----------------------------------*/
40
/******************************************************************************/
41
42
#include "
_Impl/IfxFce_cfg.h
"
43
#include "
Cpu/Std/IfxCpu_Intrinsics.h
"
44
#include "
Scu/Std/IfxScuWdt.h
"
45
#include "IfxFce_reg.h"
46
#include "
Src/Std/IfxSrc.h
"
47
48
/******************************************************************************/
49
/*--------------------------------Enumerations--------------------------------*/
50
/******************************************************************************/
51
52
/** \addtogroup IfxLld_Fce_Std_Enum
53
* \{ */
54
/** \brief Ifx_FCE_INx(x= 0,1), Specifies the kernel used for CRC-32
55
*/
56
typedef
enum
57
{
58
IfxFce_Crc32Kernel_0
= 0,
/**< \brief Specifies the kernel 0 used for CRC-32 */
59
IfxFce_Crc32Kernel_1
/**< \brief Specifies the kernel 1 used for CRC-32 */
60
}
IfxFce_Crc32Kernel
;
61
62
/** \brief Specifies the CRC mode
63
*/
64
typedef
enum
65
{
66
IfxFce_CrcMode_8
= 0,
/**< \brief Specifies the 8-bit CRC mode */
67
IfxFce_CrcMode_16
= 1,
/**< \brief Specifies the 16-bit CRC mode */
68
IfxFce_CrcMode_32
= 2
/**< \brief Specifies the 32-bit CRC mode */
69
}
IfxFce_CrcMode
;
70
71
/** \} */
72
73
/** \addtogroup IfxLld_Fce_Std_Module
74
* \{ */
75
76
/******************************************************************************/
77
/*-------------------------Inline Function Prototypes-------------------------*/
78
/******************************************************************************/
79
80
/** \brief Enable the control of FCE module
81
* \param fce Specifies pointer to FCE module registers
82
* \return None
83
*/
84
IFX_INLINE
void
IfxFce_enableModule
(Ifx_FCE *fce);
85
86
/******************************************************************************/
87
/*-------------------------Global Function Prototypes-------------------------*/
88
/******************************************************************************/
89
90
/** \brief Reset the module by clearing the kernel
91
* \param fce Specifies pointer to FCE module registers
92
* \return None
93
*/
94
IFX_EXTERN
void
IfxFce_resetModule
(Ifx_FCE *fce);
95
96
/** \} */
97
98
/** \addtogroup IfxLld_Fce_Std_Support
99
* \{ */
100
101
/******************************************************************************/
102
/*-------------------------Global Function Prototypes-------------------------*/
103
/******************************************************************************/
104
105
/** \brief Reflects the CRC data and returns it
106
* \param crcStartValue start value for reflection
107
* \param crcLength length of reflected value
108
* \return Reflected CRC data
109
*/
110
IFX_EXTERN
uint32
IfxFce_reflectCrc32
(
uint32
crcStartValue,
uint8
crcLength);
111
112
/** \} */
113
114
/** \addtogroup IfxLld_Fce_Std_InterruptStatus
115
* \{ */
116
117
/******************************************************************************/
118
/*-------------------------Inline Function Prototypes-------------------------*/
119
/******************************************************************************/
120
121
/** \brief Clears the CRC-16 error flags
122
* \param fce Specifies pointer to FCE module registers
123
* \return None
124
*/
125
IFX_INLINE
void
IfxFce_clearCrc16ErrorFlags
(Ifx_FCE *fce);
126
127
/** \brief Clears the CRC-32 error flags
128
* \param fce Specifies pointer to FCE module registers
129
* \param crc32Kernel Specifies the kernel used for CRC-32
130
* \return None
131
*/
132
IFX_INLINE
void
IfxFce_clearCrc32ErrorFlags
(Ifx_FCE *fce,
IfxFce_Crc32Kernel
crc32Kernel);
133
134
/** \brief Clears the CRC-8 error flags
135
* \param fce Specifies pointer to FCE module registers
136
* \return None
137
*/
138
IFX_INLINE
void
IfxFce_clearCrc8ErrorFlags
(Ifx_FCE *fce);
139
140
/** \brief Returns the SRC pointer for FCE
141
* \param fce Specifies pointer to FCE module registers
142
*/
143
IFX_INLINE
volatile
Ifx_SRC_SRCR *
IfxFce_getSrcPointer
(Ifx_FCE *fce);
144
145
/******************************************************************************/
146
/*-------------------------Global Function Prototypes-------------------------*/
147
/******************************************************************************/
148
149
/** \brief Gets the CRC-16 interrupt status
150
* \param fce Specifies pointer to FCE module registers
151
* \return Current CRC-16 interrupt status
152
*/
153
IFX_EXTERN
Ifx_FCE_STS
IfxFce_getCrc16InterruptStatus
(Ifx_FCE *fce);
154
155
/** \brief Gets the CRC-32 interrupt status
156
* \param fce Specifies pointer to FCE module registers
157
* \param crc32Kernel Specifies the kernel used for CRC-32
158
* \return Current CRC-32 interrupt status
159
*/
160
IFX_EXTERN
Ifx_FCE_STS
IfxFce_getCrc32InterruptStatus
(Ifx_FCE *fce,
IfxFce_Crc32Kernel
crc32Kernel);
161
162
/** \brief Gets the CRC-8 interrupt status
163
* \param fce Specifies pointer to FCE module registers
164
* \return Current CRC-8 interrupt status
165
*/
166
IFX_EXTERN
Ifx_FCE_STS
IfxFce_getCrc8InterruptStatus
(Ifx_FCE *fce);
167
168
/** \} */
169
170
/******************************************************************************/
171
/*---------------------Inline Function Implementations------------------------*/
172
/******************************************************************************/
173
174
IFX_INLINE
void
IfxFce_clearCrc16ErrorFlags
(Ifx_FCE *fce)
175
{
176
fce->IN2.STS.U = 0x00000001U;
177
}
178
179
180
IFX_INLINE
void
IfxFce_clearCrc32ErrorFlags
(Ifx_FCE *fce,
IfxFce_Crc32Kernel
crc32Kernel)
181
{
182
if
(crc32Kernel ==
IfxFce_Crc32Kernel_0
)
183
{
184
fce->IN0.STS.U = 0x00000001U;
185
}
186
else
187
{
188
fce->IN1.STS.U = 0x00000001U;
189
}
190
}
191
192
193
IFX_INLINE
void
IfxFce_clearCrc8ErrorFlags
(Ifx_FCE *fce)
194
{
195
fce->IN3.STS.U = 0x00000001U;
196
}
197
198
199
IFX_INLINE
void
IfxFce_enableModule
(Ifx_FCE *fce)
200
{
201
fce->CLC.B.DISR = 0;
202
}
203
204
205
IFX_INLINE
volatile
Ifx_SRC_SRCR *
IfxFce_getSrcPointer
(Ifx_FCE *fce)
206
{
207
return
&SRC_FCE;
208
}
209
210
211
#endif
/* IFXFCE_H */
home
mclld
Libraries
release
iLLD_1_0_0_11_0
src
ifx
TC29x
Fce
Std
IfxFce.h
Generated by
1.8.4