TLE986x Device Family SDK
csa.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 2015, Infineon Technologies AG
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with or without modification,are permitted provided that the
8  * following conditions are met:
9  *
10  * Redistributions of source code must retain the above copyright notice, this list of conditions and the following
11  * disclaimer.
12  *
13  * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the
14  * following disclaimer in the documentation and/or other materials provided with the distribution.
15  *
16  * Neither the name of the copyright holders nor the names of its contributors may be used to endorse or promote
17  * products derived from this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES,
20  * INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
21  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
22  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
23  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
24  * WHETHER IN CONTRACT, STRICT LIABILITY,OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
25  * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  **********************************************************************************************************************/
37 /*******************************************************************************
38 ** Author(s) Identity **
39 ********************************************************************************
40 ** Initials Name **
41 ** ---------------------------------------------------------------------------**
42 ** DM Daniel Mysliwitz **
43 ** JO Julia Ott **
44 ** BG Blandine Guillot **
45 *******************************************************************************/
46 
47 /*******************************************************************************
48 ** Revision Control History **
49 ********************************************************************************
50 ** V0.1.0: 2014-06-02, DM: Initial version **
51 ** V0.1.1: 2015-02-10, DM: Individual header file added **
52 ** V0.1.2: 2017-09-29, DM: CSA_Offset_Get() function added **
53 ** MISRA 2012 compliance, the following PC-Lint **
54 ** rules are globally deactivated: **
55 ** - Info 793: ANSI/ISO limit of 6 'significant **
56 ** characters in an external identifier **
57 ** - Info 835: A zero has been given as right **
58 ** argument to operator **
59 ** - Info 845: The left argument to operator '&' **
60 ** is certain to be 0 **
61 ** Replaced register accesses within functions by **
62 ** function calls **
63 ** Replaced __STATIC_INLINE by INLINE **
64 ** V0.1.3: 2018-07-07, BG: CSA_Set_Gain(uint8 gain) function rewritten **
65 ** V0.1.4: 2018-11-27, JO: Doxygen update, moved revision history from **
66 ** csa.c to csa.h **
67 ** V0.1.5: 2020-02-28, BG: Updated revision history format **
68 *******************************************************************************/
69 
70 #ifndef CSA_H
71 #define CSA_H
72 
73 /*******************************************************************************
74 ** Includes **
75 *******************************************************************************/
76 #include "tle986x.h"
77 #include "types.h"
78 #include "sfr_access.h"
79 
80 /*******************************************************************************
81 ** Global Constant Declarations **
82 *******************************************************************************/
86 typedef enum
87 {
88  CSA_GAIN_10 = 0,
89  CSA_GAIN_20 = 1,
90  CSA_GAIN_40 = 2,
91  CSA_GAIN_60 = 3
92 } TCSA_Gain;
93 
94 /*******************************************************************************
95 ** Global Function Declarations **
96 *******************************************************************************/
109 INLINE void CSA_Power_On(void)
110 {
112 }
113 
126 INLINE void CSA_Power_Off(void)
127 {
129 }
130 
145 INLINE void CSA_Gain_Set(uint32 gain)
146 {
148 }
149 
150 /*******************************************************************************
151 ** Global Function Declarations **
152 *******************************************************************************/
157 void CSA_Init(void);
158 
159 INLINE void CSA_Set_Gain(uint8 gain);
160 
168 uint16 CSA_Offset_Get(void);
169 
170 /*******************************************************************************
171 ** Global Inline Function Definitions **
172 *******************************************************************************/
187 INLINE void CSA_Set_Gain(uint8 gain)
188 {
190 }
191 
192 
193 #endif
CSA_GAIN_40
Definition: csa.h:86
CSA_Init
void CSA_Init(void)
Initializes the CSA module.
MF_CSA_CTRL_EN_Msk
#define MF_CSA_CTRL_EN_Msk
Definition: tle986x.h:8042
CSA_Offset_Get
uint16 CSA_Offset_Get(void)
measures the CSA offset using ADC1.
types.h
General type declarations.
CSA_GAIN_20
Definition: csa.h:85
sfr_access.h
SFR low level access library.
INLINE
#define INLINE
Definition: types.h:134
MF_CSA_CTRL_EN_Pos
#define MF_CSA_CTRL_EN_Pos
Definition: tle986x.h:8041
Field_Mod32
INLINE void Field_Mod32(volatile uint32 *reg, uint32 pos, uint32 msk, uint32 val)
This function writes a bit field in a 32-bit register.
Definition: sfr_access.h:356
MF_CSA_CTRL_GAIN_Pos
#define MF_CSA_CTRL_GAIN_Pos
Definition: tle986x.h:8039
uint16
unsigned short uint16
16 bit unsigned value
Definition: types.h:140
CSA_GAIN_10
Definition: csa.h:84
uint8
unsigned char uint8
8 bit unsigned value
Definition: types.h:139
CSA_Power_On
INLINE void CSA_Power_On(void)
switches on CSA module.
Definition: csa.h:104
CSA_Gain_Set
INLINE void CSA_Gain_Set(uint32 gain)
Set CSA Gain value.
Definition: csa.h:140
CSA
#define CSA
Definition: tle986x.h:5995
CSA_GAIN_60
Definition: csa.h:87
uint32
unsigned int uint32
32 bit unsigned value
Definition: types.h:141
MF_CSA_CTRL_GAIN_Msk
#define MF_CSA_CTRL_GAIN_Msk
Definition: tle986x.h:8040
tle986x.h
CMSIS register HeaderFile.
CSA_Set_Gain
INLINE void CSA_Set_Gain(uint8 gain)
Set CSA Gain value.
Definition: csa.h:180
TCSA_Gain
TCSA_Gain
This enum lists the CSA Gain Settings.
Definition: csa.h:82
CSA_Power_Off
INLINE void CSA_Power_Off(void)
switches off CSA module.
Definition: csa.h:121