RDK Documentation (Open Sourced RDK Components)
dsHost.h
1 /*
2  * If not stated otherwise in this file or this component's Licenses.txt file the
3  * following copyright and licenses apply:
4  *
5  * Copyright 2016 RDK Management
6  *
7  * Licensed under the Apache License, Version 2.0 (the "License");
8  * you may not use this file except in compliance with the License.
9  * You may obtain a copy of the License at
10  *
11  * http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing, software
14  * distributed under the License is distributed on an "AS IS" BASIS,
15  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16  * See the License for the specific language governing permissions and
17  * limitations under the License.
18 */
19 
20 /**
21  * @defgroup devicesettingshalapi Device Settings HAL API list
22  * Describe the details about Device Settings HAL API specifications.
23  *
24  * <b> Following abbreviations present in HAL API </b>
25  *
26  * @par Abbreviations
27  * - BE: Big-Endian.
28  * - cb: Callback function (suffix).
29  * - DS: Device Settings.
30  * - FPD: Front-Panel Display.
31  * - HAL: Hardware Abstraction Layer.
32  * - LE: Little-Endian.
33  * - LS: Least Significant.
34  * - MBZ: Must be zero.
35  * - MS: Most Significant.
36  * - RDK: Reference Design Kit.
37  * - _t: Type (suffix).
38  * - HDCP: High-bandwidth Digital Copy Protection.
39  * - DTCP: Digital Transmission Copy Protection.
40  * - EDID: Extended Display Information Data.
41  *
42  * @ingroup DSSETTINGS_HAL
43  */
44 
45 
46 
47 /**
48 * @defgroup devicesettings
49 * @{
50 * @defgroup hal
51 * @{
52 **/
53 
54 
55 #ifndef _DS_HOST_H_
56 #define _DS_HOST_H_
57 
58 #ifdef __cplusplus
59 extern "C" {
60 #endif
61 
62 #include "dsError.h"
63 #include "dsTypes.h"
64 
65 #define EDID_DATA_SIZE 256
66 #define EDID_MAX_DATA_SIZE 512
67 
68 /** @addtogroup DSHAL_HOST_API Device Settings HAL Host Public API
69  * @ingroup devicesettingshalapi
70  *
71  * Described herein are the DeviceSettings HAL types and functions that are part of
72  * the Host subsystem. The Host subsystem manages system-specific hardware operations.
73  *
74  * @{
75  */
76 
77 
78 
79 /**
80  * @brief Initialize the Host sub-system.
81  *
82  * This function must initialize all the system specific drivers to be initialized prior
83  * to any driver specific calls.
84  *
85  * @return Device Settings error code
86  * @retval ::dsError_t
87  */
89 
90 /**
91  * @brief Set the power mode.
92  *
93  * This function sets the power mode of the host to active or standby and turns on/off
94  * all the ouput ports.
95  *
96  * @param [in] newPower The power mode of the host (::dsPOWER_STANDBY or ::dsPOWER_ON)
97  * @return Device Settings error code
98  * @retval ::dsError_t
99  *
100  * @note dsPOWER_OFF is not currently being used.
101  */
102 dsError_t dsSetHostPowerMode(int newPower);
103 
104 /**
105  * @brief Get the current power mode.
106  *
107  * This function gets the current power mode of the host.
108  *
109  * @param [out] *currPower The address of a location to hold the host's current power
110  * mode on return. It returns one of:
111  * - ::dsPOWER_OFF
112  * - ::dsPOWER_STANDBY
113  * - ::dsPOWER_ON
114  * @return Device Settings error code
115  * @retval ::dsError_t
116  */
117 dsError_t dsGetHostPowerMode(int *currPower);
118 
119 /**
120  * @brief Terminate the Host sub-system.
121  *
122  * This function resets the data structures used within the Host module and releases any
123  * handles specific to the host module.
124  *
125  * @return Device Settings error code
126  * @retval ::dsError_t
127  */
129 
130 /**
131  * @brief This function returns the preferred sleep mode which is persisted.
132  *
133  * @param[out] pMode Data will be copied to this. This shall be preallocated before the call.
134  * @return Device Settings error code
135  * @retval dsERR_NONE If sucessfully dsGetPreferredSleepMode api has been called using IARM support.
136  * @retval dsERR_GENERAL General failure.
137  */
139 
140 /**
141  * @brief This function sets the preferred sleep mode which needs to be persisted.
142  *
143  * @param[in] mode Sleep mode that is expected to be persisted.
144  * @return Device Settings error code
145  * @retval dsERR_NONE If sucessfully dsSetPreferredSleepMode api has been called using IARM support.
146  * @retval dsERR_GENERAL General failure.
147  */
149 
150 /**
151  * @brief This function gets the CPU temperature in centrigade.
152  *
153  * @param[in] cpuTemperature The address of a location to hold the CPU Temperature
154  * @return Device Settings error code
155  * @retval dsERR_NONE If sucessfully dsGetCPUTemperature api has been called using IARM support.
156  * @retval dsERR_GENERAL General failure.
157  */
158 dsError_t dsGetCPUTemperature(float *cpuTemperature);
159 
160 /**
161  * @brief Get DS HAL API Version.
162  *
163  * In 4 byte VersionNumber, Two Most significant Bytes are Major number
164  * and Two Least Significant Bytes are minor number.
165  *
166  * @param[out] versionNumber 4 Bytes of version number of DS HAL
167  *
168  * @return Returns 4 byte Version Number
169  * @retval dsERR_NONE Successfully got the version number from dsHAL.
170  * @retval dsERR_GENERAL Failed to get the version number.
171  */
172 dsError_t dsGetVersion(uint32_t *versionNumber);
173 
174 /**
175  * @brief Allows the application to set the runtime version of the dsHAL
176  *
177  * @param[in] versionNumber 4 Bytes of version number of DS HAL
178  *
179  * @retval dsERR_NONE Successfully set the version for dsHAL.
180  * @retval dsERR_GENERAL Failed to set the version.
181  */
182 dsError_t dsSetVersion(uint32_t versionNumber);
183 
184 /**
185  * @brief This function returns SOC ID
186  * @param[in] socID The address of a location to hold SOC ID
187  * @return Device Settings error code
188  * @retval dsERR_NONE If sucessfully dsSetPreferredSleepMode api has been called using IARM support.
189  * @retval dsERR_UNKNOWN General failure.
190  */
191 
192 dsError_t dsGetSocIDFromSDK(char *socID);
193 
194 /**
195  * @brief This function is used to get the host EDID and length.
196  * @param[out] edid host EDID.
197  * @param[out] length length of host EDID
198  * @return Device Settings error code
199  * @retval dsERR_NONE If sucessfully dsGetHostEDID api has been called using IARM support.
200  * @retval dsERR_GENERAL General failure.
201  */
202 dsError_t dsGetHostEDID(unsigned char *edid, int *length);
203 
204 /**
205  * @}
206  */
207 #ifdef __cplusplus
208 }
209 #endif
210 #endif /* _DS_HOST_H_ */
211 
212 
213 /** @} */
214 /** @} */
dsGetVersion
dsError_t dsGetVersion(uint32_t *versionNumber)
Get DS HAL API Version.
Definition: dsHost.cpp:114
dsGetCPUTemperature
dsError_t dsGetCPUTemperature(float *cpuTemperature)
This function gets the CPU temperature in centrigade.
Definition: dsHost.cpp:88
dsSleepMode_t
enum _dsSleepMode_t dsSleepMode_t
dsTypes.h
Device Settings HAL types.
dsHostTerm
dsError_t dsHostTerm()
Terminate the Host sub-system.
dsHostInit
dsError_t dsHostInit()
Initialize the Host sub-system.
dsError.h
Device Settings HAL error codes.
dsGetHostPowerMode
dsError_t dsGetHostPowerMode(int *currPower)
Get the current power mode.
dsSetVersion
dsError_t dsSetVersion(uint32_t versionNumber)
Allows the application to set the runtime version of the dsHAL.
Definition: dsHost.cpp:139
dsGetPreferredSleepMode
dsError_t dsGetPreferredSleepMode(dsSleepMode_t *pMode)
This function returns the preferred sleep mode which is persisted.
Definition: dsHost.cpp:63
dsSetPreferredSleepMode
dsError_t dsSetPreferredSleepMode(dsSleepMode_t mode)
This function sets the preferred sleep mode which needs to be persisted.
Definition: dsHost.cpp:43
dsGetSocIDFromSDK
dsError_t dsGetSocIDFromSDK(char *socID)
This function returns SOC ID.
Definition: dsHost.cpp:162
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
dsGetHostEDID
dsError_t dsGetHostEDID(unsigned char *edid, int *length)
This function is used to get the host EDID and length.
Definition: dsHost.cpp:191
dsSetHostPowerMode
dsError_t dsSetHostPowerMode(int newPower)
Set the power mode.