Device Settings HAL 0.2.0
 
Loading...
Searching...
No Matches
dsHost.h
Go to the documentation of this file.
1/*
2 * If not stated otherwise in this file or this component's LICENSE 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 * @addtogroup HPK Hardware Porting Kit
22 * @{
23 * @par The Hardware Porting Kit
24 * HPK is the next evolution of the well-defined Hardware Abstraction Layer
25 * (HAL), but augmented with more comprehensive documentation and test suites
26 * that OEM or SOC vendors can use to self-certify their ports before taking
27 * them to RDKM for validation or to an operator for final integration and
28 * deployment. The Hardware Porting Kit effectively enables an OEM and/or SOC
29 * vendor to self-certify their own Video Accelerator devices, with minimal RDKM
30 * assistance.
31 *
32 */
33
34/**
35 * @defgroup Device_Settings Device Settings Module
36 * @{
37 */
38
39/**
40 * @defgroup Device_Settings_HAL Device Settings HAL
41 * @par Application API Specification
42 * Described herein are the DeviceSettings HAL types and functions that are part of
43 * the Host subsystem. The Host subsystem manages system-specific HAL operations.
44 * @{
45 */
46
47/**
48 * @defgroup dsHOST_HAL Device Settings Host HAL
49 * @{
50 * @par Application API Specification
51 * dsHost HAL provides an interface for managing the host settings for the device settings module
52 */
53
54/**
55 * @defgroup DSHAL_HOST_API Device Settings HAL Host Public API
56 * @{
57 */
58
59/**
60 *
61 * Describe the details about Device Settings HAL API specifications.
62 *
63 * <b> Following abbreviations present in HAL API </b>
64 *
65 * @par Abbreviations
66 * - BE: Big-Endian.
67 * - cb: Callback function (suffix).
68 * - DS: Device Settings.
69 * - FPD: Front-Panel Display.
70 * - HAL: Hardware Abstraction Layer.
71 * - LE: Little-Endian.
72 * - LS: Least Significant.
73 * - MBZ: Must be zero.
74 * - MS: Most Significant.
75 * - RDK: Reference Design Kit.
76 * - _t: Type (suffix).
77 * - HDCP: High-bandwidth Digital Copy Protection.
78 * - DTCP: Digital Transmission Copy Protection.
79 * - EDID: Extended Display Information Data.
80 *
81 * @ingroup DSSETTINGS_HAL
82 */
83
84#ifndef _DS_HOST_H_
85#define _DS_HOST_H_
86
87#ifdef __cplusplus
88extern "C" {
89#endif
90
91#include "dsError.h"
92#include "dsTypes.h"
93
94#define EDID_DATA_SIZE 256
95#define EDID_MAX_DATA_SIZE 512
96
97/**
98 * @brief Initializes the Host HAL sub-system
99 *
100 * This function initializes any needed resources within the module.
101 *
102 * @return dsError_t - Status
103 * @retval dsERR_NONE - Success
104 * @retval dsERR_GENERAL - Underlying undefined platform error
105 *
106 * @warning This API is Not thread safe.
107 * @see dsHostTerm()
108 *
109 *
110 *
111 */
113
114/**
115 * @brief Set the power mode.
116 *
117 * This function sets the power mode of the host to active or standby and turns on/off
118 * all the ouput ports.
119 *
120 * @param [in] newPower The power mode of the host (::dsPOWER_STANDBY or ::dsPOWER_ON)
121 * @return Device Settings error code
122 * @retval ::dsError_t
123 *
124 * @pre dsHostInit() must be called before this function
125 *
126 * @note dsPOWER_OFF is not currently being used.
127 */
129
130/**
131 * @brief Get the current power mode.
132 *
133 * This function gets the current power mode of the host.
134 *
135 * @param [out] *currPower The address of a location to hold the host's current power
136 * mode on return. It returns one of:
137 * - ::dsPOWER_OFF
138 * - ::dsPOWER_STANDBY
139 * - ::dsPOWER_ON
140 * @return Device Settings error code
141 * @retval ::dsError_t
142 *
143 * @pre dsHostInit() must be called before this function
144 */
146
147/**
148 * @brief Terminates the Host sub-system
149 *
150 * This function has to release all the resources allocated in the initialisation function.
151 *
152 * @return dsError_t - Status
153 * @retval dsERR_NONE - Success
154 * @retval dsERR_GENERAL - General failure
155 *
156 * @warning This API is Not thread safe.
157 *
158 * @see dsHostInit()
159 *
160 */
162
163/**
164 * @brief This function returns the preferred sleep mode which is persisted.
165 *
166 * @param[out] pMode Data will be copied to this. This shall be preallocated before the call.
167 * @return Device Settings error code
168 * @retval dsERR_NONE If sucessfully dsGetPreferredSleepMode api has been called using IARM support.
169 * @retval dsERR_GENERAL General failure.
170 *
171 * @pre dsHostInit() must be called before this function
172 */
174
175/**
176 * @brief This function sets the preferred sleep mode which needs to be persisted.
177 *
178 * @param[in] mode Sleep mode that is expected to be persisted.
179 * @return Device Settings error code
180 * @retval dsERR_NONE If sucessfully dsSetPreferredSleepMode api has been called using IARM support.
181 * @retval dsERR_GENERAL General failure.
182 *
183 * @pre dsHostInit() must be called before this function
184 */
186
187/**
188 * @brief Gets the CPU temperature in centigrade
189 *
190 * @param[out] cpuTemperature - CPU temperature value returned in centigrade
191 *
192 * @return dsError_t - Status
193 * @retval dsERR_NONE - Success
194 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
195 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
196 * @retval dsERR_GENERAL - Underlying undefined platform error
197 *
198 * @pre dsHostInit() must be called before this function
199 *
200 * @warning This API is Not thread safe.
201 *
202 */
203dsError_t dsGetCPUTemperature(float *cpuTemperature);
204
205/**
206 * @brief Get DS HAL API Version.
207 *
208 * In 4 byte VersionNumber, Two Most significant Bytes are Major number
209 * and Two Least Significant Bytes are minor number.
210 *
211 * @param[out] versionNumber 4 Bytes of version number of DS HAL
212 *
213 * @return Returns 4 byte Version Number
214 * @retval dsERR_NONE Successfully got the version number from dsHAL.
215 * @retval dsERR_GENERAL Failed to get the version number.
216 *
217 * @pre dsHostInit() must be called before this function
218 */
219dsError_t dsGetVersion(uint32_t *versionNumber);
220
221/**
222 * @brief Allows the application to set the runtime version of the dsHAL
223 *
224 * @param[in] versionNumber 4 Bytes of version number of DS HAL
225 *
226 * @retval dsERR_NONE Successfully set the version for dsHAL.
227 * @retval dsERR_GENERAL Failed to set the version.
228 *
229 * @pre dsHostInit() must be called before this function
230 */
231dsError_t dsSetVersion(uint32_t versionNumber);
232
233/**
234 * @brief Returns the SOC ID
235 *
236 * @param[out] socID - 8 byte Chip ID programmed to the CHIP One Time Programmable area
237 *
238 * @return dsError_t - Status
239 * @retval dsERR_NONE - Success
240 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
241 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
242 * @retval dsERR_GENERAL - Underlying undefined platform error
243 *
244 * @pre dsHostInit() must be called before this function
245 *
246 * @warning This API is Not thread safe.
247 *
248 */
250
251/**
252 * @brief Gets the host EDID and length
253 *
254 * The host EDID will be used on devices supporting HDMI input feature.
255 *
256 * @param[out] edid - host EDID.
257 * @param[out] length - length of host EDID. Min value of 0. Max value of 2048
258 *
259 * @return dsError_t - Status
260 * @retval dsERR_NONE - Success
261 * @retval dsERR_INVALID_PARAM - Parameter passed to this function is invalid
262 * @retval dsERR_OPERATION_NOT_SUPPORTED - The attempted operation is not supported
263 * @retval dsERR_GENERAL - Underlying undefined platform error
264 *
265 * @pre dsHostInit() must be called before this function
266 *
267 * @warning This API is Not thread safe.
268 *
269 */
270dsError_t dsGetHostEDID(unsigned char *edid, int *length);
271
272/**
273 * @brief This function is used to get the MS12 config platform supports.
274 *
275 * @param[out] configType - ms12 config type.
276 *
277 * @return Device Settings error code
278 * @retval dsERR_NONE If sucessfully dsGetMS12ConfigType api has read the ms12 configType from persistance
279 * @retval dsERR_GENERAL General failure.
280 *
281 * @pre dsHostInit() must be called before this function
282 */
283dsError_t dsGetMS12ConfigType(const char *configType);
284
285/** @} */ // End of DSHAL_HOST_API doxygen group
286/** @} */ // End of DS Host HAL
287/** @} */ // End of Device Settings HAL
288/** @} */ // End of Device Settings Module
289/** @} */ // End of HPK
290
291#ifdef __cplusplus
292}
293#endif
294#endif /* _DS_HOST_H_ */
295
296
297
Device Settings HAL error codes.
HAL types.
dsError_t
Device Settings API Error return codes.
Definition dsError.h:100
dsError_t dsGetHostEDID(unsigned char *edid, int *length)
Gets the host EDID and length.
dsError_t dsHostTerm()
Terminates the Host sub-system.
dsError_t dsSetHostPowerMode(int newPower)
Set the power mode.
dsError_t dsHostInit()
Initializes the Host HAL sub-system.
dsError_t dsGetMS12ConfigType(const char *configType)
This function is used to get the MS12 config platform supports.
dsError_t dsGetPreferredSleepMode(dsSleepMode_t *pMode)
This function returns the preferred sleep mode which is persisted.
dsError_t dsGetSocIDFromSDK(char *socID)
Returns the SOC ID.
dsError_t dsGetCPUTemperature(float *cpuTemperature)
Gets the CPU temperature in centigrade.
dsError_t dsSetVersion(uint32_t versionNumber)
Allows the application to set the runtime version of the dsHAL.
dsError_t dsGetHostPowerMode(int *currPower)
Get the current power mode.
dsError_t dsSetPreferredSleepMode(dsSleepMode_t mode)
This function sets the preferred sleep mode which needs to be persisted.
dsError_t dsGetVersion(uint32_t *versionNumber)
Get DS HAL API Version.
enum _dsSleepMode_t dsSleepMode_t