EFR32 Mighty Gecko 1 Software Documentation  efr32mg1-doc-5.1.2
textdisplay.h
Go to the documentation of this file.
1 /**************************************************************************/
18 #ifndef _TEXTDISPLAY_H_
19 #define _TEXTDISPLAY_H_
20 
21 #include <stdbool.h>
22 #include "emstatus.h"
23 
24 /***************************************************************************/
29 /***************************************************************************/
34 #ifdef __cplusplus
35 extern "C" {
36 #endif
37 
38 /*******************************************************************************
39  ******************************** DEFINES ************************************
40  ******************************************************************************/
41 
43 #define TEXTDISPLAY_EMSTATUS_OK (0)
44 #define TEXTDISPLAY_EMSTATUS_INVALID_PARAM (TEXTDISPLAY_EMSTATUS_BASE | 1)
45 #define TEXTDISPLAY_EMSTATUS_OUT_OF_RANGE (TEXTDISPLAY_EMSTATUS_BASE | 2)
46 #define TEXTDISPLAY_EMSTATUS_ALREADY_INITIALIZED (TEXTDISPLAY_EMSTATUS_BASE | 3)
47 #define TEXTDISPLAY_EMSTATUS_NOT_SUPPORTED (TEXTDISPLAY_EMSTATUS_BASE | 4)
48 #define TEXTDISPLAY_EMSTATUS_NOT_ENOUGH_MEMORY (TEXTDISPLAY_EMSTATUS_BASE | 5)
49 #define TEXTDISPLAY_EMSTATUS_NOT_INITIALIZED (TEXTDISPLAY_EMSTATUS_BASE | 6)
53 #ifdef INCLUDE_VIDEO_TERMINAL_ESCAPE_SEQUENCE_SUPPORT
54 #define TEXTDISPLAY_ESC_SEQ_CURSOR_HOME_VT100 "\033[H"
55 #define TEXTDISPLAY_ESC_SEQ_CURSOR_HOME_VT52 "\033H"
56 #define TEXTDISPLAY_ESC_SEQ_CURSOR_UP_ONE_LINE "\033A"
57 #define TEXTDISPLAY_ESC_SEQ_CURSOR_DOWN_ONE_LINE "\033B"
58 #define TEXTDISPLAY_ESC_SEQ_CURSOR_RIGHT_ONE_CHAR "\033C"
59 #define TEXTDISPLAY_ESC_SEQ_CURSOR_LEFT_ONE_CHAR "\033D"
60 #endif
61 
62 
63 /*******************************************************************************
64  ******************************* STRUCTS ***********************************
65  ******************************************************************************/
66 
68 typedef void* TEXTDISPLAY_Handle_t;
69 
71 typedef struct TEXTDISPLAY_Config_t
72 {
75  bool scrollEnable;
80  bool lfToCrLf;
82 
83 
84 /*******************************************************************************
85  ************************** FUNCTION PROTOTYPES **************************
86  ******************************************************************************/
87 
88 EMSTATUS TEXTDISPLAY_New (TEXTDISPLAY_Config_t *config,
89  TEXTDISPLAY_Handle_t *handle);
90 EMSTATUS TEXTDISPLAY_Delete (TEXTDISPLAY_Handle_t handle);
91 EMSTATUS TEXTDISPLAY_WriteChar (TEXTDISPLAY_Handle_t handle,
92  char c);
93 EMSTATUS TEXTDISPLAY_WriteString (TEXTDISPLAY_Handle_t handle,
94  const char* str);
95 EMSTATUS TEXTDISPLAY_LfToCrLf (TEXTDISPLAY_Handle_t handle,
96  bool on);
97 
98 #ifdef __cplusplus
99 }
100 #endif
101 
105 #endif /* _TEXTDISPLAY_H_ */
struct TEXTDISPLAY_Config_t TEXTDISPLAY_Config_t
EMSTATUS TEXTDISPLAY_New(TEXTDISPLAY_Config_t *config, TEXTDISPLAY_Handle_t *handle)
Create a new text display device.
Definition: textdisplay.c:210
EMSTATUS TEXTDISPLAY_WriteString(TEXTDISPLAY_Handle_t handle, const char *str)
Write a string of characters to a text display.
Definition: textdisplay.c:454
EMSTATUS definitions.
EMSTATUS TEXTDISPLAY_LfToCrLf(TEXTDISPLAY_Handle_t handle, bool on)
Enable or disable LF to CR+LF conversion.
Definition: textdisplay.c:361
void * TEXTDISPLAY_Handle_t
Definition: textdisplay.h:68
EMSTATUS TEXTDISPLAY_WriteChar(TEXTDISPLAY_Handle_t handle, char c)
Write a single character to a text display.
Definition: textdisplay.c:381
EMSTATUS TEXTDISPLAY_Delete(TEXTDISPLAY_Handle_t handle)
Delete a text display device.
Definition: textdisplay.c:322