Infineon MOTIX™ MCU TLE987x Device Family SDK
csa.h
Go to the documentation of this file.
1 /*
2  ***********************************************************************************************************************
3  *
4  * Copyright (c) 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 ** BG Blandine Guillot **
44 ** JO Julia Ott **
45 ** VO Vanessa Ongaro **
46 *******************************************************************************/
47 
48 /*******************************************************************************
49 ** Revision Control History **
50 ********************************************************************************
51 ** V0.1.0: 2014-06-02, DM: Initial version **
52 ** V0.1.1: 2015-02-10, DM: Individual header file added **
53 ** V0.1.2: 2017-09-29, DM: CSA_Offset_Get() function added **
54 ** MISRA 2012 compliance, the following PC-Lint **
55 ** rules are globally deactivated: **
56 ** - Info 793: ANSI/ISO limit of 6 'significant **
57 ** characters in an external identifier **
58 ** - Info 835: A zero has been given as right **
59 ** argument to operator **
60 ** - Info 845: The left argument to operator '&' **
61 ** is certain to be 0 **
62 ** Replaced register accesses within functions by **
63 ** function calls **
64 ** Replaced __STATIC_INLINE by INLINE **
65 ** V0.1.3: 2018-07-07, BG: CSA_Set_Gain(uint8 gain) function rewritten **
66 ** V0.1.4: 2018-11-27, JO: Doxygen update **
67 ** Moved revision history from csa.c to csa.h **
68 ** V0.1.5: 2020-04-15, BG: Updated revision history format **
69 ** V0.1.6: 2020-07-21, BG: EP-439: Formatted .h/.c files **
70 ** V0.1.7: 2021-04-01, JO: EP-757: Added function CSA_Gain_Get **
71 ** V0.1.8: 2022-02-28, JO: EP-936: Updated copyright and branding **
72 ** V0.1.9: 2022-10-18, VO: EP-1252: Updated enum definition **
73 *******************************************************************************/
74 
75 #ifndef CSA_H
76 #define CSA_H
77 
78 /*******************************************************************************
79 ** Includes **
80 *******************************************************************************/
81 #include "tle987x.h"
82 #include "types.h"
83 #include "sfr_access.h"
84 
85 /*******************************************************************************
86 ** Global Constant Declarations **
87 *******************************************************************************/
91 typedef enum CSA_Gain
92 {
96  CSA_GAIN_60 = 3
98 
99 /*******************************************************************************
100 ** Global Function Declarations **
101 *******************************************************************************/
115 {
117 }
118 
132 {
134 }
135 
151 {
153 }
154 
171 {
173 }
174 
179 void CSA_Init(void);
180 
181 INLINE void CSA_Set_Gain(uint8 gain);
182 
191 
192 /*******************************************************************************
193 ** Global Inline Function Definitions **
194 *******************************************************************************/
210 {
212 }
213 
214 
215 #endif
INLINE void CSA_Gain_Set(uint32 gain)
Set CSA Gain value.
Definition: csa.h:150
INLINE void CSA_Power_On(void)
switches on CSA module.
Definition: csa.h:114
enum CSA_Gain TCSA_Gain
INLINE void CSA_Power_Off(void)
switches off CSA module.
Definition: csa.h:131
INLINE void CSA_Set_Gain(uint8 gain)
Set CSA Gain value.
Definition: csa.h:209
INLINE uint32 CSA_Gain_Get()
Get CSA Gain value.
Definition: csa.h:170
void CSA_Init(void)
Initializes the CSA module based on the Config Wizard for MOTIX MCU configuration.
CSA_Gain
Definition: csa.h:92
@ CSA_GAIN_20
Definition: csa.h:94
@ CSA_GAIN_10
Definition: csa.h:93
@ CSA_GAIN_60
Definition: csa.h:96
@ CSA_GAIN_40
Definition: csa.h:95
uint16 CSA_Offset_Get(void)
measures the CSA offset using ADC1.
#define CSA
Definition: tle987x.h:6088
#define MF_CSA_CTRL_GAIN_Pos
Definition: tle987x.h:8197
#define MF_CSA_CTRL_EN_Msk
Definition: tle987x.h:8200
#define MF_CSA_CTRL_EN_Pos
Definition: tle987x.h:8199
#define MF_CSA_CTRL_GAIN_Msk
Definition: tle987x.h:8198
SFR low level access library.
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:362
INLINE uint32 u32_Field_Rd32(const volatile uint32 *reg, uint32 pos, uint32 msk)
This function reads a 32-bit field of a 32-bit register.
Definition: sfr_access.h:437
CMSIS register HeaderFile.
General type declarations.
#define INLINE
Definition: types.h:148
uint8_t uint8
8 bit unsigned value
Definition: types.h:153
uint16_t uint16
16 bit unsigned value
Definition: types.h:154
uint32_t uint32
32 bit unsigned value
Definition: types.h:155