Infineon MOTIX™ MCU TLE987x Device Family SDK
adc2.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  **********************************************************************************************************************/
39 /*******************************************************************************
40 ** Author(s) Identity **
41 ********************************************************************************
42 ** Initials Name **
43 ** ---------------------------------------------------------------------------**
44 ** DM Daniel Mysliwitz **
45 ** DCM Dragos C. Molocea **
46 ** BG Blandine Guillot **
47 ** JO Julia Ott **
48 *******************************************************************************/
49 
50 /*******************************************************************************
51 ** Revision Control History **
52 ********************************************************************************
53 ** V0.1.0: 2014-05-13, DM: Initial version **
54 ** V0.1.1: 2014-09-11, DM: ADC2->TH6_9_LOWER added to Init function **
55 ** V0.1.2: 2015-02-10, DM: Individual header file added **
56 ** V0.1.3: 2015-02-24, DM: Comment for TH6_9_UPPER added **
57 ** V0.1.4: 2015-07-16, DM: GetChResult/GetSwModeResult result register **
58 ** address calculation corrected **
59 ** V0.1.5: 2017-01-23, DM: MMODE and Hysteresis added **
60 ** V0.1.6: 2017-07-13, DM: ADC2_VCCP_Result_mV() renamed to **
61 ** ADC2_VDDC_Result_mV() **
62 ** Double declaration of ADC2_Temp_Result_C removed **
63 ** V0.1.7: 2017-09-26, DM: ADC2_TEMP_WARN_Int_En/Dis macros renamed to **
64 ** ADC2_Temp_Warn_Int_En/Dis **
65 ** MISRA 2012 compliance, the following PC-Lint **
66 ** rules are globally deactivated: **
67 ** - Info 793: ANSI/ISO limit of 6 'significant **
68 ** characters in an external identifier **
69 ** - Info 835: A zero has been given as right **
70 ** argument to operator **
71 ** - Info 845: The left argument to operator '&' **
72 ** is certain to be 0 **
73 ** Replaced macros by INLINE functions **
74 ** Replaced register accesses within functions by **
75 ** function calls **
76 ** Replaced __STATIC_INLINE by INLINE **
77 ** V0.1.8: 2018-07-03, DCM: Conversion formula from digital value to mV **
78 ** changed based on the software unit test findings **
79 ** and simplified according to the new spec **
80 ** V0.1.9: 2018-11-27, JO: Moved revision history from adc2.c to adc2.h **
81 ** Included tle_variants.h instead of tle_device.h **
82 ** Added include io.which was included by **
83 ** tle_device.h indirectly **
84 ** V0.2.0: 2019-09-10, JO: Added initialization of ADC2->FILT_LO_CTRL and **
85 ** ADC2->FILT_UP_CTRL to ADC2_Init() **
86 ** V0.2.1: 2020-04-15, BG: Updated revision history format **
87 ** V0.2.2: 2020-07-13, JO: EP-431: remove ARMCC v6 Compiler warnings **
88 ** - Added typecasts to remove 'implicit typecast' **
89 ** warning **
90 ** V0.2.3: 2020-07-21, BG: EP-439: Formatted .h/.c files **
91 ** V0.2.4: 2020-10-13, JO: EP-518: Replaced ° by deg in doxygen comment **
92 ** V0.2.5: 2021-04-23, BG: EP-726: Corrected MISRA 2012 violations **
93 ** V0.2.6: 2022-02-28, JO: EP-936: Updated copyright and branding **
94 *******************************************************************************/
95 
96 #ifndef ADC2_H
97 #define ADC2_H
98 
99 /*******************************************************************************
100 ** Includes **
101 *******************************************************************************/
102 #include "tle987x.h"
103 #include "types.h"
104 #include "adc2_defines.h"
105 #include "tle_variants.h"
106 #include "sfr_access.h"
107 
108 /*******************************************************************************
109 ** Global Constant Declarations **
110 *******************************************************************************/
112 #define ADC2_VREF (1.211F)
114 #define ADC2_VREF_mV (1211)
116 #define ADC2_FILTOUT_MAX (1023u)
117 
120 #define VS_ATTEN_CONV_NOMIN_MAX28V (1000u)
121 #define VS_ATTEN_CONV_DENOM_MAX28V (39u)
122 
125 #define VS_ATTEN_CONV_NOMIN_MAX22V (200u)
126 #define VS_ATTEN_CONV_DENOM_MAX22V (11u)
127 
130 #define VSD_ATTEN_CONV_NOMIN (1000u)
131 #define VSD_ATTEN_CONV_DENOM (39u)
132 
135 #define VCP_ATTEN_CONV_NOMIN (1000u)
136 #define VCP_ATTEN_CONV_DENOM (23u)
137 
140 #define MON_ATTEN_CONV_NOMIN (1000u)
141 #define MON_ATTEN_CONV_DENOM (39u)
142 
145 #define VDDP_ATTEN_CONV_NOMIN (250u)
146 #define VDDP_ATTEN_CONV_DENOM (41u)
147 
150 #define VAREF_ATTEN_CONV_NOMIN (1000u)
151 #define VAREF_ATTEN_CONV_DENOM (219u)
152 
155 #define VBG_ATTEN_CONV_NOMIN (4u)
156 #define VBG_ATTEN_CONV_DENOM (3u)
157 
160 #define VDDC_ATTEN_CONV_NOMIN (4u)
161 #define VDDC_ATTEN_CONV_DENOM (3u)
162 
164 #define V_TEMP_REF_OFFSET_mV (666u)
165 
167 #define V_TEMP_SCALE_FACT (100u)
168 
171 #define CONV_COEFF_mV_TO_degC (231u)
172 
174 #define ADC2_VBAT (0)
176 #define ADC2_VS (1)
178 #define ADC2_VSD (2)
180 #define ADC2_VCP (3)
182 #define ADC2_MON (4)
184 #define ADC2_VDDP (5)
186 #define ADC2_VAREF (6)
188 #define ADC2_VBG (7)
190 #define ADC2_VDDC (8)
192 #define ADC2_TEMP (9)
193 
194 /*******************************************************************************
195 ** Global Macro Declarations **
196 *******************************************************************************/
197 
198 #if (UC_SERIES == TLE986)
199 #define ADC2_VBat_Attenuator_Range_3_28V (1u)
200 #define ADC2_VBat_Attenuator_Range_3_22V (0u)
201 
215 {
216  Field_Mod32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk, 1u);
217 }
218 
232 {
233  Field_Mod32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk, 0u);
234 }
235 
254 {
255  return ( u8_Field_Rd32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk) );
256 }
257 #endif
258 
259 #define ADC2_VS_Attenuator_Range_3_28V (1u)
260 #define ADC2_VS_Attenuator_Range_3_22V (0u)
261 
275 {
277 }
278 
292 {
294 }
295 
314 {
316 }
317 
318 /* ADC2 Interrupt Clear Macros */
337 {
339 }
340 
359 {
361 }
362 
381 {
383 }
384 
403 {
405 }
406 
425 {
427 }
428 
447 {
449 }
450 
469 {
471 }
472 
491 {
493 }
494 
513 {
515 }
516 
535 {
537 }
538 
539 #if (UC_SERIES == TLE986)
558 {
559  Field_Wrt32(&SCUPM->SYS_SUPPLY_IRQ_CLR.reg, SCUPM_SYS_SUPPLY_IRQ_CLR_VBAT_OV_ICLR_Pos, SCUPM_SYS_SUPPLY_IRQ_CLR_VBAT_OV_ICLR_Msk, 1u);
560 }
561 
580 {
581  Field_Wrt32(&SCUPM->SYS_SUPPLY_IRQ_CLR.reg, SCUPM_SYS_SUPPLY_IRQ_CLR_VBAT_UV_ICLR_Pos, SCUPM_SYS_SUPPLY_IRQ_CLR_VBAT_UV_ICLR_Msk, 1u);
582 }
583 #endif
584 
585 #if (UC_SERIES == TLE987)
604 {
606 }
607 
626 {
628 }
629 #endif
630 
649 {
651 }
652 
671 {
673 }
674 
675 #if ((ADC2_CTRL2 & (1u << 2u)) == 0u)
676 /* System Temperature Sensor */
695 {
697 }
698 
717 {
719 }
720 #else
721 /* PMU Temperature Sensor */
739 INLINE void ADC2_TEMP_OT_Int_Clr(void)
740 {
742 }
743 
762 {
764 }
765 #endif
766 
767 /* ADC2 Interrupt Enable/Disable Macros */
786 {
788 }
789 
809 {
811 }
812 
831 {
833 }
834 
854 {
856 }
857 
876 {
878 }
879 
899 {
901 }
902 
921 {
923 }
924 
944 {
946 }
947 
966 {
968 }
969 
989 {
991 }
992 
1011 {
1013 }
1014 
1034 {
1036 }
1037 
1056 {
1058 }
1059 
1079 {
1081 }
1082 
1101 {
1103 }
1104 
1124 {
1126 }
1127 
1146 {
1148 }
1149 
1169 {
1171 }
1172 
1191 {
1193 }
1194 
1214 {
1216 }
1217 
1218 #if (UC_SERIES == TLE986)
1237 {
1238  Field_Mod32(&SCUPM->SYS_SUPPLY_IRQ_CTRL.reg, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_OV_IE_Pos, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_OV_IE_Msk, 1u);
1239 }
1240 
1260 {
1261  Field_Mod32(&SCUPM->SYS_SUPPLY_IRQ_CTRL.reg, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_OV_IE_Pos, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_OV_IE_Msk, 0u);
1262 }
1263 
1282 {
1283  Field_Mod32(&SCUPM->SYS_SUPPLY_IRQ_CTRL.reg, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_UV_IE_Pos, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_UV_IE_Msk, 1u);
1284 }
1285 
1305 {
1306  Field_Mod32(&SCUPM->SYS_SUPPLY_IRQ_CTRL.reg, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_UV_IE_Pos, SCUPM_SYS_SUPPLY_IRQ_CTRL_VBAT_UV_IE_Msk, 0u);
1307 }
1308 #endif
1309 
1310 #if (UC_SERIES == TLE987)
1329 {
1331 }
1332 
1352 {
1354 }
1355 
1374 {
1376 }
1377 
1397 {
1399 }
1400 #endif
1401 
1420 {
1422 }
1423 
1443 {
1445 }
1446 
1465 {
1467 }
1468 
1488 {
1490 }
1491 
1492 #if ((ADC2_CTRL2 & (1u << 2u)) == 0u)
1493 /* System Temperature Sensor */
1512 {
1514 }
1515 
1535 {
1537 }
1538 
1557 {
1559 }
1560 
1580 {
1582 }
1583 #else
1584 /* PMU Temperature Sensor */
1602 INLINE void ADC2_Temp_OT_Int_En(void)
1603 {
1605 }
1606 
1625 INLINE void ADC2_Temp_OT_Int_Dis(void)
1626 {
1628 }
1629 
1647 INLINE void ADC2_Temp_Warn_Int_En(void)
1648 {
1650 }
1651 
1670 INLINE void ADC2_Temp_Warn_Int_Dis(void)
1671 {
1673 }
1674 #endif
1675 
1676 /*******************************************************************************
1677 ** Global Function Declarations **
1678 *******************************************************************************/
1683 void ADC2_Init(void);
1685 #if (UC_SERIES == TLE986)
1687 #endif
1697 
1698 /*******************************************************************************
1699 ** Global Inline Function Definitions **
1700 *******************************************************************************/
1720 {
1721  const volatile uint32 *pBaseAddr;
1722  uint16 Var;
1723  uint32 addr;
1724  uint16 idx;
1725 
1726  if ((uint8)ADC2_TEMP >= channel)
1727  {
1728  /* violation: intended cast from pointer to unsigned int [MISRA Rule 45]*/
1729  addr = (uint32)&ADC2->FILT_OUT0.reg;
1730  /* calculate address offset corresponding to the input channel number */
1731  idx = (uint16)((uint16)channel << 2u);
1732  addr += idx;
1733  /* violation: intended cast from unsigned int to pointer [MISRA Rule 45]*/
1734  pBaseAddr = (volatile uint32 *) addr;
1735  /* read the 10 LSbit of the ADC FILT_OUTx register */
1736  Var = (uint16)((*pBaseAddr) & (uint32)0x000003FF);
1737  }
1738  else
1739  {
1740  Var = 0;
1741  }
1742 
1743  return (Var);
1744 } /* End of ADC2_GetChResult */
1745 #if (UC_SERIES == TLE986)
1768 {
1769  uint16 value;
1770  value = ADC2_GetChResult(ADC2_VBAT);
1771 
1773  {
1774  /* Conversion for VBat attenuator range up to 28 V same as for VS */
1776  }
1777  else
1778  {
1779  /* Conversion for VBat attenuator range up to 22 V same as for VS */
1781  }
1782 
1783  return (value);
1784 }
1785 #endif
1808 {
1809  uint16 value;
1810  value = ADC2_GetChResult(ADC2_VS);
1811 
1813  {
1814  /* Conversion for VS attenuator range up to 28 V */
1816  }
1817  else
1818  {
1819  /* Conversion for VS attenuator range up to 22 V */
1821  }
1822 
1823  return (value);
1824 }
1844 {
1845  uint16 value;
1846  value = ADC2_GetChResult(ADC2_VSD);
1847  /* Conversion for VSD attenuator (attenuator 0.039 = 39/1000) */
1849  return (value);
1850 }
1870 {
1871  uint16 value;
1872  value = ADC2_GetChResult((uint8)ADC2_VCP);
1873  /* Conversion for VCP attenuator (attenuator 0.023 = 23/1000) */
1875  return (value);
1876 }
1877 
1897 {
1898  uint16 value;
1899  value = ADC2_GetChResult((uint8)ADC2_MON);
1900  /* Conversion for MON attenuator (attenuator 0.039 = 39/1000) */
1902  return (value);
1903 }
1904 
1924 {
1925  uint16 value;
1926  value = ADC2_GetChResult((uint8)ADC2_VDDP);
1927  /* Conversion for VDDP attenuator (attenuator 0.164 = 41/250) */
1929  return (value);
1930 }
1931 
1951 {
1952  uint16 value;
1953  value = ADC2_GetChResult((uint8)ADC2_VAREF);
1954  /* Conversion for VAREF attenuator (attenuator 0.219 = 219/1000) */
1956  return (value);
1957 }
1958 
1978 {
1979  uint16 value;
1980  value = ADC2_GetChResult((uint8)ADC2_VBG);
1981  /* Conversion for VBG attenuator (attenuator 0.75 = 3/4) */
1983  return (value);
1984 }
1985 
2005 {
2006  uint16 value;
2007  value = ADC2_GetChResult((uint8)ADC2_VDDC);
2008  /* Conversion for VDDC attenuator (attenuator 0.75 = 3/4) */
2010  return (value);
2011 }
2012 
2033 {
2034  uint16 value;
2035  uint16 V_Temp_mV;
2036  sint16 Temperature;
2037  value = ADC2_GetChResult((uint8)ADC2_TEMP);
2038  /* Conversion for Temperature in deg C:
2039  Step 1: Calculate V_Temp(T)(mV): */
2040  V_Temp_mV = (uint16)(((uint32)value * (uint32)ADC2_VREF_mV) / (uint16)1023);
2041  /* Step 2: Conversion from V_Temp(T)(mV) to Temperature in deg C */
2043  /* return the calculated Temperature in deg C */
2044  return (Temperature);
2045 }
2046 
2047 #endif
INLINE void ADC2_VDDP_OV_Int_Dis(void)
disables VDDP Overvoltage interrupt.
Definition: adc2.h:898
INLINE void ADC2_VDDP_UV_Int_En(void)
enables VDDP Undervoltage interrupt.
Definition: adc2.h:920
INLINE uint16 ADC2_VAREF_Result_mV(void)
returns the Voltage of the VAREF line (ADC2 Channel 6) in millivolt (mV)
Definition: adc2.h:1950
#define VS_ATTEN_CONV_NOMIN_MAX28V
Nominator and Denominator of Attenuator Conversion formula for VS: attenuator for VS Range 0....
Definition: adc2.h:120
INLINE void ADC2_Temp_Warn_Int_Dis(void)
disables System Overtemperature Prewarning interrupt.
Definition: adc2.h:1579
#define V_TEMP_REF_OFFSET_mV
Offset of V_Temp (mV) corresponding to 0 °C reference.
Definition: adc2.h:164
INLINE void ADC2_VSD_OV_Int_En(void)
enables Driver Supply MU High interrupt.
Definition: adc2.h:1055
INLINE void ADC2_VDDP_UV_Int_Dis(void)
disables VDDP Undervoltage interrupt.
Definition: adc2.h:943
#define VDDP_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VDDP: attenuator for VDDP is 0....
Definition: adc2.h:145
INLINE uint16 ADC2_MON_Result_mV(void)
returns the Voltage of the MON line (ADC2 Channel 4) in millivolt (mV)
Definition: adc2.h:1896
INLINE uint16 ADC2_VDDP_Result_mV(void)
returns the Voltage of the VDDP line (ADC2 Channel 5) in millivolt (mV)
Definition: adc2.h:1923
#define VBG_ATTEN_CONV_DENOM
Definition: adc2.h:156
INLINE void ADC2_VBat_Attenuator_Range_3_28V_Set(void)
sets ADC2 Channel 0 (VBat) Attenuator Range to Range 2 (from 3 to 28 V).
Definition: adc2.h:214
INLINE void ADC2_TEMP_WARN_Int_Clr(void)
clears System Overtemperature Prewarning Interrupt Status.
Definition: adc2.h:716
#define V_TEMP_SCALE_FACT
Scaling factor for V_Temp (mV)
Definition: adc2.h:167
INLINE void ADC2_VDDC_OV_Int_En(void)
enables VDDC Overvoltage interrupt.
Definition: adc2.h:965
#define MON_ATTEN_CONV_DENOM
Definition: adc2.h:141
INLINE void ADC2_VBAT_OV_Int_Dis(void)
disables VBAT Overvoltage Interrupt.
Definition: adc2.h:1259
INLINE void ADC2_Temp_OT_Int_Dis(void)
disables System Overtemperature Shutdown interrupt.
Definition: adc2.h:1534
#define ADC2_VBAT
ADC2 channel selection macro, channel 0 - VBAT.
Definition: adc2.h:174
INLINE void ADC2_VDDP_OV_Int_En(void)
enables VDDP Overvoltage interrupt.
Definition: adc2.h:875
#define VDDC_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VDDC: attenuator for VDDC is 0....
Definition: adc2.h:160
INLINE uint16 ADC2_GetChResult(uint8 channel)
Returns the 10 bit wide result of the selected ADC2 channel.
Definition: adc2.h:1719
INLINE uint16 ADC2_VS_Result_mV(void)
returns the Voltage of the VS line (ADC2 Channel 1) in millivolt (mV)
Definition: adc2.h:1807
INLINE void ADC2_VSD_UV_Int_En(void)
enables Driver Supply MU Low interrupt.
Definition: adc2.h:1100
INLINE void ADC2_VBAT_UV_Int_En(void)
enables VBAT Undervoltage Interrupt.
Definition: adc2.h:1281
INLINE void ADC2_MON_UV_Int_Clr(void)
clears MON Undervoltage Interrupt Status.
Definition: adc2.h:625
#define VS_ATTEN_CONV_DENOM_MAX22V
Definition: adc2.h:126
#define VS_ATTEN_CONV_DENOM_MAX28V
Definition: adc2.h:121
INLINE void ADC2_VDDC_UV_Int_Clr(void)
clears VDDC Undervoltage Interrupt Status.
Definition: adc2.h:446
INLINE uint16 ADC2_VBG_Result_mV(void)
returns the Voltage of the VBG line (ADC2 Channel 7) in millivolt (mV)
Definition: adc2.h:1977
INLINE uint16 ADC2_VBat_Result_mV(void)
returns the Voltage of the VBAT line (ADC2 Channel 0 in TLE986x) in millivolt (mV)
Definition: adc2.h:1767
INLINE void ADC2_VCP_OV_Int_En(void)
enables Charge Pump MU High interrupt.
Definition: adc2.h:1145
INLINE void ADC2_TEMP_OT_Int_Clr(void)
clears System Overtemperature Shutdown Interrupt Status.
Definition: adc2.h:694
INLINE void ADC2_MON_OV_Int_En(void)
enables MON Overvoltage Interrupt.
Definition: adc2.h:1328
INLINE void ADC2_MON_UV_Int_En(void)
enables MON Undervoltage Interrupt.
Definition: adc2.h:1373
#define VDDC_ATTEN_CONV_DENOM
Definition: adc2.h:161
#define VCP_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VCP: attenuator for VCP is 0....
Definition: adc2.h:135
INLINE void ADC2_VDDC_UV_Int_Dis(void)
disables VDDC Undervoltage interrupt.
Definition: adc2.h:1033
INLINE void ADC2_VCP_OV_Int_Dis(void)
disables Charge Pump MU High interrupt.
Definition: adc2.h:1168
INLINE void ADC2_VCP_UV_Int_Dis(void)
disables Charge Pump MU Low interrupt.
Definition: adc2.h:1213
INLINE void ADC2_Temp_OT_Int_En(void)
enables System Overtemperature Shutdown interrupt.
Definition: adc2.h:1511
INLINE sint16 ADC2_Temp_Result_C(void)
Returns the Temperature read by the ADC2 Channel 9 in degrees Celsius (°C).
Definition: adc2.h:2032
#define VSD_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VSD: attenuator for VSD is 0....
Definition: adc2.h:130
#define VBG_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VBG: attenuator for VBG is 0....
Definition: adc2.h:155
INLINE uint16 ADC2_VDDC_Result_mV(void)
returns the Voltage of the VDDC line (ADC2 Channel 8) in millivolt (mV)
Definition: adc2.h:2004
#define ADC2_VS_Attenuator_Range_3_28V
Definition: adc2.h:259
INLINE uint16 ADC2_VSD_Result_mV(void)
returns the Voltage of the VSD line (ADC2 Channel 2) in millivolt
Definition: adc2.h:1843
INLINE void ADC2_VDDC_OV_Int_Clr(void)
clears VDDC Overvoltage Interrupt Status.
Definition: adc2.h:424
#define CONV_COEFF_mV_TO_degC
Conversion coefficient from V_Temp (mV) to Temperature (°C) multiplied by V_TEMP_SCALE_FACT.
Definition: adc2.h:171
INLINE void ADC2_VBG_OV_Int_Clr(void)
clears 8 Bit ADC2 Reference Overvoltage Interrupt Status.
Definition: adc2.h:648
INLINE void ADC2_VS_UV_Int_Clr(void)
clears VS Undervoltage Interrupt Status.
Definition: adc2.h:358
INLINE void ADC2_MON_UV_Int_Dis(void)
disables MON Undervoltage Interrupt.
Definition: adc2.h:1396
#define VS_ATTEN_CONV_NOMIN_MAX22V
Nominator and Denominator of Attenuator Conversion formula for VS: attenuator for VS Range 0....
Definition: adc2.h:125
#define VAREF_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VAREF: attenuator for VAREF is 0....
Definition: adc2.h:150
#define VCP_ATTEN_CONV_DENOM
Definition: adc2.h:136
#define ADC2_VS
ADC2 channel selection macro, channel 1 - VS.
Definition: adc2.h:176
#define VSD_ATTEN_CONV_DENOM
Definition: adc2.h:131
INLINE void ADC2_VSD_OV_Int_Clr(void)
clears Driver Supply MU High Interrupt Status.
Definition: adc2.h:468
#define ADC2_VAREF
ADC2 channel selection macro, channel 6 - VAREF.
Definition: adc2.h:186
INLINE void ADC2_VDDP_OV_Int_Clr(void)
clears VDDP Overvoltage Interrupt Status.
Definition: adc2.h:380
INLINE void ADC2_VBG_OV_Int_En(void)
enables 8 Bit ADC2 Reference Overvoltage interrupt.
Definition: adc2.h:1419
INLINE uint16 ADC2_VCP_Result_mV(void)
returns the Voltage of the VCP line (ADC2 Channel 3) in millivolt (mV)
Definition: adc2.h:1869
INLINE void ADC2_Temp_Warn_Int_En(void)
enables System Overtemperature Prewarning interrupt.
Definition: adc2.h:1556
INLINE void ADC2_VSD_UV_Int_Dis(void)
disables Driver Supply MU Low interrupt.
Definition: adc2.h:1123
INLINE void ADC2_VBG_UV_Int_Clr(void)
clears 8 Bit ADC2 Reference Undervoltage Interrupt Status.
Definition: adc2.h:670
INLINE uint8 ADC2_VS_Attenuator_Range_Get(void)
gets ADC2 Channel 1 (VS) Attenuator Range.
Definition: adc2.h:313
INLINE void ADC2_VBat_Attenuator_Range_3_22V_Set(void)
sets ADC2 Channel 0 (VBat) Attenuator Range to Range 1 (from 3 to 22 V).
Definition: adc2.h:231
INLINE void ADC2_VBAT_UV_Int_Dis(void)
disables VBAT Undervoltage Interrupt.
Definition: adc2.h:1304
#define ADC2_VREF_mV
ADC2 (1.211 V) in millivolts.
Definition: adc2.h:114
INLINE void ADC2_VBG_UV_Int_En(void)
enables 8 Bit ADC2 Reference Undervoltage interrupt.
Definition: adc2.h:1464
INLINE void ADC2_VS_UV_Int_Dis(void)
disables VS Undervoltage interrupt.
Definition: adc2.h:853
INLINE void ADC2_VS_Attenuator_Range_3_22V_Set(void)
sets ADC2 Channel 1 (VS) Attenuator Range to Range 1 (from 3 to 22 V).
Definition: adc2.h:291
INLINE void ADC2_VS_OV_Int_Clr(void)
clears VS Overvoltage Interrupt Status.
Definition: adc2.h:336
INLINE void ADC2_VBAT_UV_Int_Clr(void)
clears VBAT Undervoltage Interrupt Status.
Definition: adc2.h:579
INLINE void ADC2_VBG_OV_Int_Dis(void)
disables 8 Bit ADC2 Reference Overvoltage interrupt.
Definition: adc2.h:1442
INLINE void ADC2_VS_OV_Int_Dis(void)
disables VS Overvoltage interrupt.
Definition: adc2.h:808
INLINE void ADC2_VCP_UV_Int_Clr(void)
clears Charge Pump MU Low Interrupt Status.
Definition: adc2.h:534
#define ADC2_VDDC
ADC2 channel selection macro, channel 8 - VDDC.
Definition: adc2.h:190
INLINE void ADC2_VBAT_OV_Int_En(void)
enables VBAT Overvoltage Interrupt.
Definition: adc2.h:1236
#define ADC2_VBG
ADC2 channel selection macro, channel 7 - VBG.
Definition: adc2.h:188
#define MON_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for MON: attenuator for MON is 0....
Definition: adc2.h:140
void ADC2_Init(void)
Initializes the ADC2 module based on the Config Wizard for MOTIX MCU configuration.
INLINE void ADC2_VSD_OV_Int_Dis(void)
disables Driver Supply MU High interrupt.
Definition: adc2.h:1078
INLINE void ADC2_MON_OV_Int_Clr(void)
clears MON Overvoltage Interrupt Status.
Definition: adc2.h:603
#define ADC2_MON
ADC2 channel selection macro, channel 4 - MON.
Definition: adc2.h:182
INLINE void ADC2_MON_OV_Int_Dis(void)
disables MON Overvoltage Interrupt.
Definition: adc2.h:1351
#define ADC2_FILTOUT_MAX
ADC2 Filtered output register maximum value.
Definition: adc2.h:116
INLINE void ADC2_VDDC_UV_Int_En(void)
enables VDDC Undervoltage interrupt.
Definition: adc2.h:1010
#define VDDP_ATTEN_CONV_DENOM
Definition: adc2.h:146
#define ADC2_VCP
ADC2 channel selection macro, channel 3 - VCP.
Definition: adc2.h:180
#define VAREF_ATTEN_CONV_DENOM
Definition: adc2.h:151
INLINE void ADC2_VBAT_OV_Int_Clr(void)
clears VBAT Overvoltage Interrupt Status.
Definition: adc2.h:557
INLINE uint8 ADC2_VBat_Attenuator_Range_Get(void)
gets ADC2 Channel 0 (VBat) Attenuator Range.
Definition: adc2.h:253
INLINE void ADC2_VCP_UV_Int_En(void)
enables Charge Pump MU Low interrupt.
Definition: adc2.h:1190
#define ADC2_VSD
ADC2 channel selection macro, channel 2 - VSD.
Definition: adc2.h:178
INLINE void ADC2_VCP_OV_Int_Clr(void)
clears Charge Pump MU High Interrupt Status.
Definition: adc2.h:512
INLINE void ADC2_VS_OV_Int_En(void)
enables VS Overvoltage interrupt.
Definition: adc2.h:785
INLINE void ADC2_VSD_UV_Int_Clr(void)
clears Driver Supply MU Low interrupt flag.
Definition: adc2.h:490
INLINE void ADC2_VBG_UV_Int_Dis(void)
disables 8 Bit ADC2 Reference Undervoltage interrupt.
Definition: adc2.h:1487
#define ADC2_VDDP
ADC2 channel selection macro, channel 5 - VDDP.
Definition: adc2.h:184
INLINE void ADC2_VS_UV_Int_En(void)
enables VS Undervoltage interrupt.
Definition: adc2.h:830
INLINE void ADC2_VDDP_UV_Int_Clr(void)
clears VDDP Undervoltage Interrupt Status.
Definition: adc2.h:402
INLINE void ADC2_VS_Attenuator_Range_3_28V_Set(void)
sets ADC2 Channel 1 (VS) Attenuator Range to Range 2 (from 3 to 28 V).
Definition: adc2.h:274
#define ADC2_TEMP
ADC2 channel selection macro, channel 9 - TEMP.
Definition: adc2.h:192
INLINE void ADC2_VDDC_OV_Int_Dis(void)
disables VDDC Overvoltage interrupt.
Definition: adc2.h:988
#define SCUPM
Definition: tle987x.h:6098
#define ADC2
Definition: tle987x.h:6084
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_OV_IE_Pos
Definition: tle987x.h:9784
#define SCUPM_BDRV_IRQ_CTRL_VSD_UPTH_IE_Msk
Definition: tle987x.h:9434
#define SCUPM_SYS_IRQ_CTRL_PMU_OT_IE_Pos
Definition: tle987x.h:9624
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_UV_IE_Pos
Definition: tle987x.h:9790
#define SCUPM_SYS_IRQ_CTRL_SYS_OTWARN_IE_Pos
Definition: tle987x.h:9622
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_OV_IE_Msk
Definition: tle987x.h:9781
#define SCUPM_SYS_IRQ_CTRL_PMU_OTWARN_IE_Pos
Definition: tle987x.h:9626
#define SCUPM_BDRV_IRQ_CTRL_VSD_LOWTH_IE_Pos
Definition: tle987x.h:9435
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_UV_IE_Pos
Definition: tle987x.h:9788
#define SCUPM_BDRV_IRQ_CTRL_VCP_LOWTH1_IE_Msk
Definition: tle987x.h:9440
#define SCUPM_SYS_ISCLR_PMU_OT_ICLR_Pos
Definition: tle987x.h:9734
#define SCUPM_SYS_IRQ_CTRL_PMU_OTWARN_IE_Msk
Definition: tle987x.h:9627
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_OV_IE_Pos
Definition: tle987x.h:9778
#define SCUPM_SYS_ISCLR_REFBG_LOTHWARN_ICLR_Msk
Definition: tle987x.h:9729
#define SCUPM_BDRV_ISCLR_VSD_UPTH_ICLR_Pos
Definition: tle987x.h:9523
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_UV_ICLR_Msk
Definition: tle987x.h:9776
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_UV_IE_Msk
Definition: tle987x.h:9789
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_UV_IE_Pos
Definition: tle987x.h:9792
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_UV_ICLR_Pos
Definition: tle987x.h:9771
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_UV_IE_Pos
Definition: tle987x.h:9786
#define SCUPM_BDRV_ISCLR_VCP_UPTH_ICLR_Pos
Definition: tle987x.h:9527
#define SCUPM_SYS_IRQ_CTRL_PMU_OT_IE_Msk
Definition: tle987x.h:9625
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_OV_ICLR_Pos
Definition: tle987x.h:9761
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_OV_ICLR_Pos
Definition: tle987x.h:9763
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_OV_IE_Msk
Definition: tle987x.h:9779
#define SCUPM_BDRV_IRQ_CTRL_VCP_UPTH_IE_Msk
Definition: tle987x.h:9438
#define SCUPM_SYS_ISCLR_REFBG_UPTHWARN_ICLR_Pos
Definition: tle987x.h:9726
#define SCUPM_BDRV_ISCLR_VSD_LOWTH_ICLR_Pos
Definition: tle987x.h:9525
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_UV_ICLR_Msk
Definition: tle987x.h:9770
#define SCUPM_SYS_IRQ_CTRL_SYS_OT_IE_Pos
Definition: tle987x.h:9620
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_OV_IE_Pos
Definition: tle987x.h:9780
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_OV_ICLR_Msk
Definition: tle987x.h:9764
#define SCUPM_SYS_IRQ_CTRL_SYS_OTWARN_IE_Msk
Definition: tle987x.h:9623
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_UV_ICLR_Msk
Definition: tle987x.h:9774
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_UV_IE_Msk
Definition: tle987x.h:9787
#define ADC2_CTRL_STS_VS_RANGE_Pos
Definition: tle987x.h:6574
#define SCUPM_SYS_IRQ_CTRL_SYS_OT_IE_Msk
Definition: tle987x.h:9621
#define SCUPM_BDRV_IRQ_CTRL_VCP_LOWTH1_IE_Pos
Definition: tle987x.h:9439
#define SCUPM_BDRV_ISCLR_VCP_UPTH_ICLR_Msk
Definition: tle987x.h:9528
#define SCUPM_SYS_ISCLR_SYS_OTWARN_ICLR_Pos
Definition: tle987x.h:9732
#define SCUPM_BDRV_ISCLR_VCP_LOWTH1_ICLR_Msk
Definition: tle987x.h:9530
#define SCUPM_SYS_ISCLR_REFBG_UPTHWARN_ICLR_Msk
Definition: tle987x.h:9727
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_UV_IE_Msk
Definition: tle987x.h:9793
#define SCUPM_BDRV_IRQ_CTRL_VCP_UPTH_IE_Pos
Definition: tle987x.h:9437
#define SCUPM_SYS_ISCLR_REFBG_LOTHWARN_ICLR_Pos
Definition: tle987x.h:9728
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_UV_ICLR_Pos
Definition: tle987x.h:9769
#define SCUPM_SYS_IRQ_CTRL_REFBG_LOTHWARN_IE_Pos
Definition: tle987x.h:9618
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_OV_ICLR_Msk
Definition: tle987x.h:9768
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_OV_IE_Msk
Definition: tle987x.h:9785
#define SCUPM_SYS_IRQ_CTRL_REFBG_UPTHWARN_IE_Msk
Definition: tle987x.h:9617
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_OV_IE_Msk
Definition: tle987x.h:9783
#define SCUPM_SYS_IRQ_CTRL_REFBG_LOTHWARN_IE_Msk
Definition: tle987x.h:9619
#define SCUPM_BDRV_ISCLR_VSD_LOWTH_ICLR_Msk
Definition: tle987x.h:9526
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_OV_ICLR_Msk
Definition: tle987x.h:9762
#define SCUPM_SYS_ISCLR_SYS_OT_ICLR_Msk
Definition: tle987x.h:9731
#define SCUPM_SYS_ISCLR_PMU_OTWARN_ICLR_Pos
Definition: tle987x.h:9736
#define SCUPM_BDRV_IRQ_CTRL_VSD_UPTH_IE_Pos
Definition: tle987x.h:9433
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_OV_ICLR_Msk
Definition: tle987x.h:9766
#define SCUPM_BDRV_IRQ_CTRL_VSD_LOWTH_IE_Msk
Definition: tle987x.h:9436
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_UV_ICLR_Pos
Definition: tle987x.h:9773
#define SCUPM_SYS_ISCLR_PMU_OT_ICLR_Msk
Definition: tle987x.h:9735
#define SCUPM_SYS_ISCLR_SYS_OT_ICLR_Pos
Definition: tle987x.h:9730
#define SCUPM_SYS_IRQ_CTRL_REFBG_UPTHWARN_IE_Pos
Definition: tle987x.h:9616
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_OV_ICLR_Pos
Definition: tle987x.h:9767
#define SCUPM_SYS_ISCLR_PMU_OTWARN_ICLR_Msk
Definition: tle987x.h:9737
#define SCUPM_BDRV_ISCLR_VCP_LOWTH1_ICLR_Pos
Definition: tle987x.h:9529
#define ADC2_CTRL_STS_VS_RANGE_Msk
Definition: tle987x.h:6575
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_UV_ICLR_Pos
Definition: tle987x.h:9775
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_UV_IE_Msk
Definition: tle987x.h:9791
#define SCUPM_BDRV_ISCLR_VSD_UPTH_ICLR_Msk
Definition: tle987x.h:9524
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_UV_ICLR_Msk
Definition: tle987x.h:9772
#define SCUPM_SYS_ISCLR_SYS_OTWARN_ICLR_Msk
Definition: tle987x.h:9733
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_OV_ICLR_Pos
Definition: tle987x.h:9765
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_OV_IE_Pos
Definition: tle987x.h:9782
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 void Field_Wrt32(volatile uint32 *reg, uint32 pos, uint32 msk, uint32 val)
This function writes a bit field in a 32-bit register.
Definition: sfr_access.h:347
INLINE uint8 u8_Field_Rd32(const volatile uint32 *reg, uint32 pos, uint32 msk)
This function reads a 8-bit field of a 32-bit register.
Definition: sfr_access.h:422
CMSIS register HeaderFile.
Device specific memory layout defines.
General type declarations.
#define INLINE
Definition: types.h:148
uint8_t uint8
8 bit unsigned value
Definition: types.h:153
int16_t sint16
16 bit signed value
Definition: types.h:159
uint16_t uint16
16 bit unsigned value
Definition: types.h:154
uint32_t uint32
32 bit unsigned value
Definition: types.h:155