AM261x MCU+ SDK: sdl_ip_vtm.h Source File

| AM261x MCU+ SDK 26.00.00 |

sdl_ip_vtm.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2023-2025 Texas Instruments Incorporated.
3 *
4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions
6 * are met:
7 *
8 * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 *
11 * Redistributions in binary form must reproduce the above copyright
12 * notice, this list of conditions and the following disclaimer in the
13 * documentation and/or other materials provided with the
14 * distribution.
15 *
16 * Neither the name of Texas Instruments Incorporated nor the names of
17 * its contributors may be used to endorse or promote products derived
18 * from this software without specific prior written permission.
19 *
20 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31 *
32 */
33
34 #ifndef SDL_IP_VTM_H
35 #define SDL_IP_VTM_H
36
37 #ifdef __cplusplus
38 extern "C" {
39 #endif
40
41 #include <stdint.h>
42 #include <stdbool.h>
43 #include <sdl/vtm/v1/sdlr_vtm.h>
44 #if defined (SOC_AM261X)
45 #include <sdl/vtm/v1/soc/am261x/sdl_soc_vtm.h>
46 #elif defined (SOC_AM263PX)
47 #include <sdl/vtm/v1/soc/am263px/sdl_soc_vtm.h>
48 #endif
49
50
71 typedef uint8_t SDL_VTM_configVdCtrl;
72 #define SDL_VTM_VD_CONFIG_CTRL_VID_OPP (1U)
73 #define SDL_VTM_VD_CONFIG_CTRL_EVT_SEL (2U)
74 #define SDL_VTM_VD_CONFIG_CTRL_GLB_CFG (4U)
75
76
83 typedef uint8_t SDL_VTM_configTsCtrl;
84 #define SDL_VTM_VD_CONFIG_CTRL_SET_CTL (1U)
85 #define SDL_VTM_VD_CONFIG_CTRL_OUTRNG_ALRT (2U)
86 #define SDL_VTM_VD_CONFIG_CTRL_SET_THR (4U)
87
88
97 #define SDL_VTM_BGR_OFF 0x1U
98 #define SDL_VTM_BGR_ON 0x0U
99
100 #define SDL_VTM_AIP_OFF 0x1U
101 #define SDL_VTM_AIP_ON 0x0U
102
103 #define SDL_VTM_TMPSOFF_OFF 0x1U
104 #define SDL_VTM_TMPSOFF_ON 0x0U
105
106 #define SDL_VTM_MUX_HIZ 0x1U
107 #define SDL_VTM_NORMAL_HIZ 0x0U
108
109 #define SDL_VTM_SENSOR_SEL0 (1U << 0U)
110 #define SDL_VTM_SENSOR_SEL1 (1U << 1U)
111 #define SDL_VTM_SENSOR_SEL2 (1U << 2U)
112 #define SDL_VTM_SENSOR_SEL3 (1U << 3U)
113
114 #define SDL_VTM_TSENSE_EN 0x1U
115 #define SDL_VTM_TSENSE_DIS 0x0U
116
117 #define SDL_VTM_TSENSE0_LOW_TH_FLAG (1U << 0U)
118 #define SDL_VTM_TSENSE0_HOT_FLAG (1U << 2U)
119 #define SDL_VTM_TSENSE0_COLD_FLAG (1U << 1U)
120 #define SDL_VTM_TSENSE1_LOW_TH_FLAG (1U << 4U)
121 #define SDL_VTM_TSENSE1_HOT_FLAG (1U << 6U)
122 #define SDL_VTM_TSENSE1_COLD_FLAG (1U << 5U)
123
124 #define SDL_VTM_OVERRIDE_PATTERN 0x7U
125
126 #define SDL_VTM_MASK_LOW_TH (1U)
127 #define SDL_VTM_MASK_COLD (1U)
128 #define SDL_VTM_MASK_HOT (1U)
129
130
131 #define SDL_VTM_FREEZE_FIFO 1U
132 #define SDL_VTM_CLR_FIFO 1U
133 #define SDL_VTM_CLR_ACCU 1U
134
135 #define SDL_VTM_BUF_NUM0 0U
136 #define SDL_VTM_BUF_NUM1 1U
137 #define SDL_VTM_BUF_NUM2 2U
138 #define SDL_VTM_BUF_NUM3 3U
139
140 #define SDL_VTM_TSENSE_OFF 0U
141 #define SDL_VTM_TSENSE_ON 1U
142
143 #define SDL_VTM_MAXDELAY 0x2FU
144
153 typedef int16_t SDL_VTM_adc_code;
154
161 typedef struct
162 {
164 uint8_t s1HotEvent;
166 uint8_t s1ColdEvent;
168 uint8_t s1LowThresholdEvent;
170 uint8_t s0HotEvent;
172 uint8_t s0ColdEvent;
174 uint8_t s0LowThresholdEvent;
175 } SDL_VTM_Stat_val;
176
193 SDL_VTM_adc_code SDL_VTM_getAdcCode(SDL_VTM_InstTs instance);
194
207 int32_t SDL_VTM_tsGetCtrl (SDL_VTM_InstTs instance,
208 uint32_t *pTsCtrlCfg);
209
221 int32_t SDL_VTM_tsConvADCToTemp (SDL_VTM_adc_code adcCode,
222 int32_t *pMilliDegreeTempVal);
223
234 int32_t SDL_VTM_tsConvTempToAdc (int32_t milliDegreeTempVal,
235 SDL_VTM_adc_code *pAdcCode);
236
237
240 #ifdef __cplusplus
241 }
242 #endif /* extern "C" */
243 #endif /* end of SDL_IP_VTM_H definition */
SDL_VTM_Stat_val::s1ColdEvent
uint8_t s1ColdEvent
Definition: sdl_ip_vtm.h:166
SDL_VTM_InstTs
SDL_VTM_InstTs
Definition: sdl_soc_vtm.h:54
SDL_VTM_configTsCtrl
uint8_t SDL_VTM_configTsCtrl
This enumerator define for VTM TS configuration valid map.
Definition: sdl_ip_vtm.h:83
sdlr_vtm.h
SDL_VTM_tsGetCtrl
int32_t SDL_VTM_tsGetCtrl(SDL_VTM_InstTs instance, uint32_t *pTsCtrlCfg)
Read VTM Temperature Sensor Control.
SDL_VTM_Stat_val::s0LowThresholdEvent
uint8_t s0LowThresholdEvent
Definition: sdl_ip_vtm.h:174
SDL_VTM_tsConvTempToAdc
int32_t SDL_VTM_tsConvTempToAdc(int32_t milliDegreeTempVal, SDL_VTM_adc_code *pAdcCode)
VTM Temperature to ADC code conversion.
SDL_VTM_Stat_val::s1HotEvent
uint8_t s1HotEvent
Definition: sdl_ip_vtm.h:164
SDL_VTM_Stat_val::s0HotEvent
uint8_t s0HotEvent
Definition: sdl_ip_vtm.h:170
sdl_soc_vtm.h
SDL_VTM_adc_code
int16_t SDL_VTM_adc_code
This typedef for VTM temperature sensor ADC code This is the data_out value of the temperature sensor...
Definition: sdl_ip_vtm.h:153
SDL_VTM_Stat_val::s0ColdEvent
uint8_t s0ColdEvent
Definition: sdl_ip_vtm.h:172
SDL_VTM_Stat_val::s1LowThresholdEvent
uint8_t s1LowThresholdEvent
Definition: sdl_ip_vtm.h:168
SDL_VTM_tsConvADCToTemp
int32_t SDL_VTM_tsConvADCToTemp(SDL_VTM_adc_code adcCode, int32_t *pMilliDegreeTempVal)
VTM Temperature ADC code to Temperature conversion.
SDL_VTM_Stat_val
VTM temperature sensor Stat values.
Definition: sdl_ip_vtm.h:162
SDL_VTM_getAdcCode
SDL_VTM_adc_code SDL_VTM_getAdcCode(SDL_VTM_InstTs instance)
read Temperature sensor ADC code
SDL_VTM_configVdCtrl
uint8_t SDL_VTM_configVdCtrl
This enumerator define for VTM VD configuration valid map.
Definition: sdl_ip_vtm.h:71