AM243x MCU+ SDK  09.01.00
sdl_vtm.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2023 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 
42 #ifndef SDL_VTM_H
43 #define SDL_VTM_H
44 
45 #ifdef __cplusplus
46 extern "C" {
47 #endif
48 
49 #include <stdint.h>
50 #include <stdbool.h>
51 #include <sdl/include/soc_config.h>
52 #if defined (IP_VERSION_VTM_V0)
53 #include <sdl/vtm/v0/sdlr_vtm.h>
54 #include <sdl/vtm/v0/sdl_ip_vtm.h>
55 #endif
56 
83 typedef struct {
89  uint8_t vid_opp_val;
95 
101  typedef struct {
113 
122 typedef struct {
126  uint32_t vtm_vd_opp_vid;
130 
139 typedef struct {
141  uint32_t vtm_ts_ctrl2;
143  uint32_t vtm_ts_ctrl;
145  uint32_t vtm_ts_th;
147  uint32_t vtm_ts_th2;
149 
173 int32_t SDL_VTM_initVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig);
174 
191 int32_t SDL_VTM_initTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig);
192 
204 int32_t SDL_VTM_getTemp(SDL_VTM_InstTs instance, uint32_t *pTempVal);
205 
219  SDL_VTM_Stat_val *pStat_val);
220 
233 
245 int32_t SDL_VTM_verifyConfigVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig);
246 
258 int32_t SDL_VTM_verifyConfigTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig);
259 
272 
285 
286 
287 
288 #ifdef __cplusplus
289 }
290 #endif /* extern "C" */
291 
292 #endif /* end of SDL_VTM_H definition */
SDL_VTM_staticRegsVd
VTM Static Registers for Voltage Domain.
Definition: sdl_vtm.h:122
SDL_VTM_configTs::tsCtrl_cfg
SDL_VTM_Ctrlcfg tsCtrl_cfg
Definition: sdl_vtm.h:105
SDL_VTM_getStaticRegistersTs
int32_t SDL_VTM_getStaticRegistersTs(SDL_VTM_InstTs instance, SDL_VTM_staticRegsTs *pStaticRegs)
VTM Temperature sensor readback Static configuration registers.
SDL_VTM_configVd::vid_opp_val
uint8_t vid_opp_val
Definition: sdl_vtm.h:89
SDL_VTM_verifyConfigVd
int32_t SDL_VTM_verifyConfigVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig)
VTM Voltage Domain configures verification.
SDL_VTM_tsGlobal_cfg
VTM Global Configuration Registers.
Definition: sdl_ip_vtm.h:427
SDL_VTM_configTs::thr_val
SDL_VTM_tsThrVal thr_val
Definition: sdl_vtm.h:111
SDL_VTM_InstVd
SDL_VTM_InstVd
Definition: sdl_soc_vtm.h:86
SDL_VTM_configTs
VTM temperature sensor configuration.
Definition: sdl_vtm.h:101
SDL_VTM_InstTs
SDL_VTM_InstTs
Definition: sdl_soc_vtm.h:54
SDL_VTM_configVd::vid_opp
SDL_VTM_vid_opp vid_opp
Definition: sdl_vtm.h:87
SDL_VTM_vdEvtSel_set
uint16_t SDL_VTM_vdEvtSel_set
This enumerator define for VTM Voltage domain Event selection set.
Definition: sdl_ip_vtm.h:156
SDL_VTM_configVd::vd_temp_evts
SDL_VTM_vdEvtSel_set vd_temp_evts
Definition: sdl_vtm.h:91
SDL_VTM_configTsCtrl
uint8_t SDL_VTM_configTsCtrl
This enumerator define for VTM TS configuration valid map.
Definition: sdl_ip_vtm.h:82
SDL_VTM_Stat_read_ctrl
uint8_t SDL_VTM_Stat_read_ctrl
This enumerator define for VTM temperature sensor STAT read valid map.
Definition: sdl_ip_vtm.h:380
SDL_VTM_intrCtrl
uint16_t SDL_VTM_intrCtrl
This enumerator define for VTM Voltage domain threshold interrupt control.
Definition: sdl_ip_vtm.h:133
SDL_VTM_configTs::configTsCtrl
SDL_VTM_configTsCtrl configTsCtrl
Definition: sdl_vtm.h:103
SDL_VTM_configVd::tsGlobal_cfg
SDL_VTM_tsGlobal_cfg tsGlobal_cfg
Definition: sdl_vtm.h:93
SDL_VTM_verifyConfigTs
int32_t SDL_VTM_verifyConfigTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig)
VTM Temperature sensor configures verification.
SDL_VTM_staticRegsVd::vtm_vd_evt_sel_ctrl
uint32_t vtm_vd_evt_sel_ctrl
Definition: sdl_vtm.h:124
SDL_VTM_staticRegsTs::vtm_ts_ctrl2
uint32_t vtm_ts_ctrl2
Definition: sdl_vtm.h:141
sdlr_vtm.h
SDL_VTM_initVd
int32_t SDL_VTM_initVd(SDL_VTM_InstVd instance, const SDL_VTM_configVd *pConfig)
VTM Voltage Domain initialization.
SDL_VTM_getStaticRegistersVd
int32_t SDL_VTM_getStaticRegistersVd(SDL_VTM_InstVd instance, SDL_VTM_staticRegsVd *pStaticRegs)
VTM Voltage Domain readback Static configuration registers.
SDL_VTM_configTs::high_temp_in_milli_degree_celsius
int32_t high_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:107
SDL_VTM_Ctrlcfg
VTM temperature sensor band gap control.
Definition: sdl_ip_vtm.h:465
SDL_VTM_intrCntrl
int32_t SDL_VTM_intrCntrl(SDL_VTM_InstVd instance, SDL_VTM_intrCtrl intrCtrl)
Set maximum Threshold values of VTM Temperature sensor.
SDL_VTM_staticRegsTs
VTM Static Registers for Temperature sensor.
Definition: sdl_vtm.h:139
SDL_VTM_configTs::low_temp_in_milli_degree_celsius
int32_t low_temp_in_milli_degree_celsius
Definition: sdl_vtm.h:109
SDL_VTM_getSensorStatus
int32_t SDL_VTM_getSensorStatus(SDL_VTM_InstTs instance, const SDL_VTM_Stat_read_ctrl *pCtrl, SDL_VTM_Stat_val *pStat_val)
Read VTM Temperature sensor status.
SDL_VTM_staticRegsTs::vtm_ts_th2
uint32_t vtm_ts_th2
Definition: sdl_vtm.h:147
sdl_ip_vtm.h
SDL_VTM_initTs
int32_t SDL_VTM_initTs(SDL_VTM_InstTs instance, const SDL_VTM_configTs *pConfig)
VTM Temperature sensor initialization.
SDL_VTM_tsThrVal
VTM temperature sensor threshold values.
Definition: sdl_ip_vtm.h:492
SDL_VTM_configVd
VTM Voltage Domain configuration.
Definition: sdl_vtm.h:83
SDL_VTM_staticRegsVd::vtm_vd_opp_vid
uint32_t vtm_vd_opp_vid
Definition: sdl_vtm.h:126
SDL_VTM_staticRegsVd::vtm_global_cfg
SDL_VTM_tsGlobal_cfg vtm_global_cfg
Definition: sdl_vtm.h:128
SDL_VTM_Stat_val
VTM temperature sensor Stat values.
Definition: sdl_ip_vtm.h:515
SDL_VTM_staticRegsTs::vtm_ts_ctrl
uint32_t vtm_ts_ctrl
Definition: sdl_vtm.h:143
SDL_VTM_configVd::configVdCtrl
SDL_VTM_configVdCtrl configVdCtrl
Definition: sdl_vtm.h:85
SDL_VTM_vid_opp
uint8_t SDL_VTM_vid_opp
This enumerator defines the possible VID Codes to set various voltage domain supply voltages.
Definition: sdl_ip_vtm.h:96
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_staticRegsTs::vtm_ts_th
uint32_t vtm_ts_th
Definition: sdl_vtm.h:145
SDL_VTM_configVdCtrl
uint8_t SDL_VTM_configVdCtrl
This enumerator define forVTM VD configuration valid map.
Definition: sdl_ip_vtm.h:70