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  * The applicable license agreement can be found at this pack's installation directory in the file
8  * license/IFX_SW_Licence_MOTIX_LITIX.txt
9  *
10  **********************************************************************************************************************/
22 /*******************************************************************************
23 ** Author(s) Identity **
24 ********************************************************************************
25 ** Initials Name **
26 ** ---------------------------------------------------------------------------**
27 ** DM Daniel Mysliwitz **
28 ** DCM Dragos C. Molocea **
29 ** BG Blandine Guillot **
30 ** JO Julia Ott **
31 *******************************************************************************/
32 
33 /*******************************************************************************
34 ** Revision Control History **
35 ********************************************************************************
36 ** V0.1.0: 2014-05-13, DM: Initial version **
37 ** V0.1.1: 2014-09-11, DM: ADC2->TH6_9_LOWER added to Init function **
38 ** V0.1.2: 2015-02-10, DM: Individual header file added **
39 ** V0.1.3: 2015-02-24, DM: Comment for TH6_9_UPPER added **
40 ** V0.1.4: 2015-07-16, DM: GetChResult/GetSwModeResult result register **
41 ** address calculation corrected **
42 ** V0.1.5: 2017-01-23, DM: MMODE and Hysteresis added **
43 ** V0.1.6: 2017-07-13, DM: ADC2_VCCP_Result_mV() renamed to **
44 ** ADC2_VDDC_Result_mV() **
45 ** Double declaration of ADC2_Temp_Result_C removed **
46 ** V0.1.7: 2017-09-26, DM: ADC2_TEMP_WARN_Int_En/Dis macros renamed to **
47 ** ADC2_Temp_Warn_Int_En/Dis **
48 ** MISRA 2012 compliance, the following PC-Lint **
49 ** rules are globally deactivated: **
50 ** - Info 793: ANSI/ISO limit of 6 'significant **
51 ** characters in an external identifier **
52 ** - Info 835: A zero has been given as right **
53 ** argument to operator **
54 ** - Info 845: The left argument to operator '&' **
55 ** is certain to be 0 **
56 ** Replaced macros by INLINE functions **
57 ** Replaced register accesses within functions by **
58 ** function calls **
59 ** Replaced __STATIC_INLINE by INLINE **
60 ** V0.1.8: 2018-07-03, DCM: Conversion formula from digital value to mV **
61 ** changed based on the software unit test findings **
62 ** and simplified according to the new spec **
63 ** V0.1.9: 2018-11-27, JO: Moved revision history from adc2.c to adc2.h **
64 ** Included tle_variants.h instead of tle_device.h **
65 ** Added include io.which was included by **
66 ** tle_device.h indirectly **
67 ** V0.2.0: 2019-09-10, JO: Added initialization of ADC2->FILT_LO_CTRL and **
68 ** ADC2->FILT_UP_CTRL to ADC2_Init() **
69 ** V0.2.1: 2020-04-15, BG: Updated revision history format **
70 ** V0.2.2: 2020-07-13, JO: EP-431: remove ARMCC v6 Compiler warnings **
71 ** - Added typecasts to remove 'implicit typecast' **
72 ** warning **
73 ** V0.2.3: 2020-07-21, BG: EP-439: Formatted .h/.c files **
74 ** V0.2.4: 2020-10-13, JO: EP-518: Replaced ° by deg in doxygen comment **
75 ** V0.2.5: 2021-04-23, BG: EP-726: Corrected MISRA 2012 violations **
76 ** V0.2.6: 2022-02-28, JO: EP-936: Updated copyright and branding **
77 ** V0.2.7: 2025-01-02, JO: EP-1493: Updated license **
78 *******************************************************************************/
79 
80 #ifndef ADC2_H
81 #define ADC2_H
82 
83 /*******************************************************************************
84 ** Includes **
85 *******************************************************************************/
86 #include "tle987x.h"
87 #include "types.h"
88 #include "adc2_defines.h"
89 #include "tle_variants.h"
90 #include "sfr_access.h"
91 
92 /*******************************************************************************
93 ** Global Constant Declarations **
94 *******************************************************************************/
96 #define ADC2_VREF (1.211F)
98 #define ADC2_VREF_mV (1211)
100 #define ADC2_FILTOUT_MAX (1023u)
101 
104 #define VS_ATTEN_CONV_NOMIN_MAX28V (1000u)
105 #define VS_ATTEN_CONV_DENOM_MAX28V (39u)
106 
109 #define VS_ATTEN_CONV_NOMIN_MAX22V (200u)
110 #define VS_ATTEN_CONV_DENOM_MAX22V (11u)
111 
114 #define VSD_ATTEN_CONV_NOMIN (1000u)
115 #define VSD_ATTEN_CONV_DENOM (39u)
116 
119 #define VCP_ATTEN_CONV_NOMIN (1000u)
120 #define VCP_ATTEN_CONV_DENOM (23u)
121 
124 #define MON_ATTEN_CONV_NOMIN (1000u)
125 #define MON_ATTEN_CONV_DENOM (39u)
126 
129 #define VDDP_ATTEN_CONV_NOMIN (250u)
130 #define VDDP_ATTEN_CONV_DENOM (41u)
131 
134 #define VAREF_ATTEN_CONV_NOMIN (1000u)
135 #define VAREF_ATTEN_CONV_DENOM (219u)
136 
139 #define VBG_ATTEN_CONV_NOMIN (4u)
140 #define VBG_ATTEN_CONV_DENOM (3u)
141 
144 #define VDDC_ATTEN_CONV_NOMIN (4u)
145 #define VDDC_ATTEN_CONV_DENOM (3u)
146 
148 #define V_TEMP_REF_OFFSET_mV (666u)
149 
151 #define V_TEMP_SCALE_FACT (100u)
152 
155 #define CONV_COEFF_mV_TO_degC (231u)
156 
158 #define ADC2_VBAT (0)
160 #define ADC2_VS (1)
162 #define ADC2_VSD (2)
164 #define ADC2_VCP (3)
166 #define ADC2_MON (4)
168 #define ADC2_VDDP (5)
170 #define ADC2_VAREF (6)
172 #define ADC2_VBG (7)
174 #define ADC2_VDDC (8)
176 #define ADC2_TEMP (9)
177 
178 /*******************************************************************************
179 ** Global Macro Declarations **
180 *******************************************************************************/
181 
182 #if (UC_SERIES == TLE986)
183 #define ADC2_VBat_Attenuator_Range_3_28V (1u)
184 #define ADC2_VBat_Attenuator_Range_3_22V (0u)
185 
199 {
200  Field_Mod32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk, 1u);
201 }
202 
216 {
217  Field_Mod32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk, 0u);
218 }
219 
238 {
239  return ( u8_Field_Rd32(&ADC2->CTRL_STS.reg, ADC2_CTRL_STS_VBAT_RANGE_Pos, ADC2_CTRL_STS_VBAT_RANGE_Msk) );
240 }
241 #endif
242 
243 #define ADC2_VS_Attenuator_Range_3_28V (1u)
244 #define ADC2_VS_Attenuator_Range_3_22V (0u)
245 
259 {
261 }
262 
276 {
278 }
279 
298 {
300 }
301 
302 /* ADC2 Interrupt Clear Macros */
321 {
323 }
324 
343 {
345 }
346 
365 {
367 }
368 
387 {
389 }
390 
409 {
411 }
412 
431 {
433 }
434 
453 {
455 }
456 
475 {
477 }
478 
497 {
499 }
500 
519 {
521 }
522 
523 #if (UC_SERIES == TLE986)
542 {
543  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);
544 }
545 
564 {
565  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);
566 }
567 #endif
568 
569 #if (UC_SERIES == TLE987)
588 {
590 }
591 
610 {
612 }
613 #endif
614 
633 {
635 }
636 
655 {
657 }
658 
659 #if ((ADC2_CTRL2 & (1u << 2u)) == 0u)
660 /* System Temperature Sensor */
679 {
681 }
682 
701 {
703 }
704 #else
705 /* PMU Temperature Sensor */
723 INLINE void ADC2_TEMP_OT_Int_Clr(void)
724 {
726 }
727 
746 {
748 }
749 #endif
750 
751 /* ADC2 Interrupt Enable/Disable Macros */
770 {
772 }
773 
793 {
795 }
796 
815 {
817 }
818 
838 {
840 }
841 
860 {
862 }
863 
883 {
885 }
886 
905 {
907 }
908 
928 {
930 }
931 
950 {
952 }
953 
973 {
975 }
976 
995 {
997 }
998 
1018 {
1020 }
1021 
1040 {
1042 }
1043 
1063 {
1065 }
1066 
1085 {
1087 }
1088 
1108 {
1110 }
1111 
1130 {
1132 }
1133 
1153 {
1155 }
1156 
1175 {
1177 }
1178 
1198 {
1200 }
1201 
1202 #if (UC_SERIES == TLE986)
1221 {
1222  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);
1223 }
1224 
1244 {
1245  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);
1246 }
1247 
1266 {
1267  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);
1268 }
1269 
1289 {
1290  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);
1291 }
1292 #endif
1293 
1294 #if (UC_SERIES == TLE987)
1313 {
1315 }
1316 
1336 {
1338 }
1339 
1358 {
1360 }
1361 
1381 {
1383 }
1384 #endif
1385 
1404 {
1406 }
1407 
1427 {
1429 }
1430 
1449 {
1451 }
1452 
1472 {
1474 }
1475 
1476 #if ((ADC2_CTRL2 & (1u << 2u)) == 0u)
1477 /* System Temperature Sensor */
1496 {
1498 }
1499 
1519 {
1521 }
1522 
1541 {
1543 }
1544 
1564 {
1566 }
1567 #else
1568 /* PMU Temperature Sensor */
1586 INLINE void ADC2_Temp_OT_Int_En(void)
1587 {
1589 }
1590 
1609 INLINE void ADC2_Temp_OT_Int_Dis(void)
1610 {
1612 }
1613 
1631 INLINE void ADC2_Temp_Warn_Int_En(void)
1632 {
1634 }
1635 
1654 INLINE void ADC2_Temp_Warn_Int_Dis(void)
1655 {
1657 }
1658 #endif
1659 
1660 /*******************************************************************************
1661 ** Global Function Declarations **
1662 *******************************************************************************/
1667 void ADC2_Init(void);
1669 #if (UC_SERIES == TLE986)
1671 #endif
1681 
1682 /*******************************************************************************
1683 ** Global Inline Function Definitions **
1684 *******************************************************************************/
1704 {
1705  const volatile uint32 *pBaseAddr;
1706  uint16 Var;
1707  uint32 addr;
1708  uint16 idx;
1709 
1710  if ((uint8)ADC2_TEMP >= channel)
1711  {
1712  /* violation: intended cast from pointer to unsigned int [MISRA Rule 45]*/
1713  addr = (uint32)&ADC2->FILT_OUT0.reg;
1714  /* calculate address offset corresponding to the input channel number */
1715  idx = (uint16)((uint16)channel << 2u);
1716  addr += idx;
1717  /* violation: intended cast from unsigned int to pointer [MISRA Rule 45]*/
1718  pBaseAddr = (volatile uint32 *) addr;
1719  /* read the 10 LSbit of the ADC FILT_OUTx register */
1720  Var = (uint16)((*pBaseAddr) & (uint32)0x000003FF);
1721  }
1722  else
1723  {
1724  Var = 0;
1725  }
1726 
1727  return (Var);
1728 } /* End of ADC2_GetChResult */
1729 #if (UC_SERIES == TLE986)
1752 {
1753  uint16 value;
1754  value = ADC2_GetChResult(ADC2_VBAT);
1755 
1757  {
1758  /* Conversion for VBat attenuator range up to 28 V same as for VS */
1760  }
1761  else
1762  {
1763  /* Conversion for VBat attenuator range up to 22 V same as for VS */
1765  }
1766 
1767  return (value);
1768 }
1769 #endif
1792 {
1793  uint16 value;
1794  value = ADC2_GetChResult(ADC2_VS);
1795 
1797  {
1798  /* Conversion for VS attenuator range up to 28 V */
1800  }
1801  else
1802  {
1803  /* Conversion for VS attenuator range up to 22 V */
1805  }
1806 
1807  return (value);
1808 }
1828 {
1829  uint16 value;
1830  value = ADC2_GetChResult(ADC2_VSD);
1831  /* Conversion for VSD attenuator (attenuator 0.039 = 39/1000) */
1833  return (value);
1834 }
1854 {
1855  uint16 value;
1856  value = ADC2_GetChResult((uint8)ADC2_VCP);
1857  /* Conversion for VCP attenuator (attenuator 0.023 = 23/1000) */
1859  return (value);
1860 }
1861 
1881 {
1882  uint16 value;
1883  value = ADC2_GetChResult((uint8)ADC2_MON);
1884  /* Conversion for MON attenuator (attenuator 0.039 = 39/1000) */
1886  return (value);
1887 }
1888 
1908 {
1909  uint16 value;
1910  value = ADC2_GetChResult((uint8)ADC2_VDDP);
1911  /* Conversion for VDDP attenuator (attenuator 0.164 = 41/250) */
1913  return (value);
1914 }
1915 
1935 {
1936  uint16 value;
1937  value = ADC2_GetChResult((uint8)ADC2_VAREF);
1938  /* Conversion for VAREF attenuator (attenuator 0.219 = 219/1000) */
1940  return (value);
1941 }
1942 
1962 {
1963  uint16 value;
1964  value = ADC2_GetChResult((uint8)ADC2_VBG);
1965  /* Conversion for VBG attenuator (attenuator 0.75 = 3/4) */
1967  return (value);
1968 }
1969 
1989 {
1990  uint16 value;
1991  value = ADC2_GetChResult((uint8)ADC2_VDDC);
1992  /* Conversion for VDDC attenuator (attenuator 0.75 = 3/4) */
1994  return (value);
1995 }
1996 
2017 {
2018  uint16 value;
2019  uint16 V_Temp_mV;
2020  sint16 Temperature;
2021  value = ADC2_GetChResult((uint8)ADC2_TEMP);
2022  /* Conversion for Temperature in deg C:
2023  Step 1: Calculate V_Temp(T)(mV): */
2024  V_Temp_mV = (uint16)(((uint32)value * (uint32)ADC2_VREF_mV) / (uint16)1023);
2025  /* Step 2: Conversion from V_Temp(T)(mV) to Temperature in deg C */
2027  /* return the calculated Temperature in deg C */
2028  return (Temperature);
2029 }
2030 
2031 #endif
INLINE void ADC2_VDDP_OV_Int_Dis(void)
disables VDDP Overvoltage interrupt.
Definition: adc2.h:882
INLINE void ADC2_VDDP_UV_Int_En(void)
enables VDDP Undervoltage interrupt.
Definition: adc2.h:904
INLINE uint16 ADC2_VAREF_Result_mV(void)
returns the Voltage of the VAREF line (ADC2 Channel 6) in millivolt (mV)
Definition: adc2.h:1934
#define VS_ATTEN_CONV_NOMIN_MAX28V
Nominator and Denominator of Attenuator Conversion formula for VS: attenuator for VS Range 0....
Definition: adc2.h:104
INLINE void ADC2_Temp_Warn_Int_Dis(void)
disables System Overtemperature Prewarning interrupt.
Definition: adc2.h:1563
#define V_TEMP_REF_OFFSET_mV
Offset of V_Temp (mV) corresponding to 0 °C reference.
Definition: adc2.h:148
INLINE void ADC2_VSD_OV_Int_En(void)
enables Driver Supply MU High interrupt.
Definition: adc2.h:1039
INLINE void ADC2_VDDP_UV_Int_Dis(void)
disables VDDP Undervoltage interrupt.
Definition: adc2.h:927
#define VDDP_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VDDP: attenuator for VDDP is 0....
Definition: adc2.h:129
INLINE uint16 ADC2_MON_Result_mV(void)
returns the Voltage of the MON line (ADC2 Channel 4) in millivolt (mV)
Definition: adc2.h:1880
INLINE uint16 ADC2_VDDP_Result_mV(void)
returns the Voltage of the VDDP line (ADC2 Channel 5) in millivolt (mV)
Definition: adc2.h:1907
#define VBG_ATTEN_CONV_DENOM
Definition: adc2.h:140
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:198
INLINE void ADC2_TEMP_WARN_Int_Clr(void)
clears System Overtemperature Prewarning Interrupt Status.
Definition: adc2.h:700
#define V_TEMP_SCALE_FACT
Scaling factor for V_Temp (mV)
Definition: adc2.h:151
INLINE void ADC2_VDDC_OV_Int_En(void)
enables VDDC Overvoltage interrupt.
Definition: adc2.h:949
#define MON_ATTEN_CONV_DENOM
Definition: adc2.h:125
INLINE void ADC2_VBAT_OV_Int_Dis(void)
disables VBAT Overvoltage Interrupt.
Definition: adc2.h:1243
INLINE void ADC2_Temp_OT_Int_Dis(void)
disables System Overtemperature Shutdown interrupt.
Definition: adc2.h:1518
#define ADC2_VBAT
ADC2 channel selection macro, channel 0 - VBAT.
Definition: adc2.h:158
INLINE void ADC2_VDDP_OV_Int_En(void)
enables VDDP Overvoltage interrupt.
Definition: adc2.h:859
#define VDDC_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VDDC: attenuator for VDDC is 0....
Definition: adc2.h:144
INLINE uint16 ADC2_GetChResult(uint8 channel)
Returns the 10 bit wide result of the selected ADC2 channel.
Definition: adc2.h:1703
INLINE uint16 ADC2_VS_Result_mV(void)
returns the Voltage of the VS line (ADC2 Channel 1) in millivolt (mV)
Definition: adc2.h:1791
INLINE void ADC2_VSD_UV_Int_En(void)
enables Driver Supply MU Low interrupt.
Definition: adc2.h:1084
INLINE void ADC2_VBAT_UV_Int_En(void)
enables VBAT Undervoltage Interrupt.
Definition: adc2.h:1265
INLINE void ADC2_MON_UV_Int_Clr(void)
clears MON Undervoltage Interrupt Status.
Definition: adc2.h:609
#define VS_ATTEN_CONV_DENOM_MAX22V
Definition: adc2.h:110
#define VS_ATTEN_CONV_DENOM_MAX28V
Definition: adc2.h:105
INLINE void ADC2_VDDC_UV_Int_Clr(void)
clears VDDC Undervoltage Interrupt Status.
Definition: adc2.h:430
INLINE uint16 ADC2_VBG_Result_mV(void)
returns the Voltage of the VBG line (ADC2 Channel 7) in millivolt (mV)
Definition: adc2.h:1961
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:1751
INLINE void ADC2_VCP_OV_Int_En(void)
enables Charge Pump MU High interrupt.
Definition: adc2.h:1129
INLINE void ADC2_TEMP_OT_Int_Clr(void)
clears System Overtemperature Shutdown Interrupt Status.
Definition: adc2.h:678
INLINE void ADC2_MON_OV_Int_En(void)
enables MON Overvoltage Interrupt.
Definition: adc2.h:1312
INLINE void ADC2_MON_UV_Int_En(void)
enables MON Undervoltage Interrupt.
Definition: adc2.h:1357
#define VDDC_ATTEN_CONV_DENOM
Definition: adc2.h:145
#define VCP_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VCP: attenuator for VCP is 0....
Definition: adc2.h:119
INLINE void ADC2_VDDC_UV_Int_Dis(void)
disables VDDC Undervoltage interrupt.
Definition: adc2.h:1017
INLINE void ADC2_VCP_OV_Int_Dis(void)
disables Charge Pump MU High interrupt.
Definition: adc2.h:1152
INLINE void ADC2_VCP_UV_Int_Dis(void)
disables Charge Pump MU Low interrupt.
Definition: adc2.h:1197
INLINE void ADC2_Temp_OT_Int_En(void)
enables System Overtemperature Shutdown interrupt.
Definition: adc2.h:1495
INLINE sint16 ADC2_Temp_Result_C(void)
Returns the Temperature read by the ADC2 Channel 9 in degrees Celsius (°C).
Definition: adc2.h:2016
#define VSD_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VSD: attenuator for VSD is 0....
Definition: adc2.h:114
#define VBG_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VBG: attenuator for VBG is 0....
Definition: adc2.h:139
INLINE uint16 ADC2_VDDC_Result_mV(void)
returns the Voltage of the VDDC line (ADC2 Channel 8) in millivolt (mV)
Definition: adc2.h:1988
#define ADC2_VS_Attenuator_Range_3_28V
Definition: adc2.h:243
INLINE uint16 ADC2_VSD_Result_mV(void)
returns the Voltage of the VSD line (ADC2 Channel 2) in millivolt
Definition: adc2.h:1827
INLINE void ADC2_VDDC_OV_Int_Clr(void)
clears VDDC Overvoltage Interrupt Status.
Definition: adc2.h:408
#define CONV_COEFF_mV_TO_degC
Conversion coefficient from V_Temp (mV) to Temperature (°C) multiplied by V_TEMP_SCALE_FACT.
Definition: adc2.h:155
INLINE void ADC2_VBG_OV_Int_Clr(void)
clears 8 Bit ADC2 Reference Overvoltage Interrupt Status.
Definition: adc2.h:632
INLINE void ADC2_VS_UV_Int_Clr(void)
clears VS Undervoltage Interrupt Status.
Definition: adc2.h:342
INLINE void ADC2_MON_UV_Int_Dis(void)
disables MON Undervoltage Interrupt.
Definition: adc2.h:1380
#define VS_ATTEN_CONV_NOMIN_MAX22V
Nominator and Denominator of Attenuator Conversion formula for VS: attenuator for VS Range 0....
Definition: adc2.h:109
#define VAREF_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for VAREF: attenuator for VAREF is 0....
Definition: adc2.h:134
#define VCP_ATTEN_CONV_DENOM
Definition: adc2.h:120
#define ADC2_VS
ADC2 channel selection macro, channel 1 - VS.
Definition: adc2.h:160
#define VSD_ATTEN_CONV_DENOM
Definition: adc2.h:115
INLINE void ADC2_VSD_OV_Int_Clr(void)
clears Driver Supply MU High Interrupt Status.
Definition: adc2.h:452
#define ADC2_VAREF
ADC2 channel selection macro, channel 6 - VAREF.
Definition: adc2.h:170
INLINE void ADC2_VDDP_OV_Int_Clr(void)
clears VDDP Overvoltage Interrupt Status.
Definition: adc2.h:364
INLINE void ADC2_VBG_OV_Int_En(void)
enables 8 Bit ADC2 Reference Overvoltage interrupt.
Definition: adc2.h:1403
INLINE uint16 ADC2_VCP_Result_mV(void)
returns the Voltage of the VCP line (ADC2 Channel 3) in millivolt (mV)
Definition: adc2.h:1853
INLINE void ADC2_Temp_Warn_Int_En(void)
enables System Overtemperature Prewarning interrupt.
Definition: adc2.h:1540
INLINE void ADC2_VSD_UV_Int_Dis(void)
disables Driver Supply MU Low interrupt.
Definition: adc2.h:1107
INLINE void ADC2_VBG_UV_Int_Clr(void)
clears 8 Bit ADC2 Reference Undervoltage Interrupt Status.
Definition: adc2.h:654
INLINE uint8 ADC2_VS_Attenuator_Range_Get(void)
gets ADC2 Channel 1 (VS) Attenuator Range.
Definition: adc2.h:297
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:215
INLINE void ADC2_VBAT_UV_Int_Dis(void)
disables VBAT Undervoltage Interrupt.
Definition: adc2.h:1288
#define ADC2_VREF_mV
ADC2 (1.211 V) in millivolts.
Definition: adc2.h:98
INLINE void ADC2_VBG_UV_Int_En(void)
enables 8 Bit ADC2 Reference Undervoltage interrupt.
Definition: adc2.h:1448
INLINE void ADC2_VS_UV_Int_Dis(void)
disables VS Undervoltage interrupt.
Definition: adc2.h:837
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:275
INLINE void ADC2_VS_OV_Int_Clr(void)
clears VS Overvoltage Interrupt Status.
Definition: adc2.h:320
INLINE void ADC2_VBAT_UV_Int_Clr(void)
clears VBAT Undervoltage Interrupt Status.
Definition: adc2.h:563
INLINE void ADC2_VBG_OV_Int_Dis(void)
disables 8 Bit ADC2 Reference Overvoltage interrupt.
Definition: adc2.h:1426
INLINE void ADC2_VS_OV_Int_Dis(void)
disables VS Overvoltage interrupt.
Definition: adc2.h:792
INLINE void ADC2_VCP_UV_Int_Clr(void)
clears Charge Pump MU Low Interrupt Status.
Definition: adc2.h:518
#define ADC2_VDDC
ADC2 channel selection macro, channel 8 - VDDC.
Definition: adc2.h:174
INLINE void ADC2_VBAT_OV_Int_En(void)
enables VBAT Overvoltage Interrupt.
Definition: adc2.h:1220
#define ADC2_VBG
ADC2 channel selection macro, channel 7 - VBG.
Definition: adc2.h:172
#define MON_ATTEN_CONV_NOMIN
Nominator and Denominator of Attenuator Conversion formula for MON: attenuator for MON is 0....
Definition: adc2.h:124
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:1062
INLINE void ADC2_MON_OV_Int_Clr(void)
clears MON Overvoltage Interrupt Status.
Definition: adc2.h:587
#define ADC2_MON
ADC2 channel selection macro, channel 4 - MON.
Definition: adc2.h:166
INLINE void ADC2_MON_OV_Int_Dis(void)
disables MON Overvoltage Interrupt.
Definition: adc2.h:1335
#define ADC2_FILTOUT_MAX
ADC2 Filtered output register maximum value.
Definition: adc2.h:100
INLINE void ADC2_VDDC_UV_Int_En(void)
enables VDDC Undervoltage interrupt.
Definition: adc2.h:994
#define VDDP_ATTEN_CONV_DENOM
Definition: adc2.h:130
#define ADC2_VCP
ADC2 channel selection macro, channel 3 - VCP.
Definition: adc2.h:164
#define VAREF_ATTEN_CONV_DENOM
Definition: adc2.h:135
INLINE void ADC2_VBAT_OV_Int_Clr(void)
clears VBAT Overvoltage Interrupt Status.
Definition: adc2.h:541
INLINE uint8 ADC2_VBat_Attenuator_Range_Get(void)
gets ADC2 Channel 0 (VBat) Attenuator Range.
Definition: adc2.h:237
INLINE void ADC2_VCP_UV_Int_En(void)
enables Charge Pump MU Low interrupt.
Definition: adc2.h:1174
#define ADC2_VSD
ADC2 channel selection macro, channel 2 - VSD.
Definition: adc2.h:162
INLINE void ADC2_VCP_OV_Int_Clr(void)
clears Charge Pump MU High Interrupt Status.
Definition: adc2.h:496
INLINE void ADC2_VS_OV_Int_En(void)
enables VS Overvoltage interrupt.
Definition: adc2.h:769
INLINE void ADC2_VSD_UV_Int_Clr(void)
clears Driver Supply MU Low interrupt flag.
Definition: adc2.h:474
INLINE void ADC2_VBG_UV_Int_Dis(void)
disables 8 Bit ADC2 Reference Undervoltage interrupt.
Definition: adc2.h:1471
#define ADC2_VDDP
ADC2 channel selection macro, channel 5 - VDDP.
Definition: adc2.h:168
INLINE void ADC2_VS_UV_Int_En(void)
enables VS Undervoltage interrupt.
Definition: adc2.h:814
INLINE void ADC2_VDDP_UV_Int_Clr(void)
clears VDDP Undervoltage Interrupt Status.
Definition: adc2.h:386
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:258
#define ADC2_TEMP
ADC2 channel selection macro, channel 9 - TEMP.
Definition: adc2.h:176
INLINE void ADC2_VDDC_OV_Int_Dis(void)
disables VDDC Overvoltage interrupt.
Definition: adc2.h:972
#define SCUPM
Definition: tle987x.h:6072
#define ADC2
Definition: tle987x.h:6058
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_OV_IE_Pos
Definition: tle987x.h:9758
#define SCUPM_BDRV_IRQ_CTRL_VSD_UPTH_IE_Msk
Definition: tle987x.h:9408
#define SCUPM_SYS_IRQ_CTRL_PMU_OT_IE_Pos
Definition: tle987x.h:9598
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_UV_IE_Pos
Definition: tle987x.h:9764
#define SCUPM_SYS_IRQ_CTRL_SYS_OTWARN_IE_Pos
Definition: tle987x.h:9596
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_OV_IE_Msk
Definition: tle987x.h:9755
#define SCUPM_SYS_IRQ_CTRL_PMU_OTWARN_IE_Pos
Definition: tle987x.h:9600
#define SCUPM_BDRV_IRQ_CTRL_VSD_LOWTH_IE_Pos
Definition: tle987x.h:9409
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_UV_IE_Pos
Definition: tle987x.h:9762
#define SCUPM_BDRV_IRQ_CTRL_VCP_LOWTH1_IE_Msk
Definition: tle987x.h:9414
#define SCUPM_SYS_ISCLR_PMU_OT_ICLR_Pos
Definition: tle987x.h:9708
#define SCUPM_SYS_IRQ_CTRL_PMU_OTWARN_IE_Msk
Definition: tle987x.h:9601
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_OV_IE_Pos
Definition: tle987x.h:9752
#define SCUPM_SYS_ISCLR_REFBG_LOTHWARN_ICLR_Msk
Definition: tle987x.h:9703
#define SCUPM_BDRV_ISCLR_VSD_UPTH_ICLR_Pos
Definition: tle987x.h:9497
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_UV_ICLR_Msk
Definition: tle987x.h:9750
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_UV_IE_Msk
Definition: tle987x.h:9763
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_UV_IE_Pos
Definition: tle987x.h:9766
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_UV_ICLR_Pos
Definition: tle987x.h:9745
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_UV_IE_Pos
Definition: tle987x.h:9760
#define SCUPM_BDRV_ISCLR_VCP_UPTH_ICLR_Pos
Definition: tle987x.h:9501
#define SCUPM_SYS_IRQ_CTRL_PMU_OT_IE_Msk
Definition: tle987x.h:9599
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_OV_ICLR_Pos
Definition: tle987x.h:9735
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_OV_ICLR_Pos
Definition: tle987x.h:9737
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_OV_IE_Msk
Definition: tle987x.h:9753
#define SCUPM_BDRV_IRQ_CTRL_VCP_UPTH_IE_Msk
Definition: tle987x.h:9412
#define SCUPM_SYS_ISCLR_REFBG_UPTHWARN_ICLR_Pos
Definition: tle987x.h:9700
#define SCUPM_BDRV_ISCLR_VSD_LOWTH_ICLR_Pos
Definition: tle987x.h:9499
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_UV_ICLR_Msk
Definition: tle987x.h:9744
#define SCUPM_SYS_IRQ_CTRL_SYS_OT_IE_Pos
Definition: tle987x.h:9594
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD5V_OV_IE_Pos
Definition: tle987x.h:9754
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_OV_ICLR_Msk
Definition: tle987x.h:9738
#define SCUPM_SYS_IRQ_CTRL_SYS_OTWARN_IE_Msk
Definition: tle987x.h:9597
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_UV_ICLR_Msk
Definition: tle987x.h:9748
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VDD1V5_UV_IE_Msk
Definition: tle987x.h:9761
#define ADC2_CTRL_STS_VS_RANGE_Pos
Definition: tle987x.h:6548
#define SCUPM_SYS_IRQ_CTRL_SYS_OT_IE_Msk
Definition: tle987x.h:9595
#define SCUPM_BDRV_IRQ_CTRL_VCP_LOWTH1_IE_Pos
Definition: tle987x.h:9413
#define SCUPM_BDRV_ISCLR_VCP_UPTH_ICLR_Msk
Definition: tle987x.h:9502
#define SCUPM_SYS_ISCLR_SYS_OTWARN_ICLR_Pos
Definition: tle987x.h:9706
#define SCUPM_BDRV_ISCLR_VCP_LOWTH1_ICLR_Msk
Definition: tle987x.h:9504
#define SCUPM_SYS_ISCLR_REFBG_UPTHWARN_ICLR_Msk
Definition: tle987x.h:9701
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_UV_IE_Msk
Definition: tle987x.h:9767
#define SCUPM_BDRV_IRQ_CTRL_VCP_UPTH_IE_Pos
Definition: tle987x.h:9411
#define SCUPM_SYS_ISCLR_REFBG_LOTHWARN_ICLR_Pos
Definition: tle987x.h:9702
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_UV_ICLR_Pos
Definition: tle987x.h:9743
#define SCUPM_SYS_IRQ_CTRL_REFBG_LOTHWARN_IE_Pos
Definition: tle987x.h:9592
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_OV_ICLR_Msk
Definition: tle987x.h:9742
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_MON_OV_IE_Msk
Definition: tle987x.h:9759
#define SCUPM_SYS_IRQ_CTRL_REFBG_UPTHWARN_IE_Msk
Definition: tle987x.h:9591
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_OV_IE_Msk
Definition: tle987x.h:9757
#define SCUPM_SYS_IRQ_CTRL_REFBG_LOTHWARN_IE_Msk
Definition: tle987x.h:9593
#define SCUPM_BDRV_ISCLR_VSD_LOWTH_ICLR_Msk
Definition: tle987x.h:9500
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD1V5_OV_ICLR_Msk
Definition: tle987x.h:9736
#define SCUPM_SYS_ISCLR_SYS_OT_ICLR_Msk
Definition: tle987x.h:9705
#define SCUPM_SYS_ISCLR_PMU_OTWARN_ICLR_Pos
Definition: tle987x.h:9710
#define SCUPM_BDRV_IRQ_CTRL_VSD_UPTH_IE_Pos
Definition: tle987x.h:9407
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_OV_ICLR_Msk
Definition: tle987x.h:9740
#define SCUPM_BDRV_IRQ_CTRL_VSD_LOWTH_IE_Msk
Definition: tle987x.h:9410
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_UV_ICLR_Pos
Definition: tle987x.h:9747
#define SCUPM_SYS_ISCLR_PMU_OT_ICLR_Msk
Definition: tle987x.h:9709
#define SCUPM_SYS_ISCLR_SYS_OT_ICLR_Pos
Definition: tle987x.h:9704
#define SCUPM_SYS_IRQ_CTRL_REFBG_UPTHWARN_IE_Pos
Definition: tle987x.h:9590
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_OV_ICLR_Pos
Definition: tle987x.h:9741
#define SCUPM_SYS_ISCLR_PMU_OTWARN_ICLR_Msk
Definition: tle987x.h:9711
#define SCUPM_BDRV_ISCLR_VCP_LOWTH1_ICLR_Pos
Definition: tle987x.h:9503
#define ADC2_CTRL_STS_VS_RANGE_Msk
Definition: tle987x.h:6549
#define SCUPM_SYS_SUPPLY_IRQ_CLR_MON_UV_ICLR_Pos
Definition: tle987x.h:9749
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_UV_IE_Msk
Definition: tle987x.h:9765
#define SCUPM_BDRV_ISCLR_VSD_UPTH_ICLR_Msk
Definition: tle987x.h:9498
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VDD5V_UV_ICLR_Msk
Definition: tle987x.h:9746
#define SCUPM_SYS_ISCLR_SYS_OTWARN_ICLR_Msk
Definition: tle987x.h:9707
#define SCUPM_SYS_SUPPLY_IRQ_CLR_VS_OV_ICLR_Pos
Definition: tle987x.h:9739
#define SCUPM_SYS_SUPPLY_IRQ_CTRL_VS_OV_IE_Pos
Definition: tle987x.h:9756
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:347
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:332
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:407
CMSIS register HeaderFile.
Device specific memory layout defines.
General type declarations.
#define INLINE
Definition: types.h:132
uint8_t uint8
8 bit unsigned value
Definition: types.h:137
int16_t sint16
16 bit signed value
Definition: types.h:143
uint16_t uint16
16 bit unsigned value
Definition: types.h:138
uint32_t uint32
32 bit unsigned value
Definition: types.h:139