iLLD_TC27xD  1.0
IfxDts.h
Go to the documentation of this file.
1 /**
2  * \file IfxDts.h
3  * \brief DTS basic functionality
4  * \ingroup IfxLld_Dts
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  * \defgroup IfxLld_Dts_Std_Control Control functions
25  * \ingroup IfxLld_Dts_Std
26  * \defgroup IfxLld_Dts_Std_Status Status functions
27  * \ingroup IfxLld_Dts_Std
28  */
29 
30 #ifndef IFXDTS_H
31 #define IFXDTS_H 1
32 
33 /******************************************************************************/
34 /*----------------------------------Includes----------------------------------*/
35 /******************************************************************************/
36 
37 #include "_Impl/IfxDts_cfg.h"
38 #include "IfxScu_reg.h"
39 #include "IfxScu_bf.h"
41 #include "Src/Std/IfxSrc.h"
42 /** \addtogroup IfxLld_Dts_Std_Control
43  * \{ */
44 
45 /******************************************************************************/
46 /*-------------------------Inline Function Prototypes-------------------------*/
47 /******************************************************************************/
48 
49 /** \brief Disable the writing of register bits except START bit.
50  * \return None
51  */
53 
54 /** \brief Enables the DTS sensor
55  * \return None
56  */
58 
59 /** \brief Starts the next temperature measurement.
60  * \return None
61  */
63 
64 /** \} */
65 
66 /** \addtogroup IfxLld_Dts_Std_Status
67  * \{ */
68 
69 /******************************************************************************/
70 /*-------------------------Inline Function Prototypes-------------------------*/
71 /******************************************************************************/
72 
73 /** \brief Gets the Interrupt request source.
74  * \return Address of interrupt request source
75  */
76 IFX_INLINE volatile Ifx_SRC_SRCR *IfxDts_getSrcPointer(void);
77 
78 /** \brief Read the temperature measurement result
79  * \return Temperature measurement result
80  */
82 
83 /** \brief Returns the current BUSY status of the Sensor
84  * \return TRUE if Sensor is busy in measuring temperature otherwise FALSE
85  */
86 IFX_INLINE boolean IfxDts_isBusy(void);
87 
88 /** \} */
89 
90 /******************************************************************************/
91 /*-------------------------Global Function Prototypes-------------------------*/
92 /******************************************************************************/
93 
94 /** \brief Returns the current READY status of the Sensor.
95  * \return TRUE if Sensor is ready for measuring temperature otherwise FALSE
96  */
97 IFX_EXTERN boolean IfxDts_isReady(void);
98 
99 /******************************************************************************/
100 /*---------------------Inline Function Implementations------------------------*/
101 /******************************************************************************/
102 
104 {
105  MODULE_SCU.DTSCON.B.SLCK = 1;
106  MODULE_SCU.DTSLIM.B.SLCK = 1;
107 }
108 
109 
111 {
112  MODULE_SCU.DTSCON.B.PWD = 0;
113 }
114 
115 
116 IFX_INLINE volatile Ifx_SRC_SRCR *IfxDts_getSrcPointer(void)
117 {
118  return &SRC_SCUDTS;
119 }
120 
121 
123 {
124  return (uint16)MODULE_SCU.DTSSTAT.B.RESULT;
125 }
126 
127 
129 {
130  return MODULE_SCU.DTSSTAT.B.BUSY == 1 ? TRUE : FALSE;
131 }
132 
133 
135 {
136  MODULE_SCU.DTSCON.B.START = 1;
137 }
138 
139 
140 #endif /* IFXDTS_H */