]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - apps/tidep0084.git/blob - example/collector/common/util/board_lcd.h
Updated TI Linux Sensor To Cloud to the latest TI 15.4-Stack v2.4, now with CC13x2...
[apps/tidep0084.git] / example / collector / common / util / board_lcd.h
1 /******************************************************************************
3  @file board_lcd.h
5  @brief This file contains the LCD Service definitions and prototypes.
7  Group: WCS LPC
8  $Target Devices: Linux: AM335x, Embedded Devices: CC1310, CC1350, CC1352$
10  ******************************************************************************
11  $License: BSD3 2016 $
12   
13    Copyright (c) 2015, Texas Instruments Incorporated
14    All rights reserved.
15   
16    Redistribution and use in source and binary forms, with or without
17    modification, are permitted provided that the following conditions
18    are met:
19   
20    *  Redistributions of source code must retain the above copyright
21       notice, this list of conditions and the following disclaimer.
22   
23    *  Redistributions in binary form must reproduce the above copyright
24       notice, this list of conditions and the following disclaimer in the
25       documentation and/or other materials provided with the distribution.
26   
27    *  Neither the name of Texas Instruments Incorporated nor the names of
28       its contributors may be used to endorse or promote products derived
29       from this software without specific prior written permission.
30   
31    THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
32    AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
33    THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
34    PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR
35    CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
36    EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
37    PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
38    OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
39    WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
40    OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
41    EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
42  ******************************************************************************
43  $Release Name: TI-15.4Stack Linux x64 SDK$
44  $Release Date: Sept 27, 2017 (2.04.00.13)$
45  *****************************************************************************/
46 #ifndef BOARD_LCD_H
47 #define BOARD_LCD_H
49 /******************************************************************************
50  Includes
51  *****************************************************************************/
52 #ifndef IS_HLOS
53 #include <ti/mw/lcd/LCDDogm1286.h>
54 #endif //!IS_HLOS
56 #ifdef __cplusplus
57 extern "C"
58 {
59 #endif
61 #ifndef IS_HLOS
63 /*!
64  \defgroup BoardLCD Board LCD Functions
65  <BR>
66  This module is a collection of functions to control the LCD.
67  <BR>
68  */
70 /*!
71  * \ingroup BoardLCD
72  * @{
73  */
75 #if defined(BOARD_DISPLAY_USE_LCD) && defined(BOARD_DISPLAY_USE_UART)
76 #error "can't enable both BOARD_DISPLAY_USE_LCD and BOARD_DISPLAY_USE_UART"
77 #endif
79 /*! LCD macros */
80 #if defined(BOARD_DISPLAY_USE_LCD) || defined(BOARD_DISPLAY_USE_UART)
81 /*! Macro definition to write a string to the LCD */
82 #define LCD_WRITE_STRING(str, line) Board_Lcd_writeString(str, line)
83 /*! Macro definition to write a string with a value to the LCD */
84 #define LCD_WRITE_STRING_VALUE(str, value, format, line) \
85     Board_Lcd_writeStringValue(str, value, format, line)
86 #else
87 /*! Macro definition to write a string to the LCD */
88 #define LCD_WRITE_STRING(str, line)
89 /*! Macro definition to write a string with a value to the LCD */
90 #define LCD_WRITE_STRING_VALUE(str, value, format, line)
91 #endif
93 /******************************************************************************
94  API Functions
95  *****************************************************************************/
97 #if defined(BOARD_DISPLAY_USE_LCD) || defined(BOARD_DISPLAY_USE_UART)
98 /*!
99  * @brief   Open LCD for launch pad only
100  */
101 extern void Board_LCD_open(void);
102 #else
103 #define Board_LCD_open()
104 #endif
106 /*!
107  * @brief   Write a string on the LCD display.
108  *
109  * @param   str - string to print
110  * @param   line - line (page) to write (0-7)
111  */
112 extern void Board_Lcd_writeString(char *str, uint8_t line);
114 /*!
115  * @brief   Write a string and value on the LCD display.
116  *
117  * @param   str - string to print
118  * @param   value - value to print
119  * @param   format - base of the value to print (2,8,16 etc)
120  * @param   line - line (page) to write (0-7)
121  */
122 extern void Board_Lcd_writeStringValue(char *str, uint16_t value,
123                                        uint8_t format,
124                                        uint8_t line);
126 #else //!IS_HLOS
128 #define Board_Lcd_printf(line, ...) \
129 /*move curser to line*/ \
130 fprintf(stderr,"\033[%d;0H", line+1); \
131 /*clear line */ \
132 fprintf(stderr,"\033[2K"); \
133 fprintf(stderr,__VA_ARGS__); \
134 fprintf(stderr,"\n");
136 #define Board_LCD_open() \
137 fprintf(stderr,"\033[2J");
139 #endif //!IS_HLOS
141 /*! @} end group BoardLCD */
143 #ifdef __cplusplus
145 #endif
147 #endif /* BOARD_LCD_H */