AM263Px MCU+ SDK: sdl_vtm.h Source File

| AM263Px MCU+ SDK 26.00.00 |

sdl_vtm.h
Go to the documentation of this file.
1 /*
2 * Copyright (C) 2024 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 #ifndef SDL_IP_VTM_TOP_H_
34 #define SDL_IP_VTM_TOP_H_
35
36 #ifdef __cplusplus
37 extern "C" {
38 #endif
39
40 #include <sdl/vtm/v1/soc/sdl_soc_vtm.h>
41 #include <sdl/vtm/v1/sdl_ip_vtm.h>
42
67 typedef struct
68 {
70 uint8_t cfgTs0Tshut;
72 uint8_t cfgTs0Alert;
74 int32_t ts0_ts_hot_temp_in_milli_degree_celsius;
76 int32_t ts0_ts_cold_temp_in_milli_degree_celsius;
78 int32_t ts0_alert_hot_temp_in_milli_degree_celsius;
80 int32_t ts0_alert_cold_temp_in_milli_degree_celsius;
82 uint8_t cfgTs1Tshut;
84 uint8_t cfgTs1Alert;
86 int32_t ts1_ts_hot_temp_in_milli_degree_celsius;
88 int32_t ts1_ts_cold_temp_in_milli_degree_celsius;
90 int32_t ts1_alert_hot_temp_in_milli_degree_celsius;
92 int32_t ts1_alert_cold_temp_in_milli_degree_celsius;
93
94 } SDL_VTM_configTs;
95
104 typedef struct
105 {
106 uint32_t vtm_ts_th2;
107 uint32_t vtm_ts_cfg;
108 uint32_t vtm_ts0_tshut;
109 uint32_t vtm_ts0_alert;
110 uint32_t vtm_ts0_ctrl;
111 uint32_t vtm_ts1_tshut;
112 uint32_t vtm_ts1_alert;
113 uint32_t vtm_ts1_ctrl;
114 } SDL_VTM_staticRegsTs;
115
137 int32_t SDL_VTM_initTs(const SDL_VTM_configTs *pConfig);
138
150 int32_t SDL_VTM_getTemp(SDL_VTM_InstTs instance, uint32_t *pTempVal);
151
166 int32_t SDL_VTM_setAlertTemp(SDL_VTM_InstTs instance, int32_t alert_th_hot,
167 int32_t alert_th_cold);
168
181 int32_t SDL_VTM_setTShutTemp(SDL_VTM_InstTs instance, int32_t tshut_th_hot, \
182 int32_t tshut_th_cold);
183
196 int32_t SDL_VTM_setClearInterrupts(SDL_VTM_InstTs instance, uint8_t hotintr, \
197 uint8_t coldintr, uint8_t lowthresholdintr);
198
208 int32_t SDL_VTM_getSensorStatus(SDL_VTM_Stat_val *pStat_val);
209
218 void SDL_VTM_enableTs(uint32_t sensorSelect, uint8_t delay);
219
224 void SDL_VTM_enableTc(void);
225
230 void SDL_VTM_disableTc(void);
231
242 int32_t SDL_VTM_getStaticRegistersTs(SDL_VTM_staticRegsTs *pStaticRegs);
243
253 int32_t SDL_VTM_enableESMWarmReset(SDL_VTM_InstTs instance);
254
255 #ifdef __cplusplus
256 }
257 #endif /* extern "C" */
258
259 #endif /* SDL_IP_VTM_TOP_H_ */
260
SDL_VTM_configTs::ts1_ts_hot_temp_in_milli_degree_celsius
int32_t ts1_ts_hot_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:86
SDL_VTM_configTs::ts0_alert_cold_temp_in_milli_degree_celsius
int32_t ts0_alert_cold_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:80
SDL_VTM_configTs::ts1_alert_cold_temp_in_milli_degree_celsius
int32_t ts1_alert_cold_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:92
SDL_VTM_configTs::cfgTs0Alert
uint8_t cfgTs0Alert
Definition: sdl_vtm.h:72
SDL_VTM_staticRegsTs::vtm_ts0_tshut
uint32_t vtm_ts0_tshut
Definition: sdl_vtm.h:108
SDL_VTM_staticRegsTs::vtm_ts_cfg
uint32_t vtm_ts_cfg
Definition: sdl_vtm.h:107
SDL_VTM_configTs
VTM temperature sensor configuration.
Definition: sdl_vtm.h:68
SDL_VTM_configTs::cfgTs0Tshut
uint8_t cfgTs0Tshut
Definition: sdl_vtm.h:70
SDL_VTM_InstTs
SDL_VTM_InstTs
Definition: sdl_soc_vtm.h:54
SDL_VTM_enableTs
void SDL_VTM_enableTs(uint32_t sensorSelect, uint8_t delay)
Enable Required Temperature sensors.
SDL_VTM_configTs::ts1_alert_hot_temp_in_milli_degree_celsius
int32_t ts1_alert_hot_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:90
SDL_VTM_staticRegsTs::vtm_ts0_alert
uint32_t vtm_ts0_alert
Definition: sdl_vtm.h:109
SDL_VTM_setTShutTemp
int32_t SDL_VTM_setTShutTemp(SDL_VTM_InstTs instance, int32_t tshut_th_hot, int32_t tshut_th_cold)
Set thresholds for temperature Shutdown.
SDL_VTM_getStaticRegistersTs
int32_t SDL_VTM_getStaticRegistersTs(SDL_VTM_staticRegsTs *pStaticRegs)
VTM Temperature sensor readback Static configuration registers.
SDL_VTM_initTs
int32_t SDL_VTM_initTs(const SDL_VTM_configTs *pConfig)
VTM Temperature sensor initialization.
SDL_VTM_staticRegsTs::vtm_ts1_alert
uint32_t vtm_ts1_alert
Definition: sdl_vtm.h:112
SDL_VTM_configTs::ts0_ts_hot_temp_in_milli_degree_celsius
int32_t ts0_ts_hot_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:74
SDL_VTM_setClearInterrupts
int32_t SDL_VTM_setClearInterrupts(SDL_VTM_InstTs instance, uint8_t hotintr, uint8_t coldintr, uint8_t lowthresholdintr)
API to set/Clear masks for generating interrupts.
SDL_VTM_configTs::ts1_ts_cold_temp_in_milli_degree_celsius
int32_t ts1_ts_cold_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:88
SDL_VTM_enableTc
void SDL_VTM_enableTc(void)
Enable Temperature Controller.
SDL_VTM_staticRegsTs
VTM Static Registers for Temperature sensor.
Definition: sdl_vtm.h:105
SDL_VTM_staticRegsTs::vtm_ts_th2
uint32_t vtm_ts_th2
Definition: sdl_vtm.h:106
SDL_VTM_disableTc
void SDL_VTM_disableTc(void)
Disable Temperature Controller.
sdl_ip_vtm.h
SDL_VTM_configTs::cfgTs1Alert
uint8_t cfgTs1Alert
Definition: sdl_vtm.h:84
SDL_VTM_configTs::ts0_alert_hot_temp_in_milli_degree_celsius
int32_t ts0_alert_hot_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:78
SDL_VTM_staticRegsTs::vtm_ts0_ctrl
uint32_t vtm_ts0_ctrl
Definition: sdl_vtm.h:110
SDL_VTM_configTs::cfgTs1Tshut
uint8_t cfgTs1Tshut
Definition: sdl_vtm.h:82
SDL_VTM_getSensorStatus
int32_t SDL_VTM_getSensorStatus(SDL_VTM_Stat_val *pStat_val)
Read VTM Temperature sensor status.
SDL_VTM_staticRegsTs::vtm_ts1_ctrl
uint32_t vtm_ts1_ctrl
Definition: sdl_vtm.h:113
SDL_VTM_enableESMWarmReset
int32_t SDL_VTM_enableESMWarmReset(SDL_VTM_InstTs instance)
Enable Warm Reset Generation.
SDL_VTM_configTs::ts0_ts_cold_temp_in_milli_degree_celsius
int32_t ts0_ts_cold_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:76
SDL_VTM_staticRegsTs::vtm_ts1_tshut
uint32_t vtm_ts1_tshut
Definition: sdl_vtm.h:111
SDL_VTM_Stat_val
VTM temperature sensor Stat values.
Definition: sdl_ip_vtm.h:162
SDL_VTM_getTemp
int32_t SDL_VTM_getTemp(SDL_VTM_InstTs instance, uint32_t *pTempVal)
Read VTM Temperature sensor values in degree celcius.
SDL_VTM_setAlertTemp
int32_t SDL_VTM_setAlertTemp(SDL_VTM_InstTs instance, int32_t alert_th_hot, int32_t alert_th_cold)
Set thresholds for temperature alerts.