RDK Documentation (Open Sourced RDK Components)
dsFPD.h
Go to the documentation of this file.
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  * @file dsFPD.h
22  */
23 
24 
25 
26 /**
27 * @defgroup devicesettings
28 * @{
29 * @defgroup hal
30 * @{
31 **/
32 
33 
34 #ifndef _DS_FPD_H_
35 #define _DS_FPD_H_
36 
37 #include <sys/types.h>
38 #include "dsError.h"
39 #include "dsTypes.h"
40 
41 #ifdef __cplusplus
42 extern "C" {
43 #endif
44 
45 
46 /** @addtogroup DSHAL_FPD_API Device Settings HAL Front Panel Display (FPD) Public API
47  * @ingroup devicesettingshalapi
48  * @{
49  */
50 
51 /**
52  * @brief This function is used to initialize the underlying front panel display sub-system.
53  *
54  * @return Device Settings error code
55  * @retval dsERR_NONE Indicates dsFPInit API was successfully called using iarmbus call.
56  * @retval dsERR_GENERAL Indicates error due to general failure.
57  */
58 dsError_t dsFPInit (void);
59 
60 /**
61  * @brief Set LED blinking mode.
62  *
63  * This function is used to set the individual discrete LEDs to blink for a specified
64  * number of times at the specified blink interval.
65  *
66  * @param [in] eIndicator FPD Indicator index (Power LED, Record LED, etc.).
67  * @param [in] uBlinkDuration Blink interval. The percentage of time the text display will remain on during one blink iteration.
68  * @param [in] uBlinkIterations Number of times for the given LED to blink. The number of times per minute data will blink across all of the LEDs.
69  * @return Device Settings error code
70  * @retval dsERR_NONE Indicates dsSetFPBlink API was successfully called using iarmbus call.
71  * @retval dsERR_GENERAL Indicates error due to general failure.
72  */
73 dsError_t dsSetFPBlink (dsFPDIndicator_t eIndicator, unsigned int uBlinkDuration, unsigned int uBlinkIterations);
74 
75 /**
76  * @brief Set LED brightness level.
77  *
78  * This function will set the brightness of the specified discrete LEDs on the Front
79  * Panel Display to the specified brightness level. The Power LED brightness setting
80  * will also be adjusted to this setting.
81  *
82  * @param[in] eIndicator FPD Indicator index (Power LED, Record LED, and so on).
83  * @param[in] eBrightness The brightness value for the specified indicator.
84  *
85  * @return Device Settings error code
86  * @retval dsERR_NONE Indicates dsSetFPBrightness API was successfully called using iarmbus call.
87  * @retval dsERR_GENERAL Indicates error due to general failure.
88  */
89 dsError_t dsSetFPBrightness (dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness);
90 
91 
92 /**
93  * @brief This function will Get the ON or OFF state of Specified LEDs
94  *
95  *
96  * @param[in] eIndicator FPD Indicator index (Power LED, Record LED and so on).
97  * @param[out] state Pointer to hold the state of the specified indicator.
98  *
99  * @return Device Settings error code
100  * @retval dsERR_NONE Indicates dsGetFPState API was successfully called using iarmbus call.
101  * @retval dsERR_GENERAL Indicates error due to general failure.
102  */
103 dsError_t dsGetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t* state);
104 
105 
106 /**
107  * @brief This function will enable or disable the specified discrete LED on the front
108  * panel display.
109  *
110  * @param[in] eIndicator FPD Indicator index (Power LED, Record LED and so on).
111  * @param[in] state Indicates ON or OFF state for the indicator.(ON = 1 and OFF = 0).
112  *
113  * @return Device Settings error code
114  * @retval dsERR_NONE Indicates dsSetFPState API was successfully called using iarmbus call.
115  * @retval dsERR_GENERAL Indicates error due to general failure.
116  */
117 dsError_t dsSetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t state);
118 
119 /**
120  * @brief Get the brightness level for Front Panel Display LEDs.
121  *
122  * This function returns the brightness level of the specified discrete LEDs on the front
123  * panel.
124  *
125  * @param [in] eIndicator FPD Indicator index (Power LED, Record LED, etc.).
126  * @param [out] *pBrightness The address of a location to hold the brightness value
127  * for the specified indicator on return.
128 * @return Device Settings error code
129  * @retval dsERR_NONE Indicates dsGetFPBrightness API was successfully called using iarmbus call.
130  * @retval dsERR_GENERAL Indicates error due to general failure.
131  */
132 dsError_t dsGetFPBrightness (dsFPDIndicator_t eIndicator, dsFPDBrightness_t *pBrightness);
133 
134 
135 /**
136  * @brief Get LED color.
137  *
138  * This function Gets the color of the specified front panel indicator LED, if the
139  * indicator supports it (i.e. is multi-colored). It must return
140  * ::dsERR_OPERATION_NOT_SUPPORTED if the indicator is single-colored.
141  *
142  * @param [in] eIndicator FPD Indicator index (Power LED, Record LED, etc.).
143  * @param [in] *pColor The address of a location to hold the color value
144  * @return Device Settings error code
145  * @retval dsERR_NONE Indicates dsGetFPColor API was successfully called using iarmbus call.
146  * @retval dsERR_GENERAL Indicates error due to general failure.
147  */
148 dsError_t dsGetFPColor (dsFPDIndicator_t eIndicator, dsFPDColor_t *pColor);
149 
150 /**
151  * @brief Set LED color.
152  *
153  * This function sets the color of the specified front panel indicator LED, if the
154  * indicator supports it (i.e. is multi-colored). It must return
155  * ::dsERR_OPERATION_NOT_SUPPORTED if the indicator is single-colored.
156  *
157  * @param [in] eIndicator FPD Indicator index (Power LED, Record LED, etc.).
158  * @param [in] eColor The color index for the specified indicator.
159  * @return Device Settings error code
160  * @retval dsERR_NONE Indicates dsSetFPColor API was successfully called using iarmbus call.
161  * @retval dsERR_GENERAL Indicates error due to general failure.
162  */
163 dsError_t dsSetFPColor (dsFPDIndicator_t eIndicator, dsFPDColor_t eColor);
164 
165 /**
166  * @brief Set time on 7-Segment Display.
167  *
168  * This function sets the 7-segment display LEDs to show the time. The format
169  * (12/24-hour) must be specified. If there are no 7-Segment display LEDs present on the
170  * device then ::dsERR_OPERATION_NOT_SUPPORTED must be returned.
171  * The function shall return ::dsERR_INVALID_PARAM if the format and hours values do not agree,
172  * or if the hours/minutes are invalid.
173  *
174  * @param [in] eTimeFormat Time format (12 or 24 hrs).
175  * @param [in] uHour Hour information.
176  * @param [in] uMinutes Minutes information.
177  * @return Device Settings error code
178  * @retval dsERR_NONE Indicates dsSetFPTime API was successfully called using iarmbus call.
179  * @retval dsERR_GENERAL Indicates error due to general failure.
180  */
181 dsError_t dsSetFPTime (dsFPDTimeFormat_t eTimeFormat, const unsigned int uHour, const unsigned int uMinutes);
182 
183 /**
184  * @brief Set text on 7-Segment Display.
185  *
186  * This function is used to set the 7-segment display LEDs to show the given text. The
187  * supported format of text is specified. If there are no 7-Segment display LEDs present
188  * on the device then ::dsERR_OPERATION_NOT_SUPPORTED must be returned.
189  *
190  * @return Device Settings error code
191  * @retval dsERR_NONE Indicates dsSetFPText API was successfully called using iarmbus call.
192  * @retval dsERR_GENERAL Indicates error due to general failure.
193  */
194 dsError_t dsSetFPText(const char* pText);
195 
196 /**
197  * @brief Set brightness level of 7-Segment Display.
198  *
199  * This function will set the brightness of the specified 7-Segment Display LEDs on the Front
200  * Panel Display to the specified brightness level.
201  *
202  * @param [in] eIndicator FPD Indicator index (Clock LED).
203  * @param [in] eBrightness The brightness value for the specified indicator.
204 * @return Device Settings error code
205  * @retval dsERR_NONE Indicates dsSetFPTextBrightness API was successfully called using iarmbus call.
206  * @retval dsERR_GENERAL Indicates error due to general failure.
207  */
209 
210 
211 /**
212  * @brief Get the brightness of 7-Segment Display LEDs
213  *
214  * This function will Get the brightness of the specified 7-Segment Display LEDs on the Front
215  * Panel Text Display .
216  *
217  * @param [in] eIndicator FPD Indicator index (CLock Led.).
218  * @param [in] eBrightness The address of a location to hold the brightness value
219  * for the specified indicator on return.
220  * @return Device Settings error code
221  * @retval dsERR_NONE Indicates dsGetFPTextBrightness API was successfully called using iarmbus call.
222  * @retval dsERR_GENERAL Indicates error due to general failure.
223  */
225 
226 
227 /**
228  * @brief Use disable and enable display of clock
229  *
230  * This function will enable or disable displaying of clock.
231  *
232  * @param[in] enable Indicates the clock to be enabled or disabled.
233  * (TRUE = enable clock and FALSE = disable clock).
234  *
235  * @return Device Settings error code
236  * @retval dsERR_NONE Indicates dsFPEnableCLockDisplay API was successfully called using iarmbus call.
237  * @retval dsERR_GENERAL Indicates error due to general failure.
238  */
239 dsError_t dsFPEnableCLockDisplay (int enable);
240 
241 /**
242  * @brief Scroll text on 7-Segment Display.
243  *
244  * This function scrolls the text in the 7-segment LEDs for the given number of iterations.
245  *
246  * @param [in] uScrollHoldOnDur Duration for the scroll to hold each character before scrolling
247  * it to the next position during one scroll iteration.
248  * @param [in] uHorzScrollIterations Number of iterations for which to scroll horizontally.
249  * @param [in] uVertScrollIterations Number of iterations for which to scroll vertically.
250 * @return Device Settings error code
251  * @retval dsERR_NONE Indicates dsSetFPScroll API was successfully called using iarmbus call.
252  * @retval dsERR_GENERAL Indicates error due to general failure.
253  */
254 dsError_t dsSetFPScroll(unsigned int uScrollHoldOnDur, unsigned int uHorzScrollIterations, unsigned int uVertScrollIterations);
255 
256 /**
257  * @brief Terminate the the Front Panel Display sub-system.
258  *
259  * This function resets any data structures used within the platform front-panel module,
260  * and releases the front-panel specific device handles.
261  *
262  * @return Device Settings error code
263  * @retval dsERR_NONE Indicates dsFPTerm API was successfully called using iarmbus call.
264  * @retval dsERR_GENERAL Indicates error due to general failure.
265  */
266 dsError_t dsFPTerm(void);
267 
268 /**
269  * @brief This function will set the brightness of the specified discrete LED on the front
270  * panel display to the specified brightness level in multi-app mode using iarmbus call.
271  * The brightness level shall be persisted if the input parameter toPersist passed is TRUE.
272  *
273  * @param[in] eIndicator FPD Indicator index (Power LED, Record LED, and so on).
274  * @param[in] eBrightness The brightness value for the specified indicator.
275  * @param[in] toPersist If set to TRUE, the brightness value shall be persisted.
276  *
277  * @return Device Settings error code
278  * @retval dsERR_NONE Indicates dsSetFPBrightness API was successfully called using iarmbus call.
279  * @retval dsERR_GENERAL Indicates error due to general failure.
280  */
281 dsError_t dsSetFPDBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness,bool toPersist);
282 
283 /**
284  * @brief This function sets the color of the specified LED on the front panel in
285  * multi-app mode using iarmbus call. The color of the LED shall be persisted if the
286  * input parameter toPersist is set to TRUE.
287  *
288  * @param[in] eIndicator FPD Indicator index (Power LED, Record LED and so on).
289  * @param[in] eColor Indicates the RGB color to be set for the specified LED.
290  * @param[in] toPersist Indicates whether to persist the specified LED color or not.
291  * (If TRUE persists the LED color else doesn't persist it)
292  *
293  * @return Device Settings error code
294  * @retval dsERR_NONE Indicates dsSetFPColor API was successfully called using iarmbus call.
295  * @retval dsERR_GENERAL Indicates error due to general failure.
296  */
297 dsError_t dsSetFPDColor (dsFPDIndicator_t eIndicator, dsFPDColor_t eColor,bool toPersist);
298 
299 
300 /**
301  * @brief This function sets the 7-segment display LEDs to show the specified time in specified format.
302  *
303  * @param[in] eTimeFormat Indicates the time format (12 hour or 24 hour).
304  *
305  * @return Device Settings error code
306  * @retval dsERR_NONE Indicates dsSetFPTime API was successfully called using iarmbus call.
307  * @retval dsERR_GENERAL Indicates error due to general failure.
308  */
310 
311  /**
312  * @brief This function get the Current time zone format set on 7-segment display LEDs panel.
313  *
314  * @param[in] None.
315  * @param[out] pTimeFormat Pointer to hold the Current time format value .
316  *
317  * @return Device Settings error code
318  * @retval dsERR_NONE Indicates dsGetFPBrightness API was successfully called using iarmbus call.
319  * @retval dsERR_GENERAL Indicates error due to general failure.
320  */
321 
323 
324 /**
325  * @brief This function sets the display mode of the FPD text display
326  *
327  * @param[in] eMode Indicates the mode (any, clock or text)
328  *
329  * @return Device Settings error code
330  * @retval dsERR_NONE Indicates dsSetFPDMode API was successfully called using iarmbus call.
331  * @retval dsERR_GENERAL Indicates error due to general failure.
332  */
334 
335 /**
336  * @brief This function returns the supported led states
337  *
338  * @param[out] return the bitwise value of all supported led states by the platform
339  *
340  * @return front panel error code
341  * @retval dsERR_NONE Indicates api was successful
342  * @retval dsERR_GENERAL Indicates error due to general failure.
343  */
344 dsError_t dsFPGetSupportedLEDStates (unsigned int* states);
345 
346 /**
347  * @brief This function returns the current led state
348  *
349  * @param[out] returns current led state
350  *
351  * @return front panel error code
352  * @retval dsERR_NONE Indicates api was successful
353  * @retval dsERR_GENERAL Indicates error due to general failure.
354  */
356 
357 /**
358  * @brief This function sets the led state
359  *
360  * @param[in] let state to set
361  *
362  * @return front panel error code
363  * @retval dsERR_NONE Indicates api was successful
364  * @retval dsERR_GENERAL Indicates error due to general failure.
365  */
367 /**
368  * @}
369  */
370 
371 
372 #ifdef __cplusplus
373 }
374 #endif
375 #endif /* _DS_FPD_H_ */
376 
377 
378 /** @} */
379 /** @} */
dsFPEnableCLockDisplay
dsError_t dsFPEnableCLockDisplay(int enable)
Use disable and enable display of clock.
Definition: dsFPD.c:390
dsSetFPDMode
dsError_t dsSetFPDMode(dsFPDMode_t eMode)
This function sets the display mode of the FPD text display.
Definition: dsFPD.c:504
dsSetFPText
dsError_t dsSetFPText(const char *pText)
Set text on 7-Segment Display.
Definition: dsFPD.c:80
dsSetFPState
dsError_t dsSetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t state)
This function will enable or disable the specified discrete LED on the front panel display.
Definition: dsFPD.c:410
dsSetFPTime
dsError_t dsSetFPTime(dsFPDTimeFormat_t eTimeFormat, const unsigned int uHour, const unsigned int uMinutes)
Set time on 7-Segment Display.
Definition: dsFPD.c:110
dsTypes.h
Device Settings HAL types.
dsGetFPState
dsError_t dsGetFPState(dsFPDIndicator_t eIndicator, dsFPDState_t *state)
This function will Get the ON or OFF state of Specified LEDs.
Definition: dsFPD.c:480
dsGetFPTimeFormat
dsError_t dsGetFPTimeFormat(dsFPDTimeFormat_t *pTimeFormat)
This function get the Current time zone format set on 7-segment display LEDs panel.
Definition: dsFPD.c:435
dsFPDTimeFormat_t
enum __dsFPDTimeFormat_t dsFPDTimeFormat_t
dsSetFPBlink
dsError_t dsSetFPBlink(dsFPDIndicator_t eIndicator, unsigned int uBlinkDuration, unsigned int uBlinkIterations)
Set LED blinking mode.
Definition: dsFPD.c:161
dsFPDBrightness_t
uint32_t dsFPDBrightness_t
Definition: dsTypes.h:862
dsFPTerm
dsError_t dsFPTerm(void)
Terminate the the Front Panel Display sub-system.
Definition: dsFPD.c:62
dsSetFPDBrightness
dsError_t dsSetFPDBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness, bool toPersist)
This function will set the brightness of the specified discrete LED on the front panel display to the...
Definition: dsFPD.c:242
dsFPGetLEDState
dsError_t dsFPGetLEDState(dsFPDLedState_t *state)
This function returns the current led state.
dsGetFPBrightness
dsError_t dsGetFPBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t *pBrightness)
Get the brightness level for Front Panel Display LEDs.
Definition: dsFPD.c:187
dsSetFPTextBrightness
dsError_t dsSetFPTextBrightness(dsFPDTextDisplay_t eIndicator, dsFPDBrightness_t eBrightness)
Set brightness level of 7-Segment Display.
Definition: dsFPD.c:295
dsGetFPColor
dsError_t dsGetFPColor(dsFPDIndicator_t eIndicator, dsFPDColor_t *pColor)
Get LED color.
Definition: dsFPD.c:317
dsFPSetLEDState
dsError_t dsFPSetLEDState(dsFPDLedState_t state)
This function sets the led state.
dsError.h
Device Settings HAL error codes.
dsFPDTextDisplay_t
enum __dsFPDTextDisplay_t dsFPDTextDisplay_t
dsFPDState_t
enum __dsFPDState_t dsFPDState_t
dsFPInit
dsError_t dsFPInit(void)
This function is used to initialize the underlying front panel display sub-system.
Definition: dsFPD.c:42
dsSetFPBrightness
dsError_t dsSetFPBrightness(dsFPDIndicator_t eIndicator, dsFPDBrightness_t eBrightness)
Set LED brightness level.
Definition: dsFPD.c:213
dsGetFPTextBrightness
dsError_t dsGetFPTextBrightness(dsFPDTextDisplay_t eIndicator, dsFPDBrightness_t *eBrightness)
Get the brightness of 7-Segment Display LEDs.
Definition: dsFPD.c:270
dsSetFPColor
dsError_t dsSetFPColor(dsFPDIndicator_t eIndicator, dsFPDColor_t eColor)
Set LED color.
Definition: dsFPD.c:343
dsSetFPScroll
dsError_t dsSetFPScroll(unsigned int uScrollHoldOnDur, unsigned int uHorzScrollIterations, unsigned int uVertScrollIterations)
Scroll text on 7-Segment Display.
Definition: dsFPD.c:135
dsFPDMode_t
enum __dsFPDMode_t dsFPDMode_t
dsFPDLedState_t
enum __dsFPDLedState_t dsFPDLedState_t
dsSetFPDColor
dsError_t dsSetFPDColor(dsFPDIndicator_t eIndicator, dsFPDColor_t eColor, bool toPersist)
This function sets the color of the specified LED on the front panel in multi-app mode using iarmbus ...
Definition: dsFPD.c:367
dsSetFPTimeFormat
dsError_t dsSetFPTimeFormat(dsFPDTimeFormat_t eTimeFormat)
This function sets the 7-segment display LEDs to show the specified time in specified format.
Definition: dsFPD.c:458
dsError_t
dsError_t
Device Settings API Error return codes.
Definition: dsError.h:84
dsFPGetSupportedLEDStates
dsError_t dsFPGetSupportedLEDStates(unsigned int *states)
This function returns the supported led states.