versadac  1
versadac - Scalable Recorder Firmware
ui_interface.h
1 #ifndef UI_INTERFACE_H
2 #define UI_INTERFACE_H
3 
4 #include "stdtypes.h"
5 #include "template.h"
6 
7 
8 #define RGB24TORGB16(x) \
9  ((((x) & 0x00F80000) >> 8) + \
10  (((x) & 0x0000FC00) >> 5) + \
11  (((x) & 0x000000F8) >> 3))
12 
13 
14 #define RGB16TORGB24(x) \
15  (((x & 0x001F) << 3) | ((x & 0x001C) >> 2) | \
16  ((x & 0x07E0) << 5) | ((x & 0x0600) >> 1) | \
17  ((x & 0xF800) << 8) | ((x & 0xE000) << 3))
18 
19 
20 
21 /* Colour format defined as RGB565 (16bit) */
22 typedef unsigned short color_t;
23 
24 /* Define the value passed to the callback function */
25 typedef enum
26 {
27  FE_NO_FILE_SELECTED, // The file explorer was closed without selecting a file
28  FE_FILE_SELECTED, // The file explorer returns the name of selected item using fe_options.filename
29  FE_NEW_FILE, // The file explorer selected "New File" - the VK is then used to enter a name which is returned via the fe_options.filename
30  FE_OVERWRITE_FILE // Returned when an existing file has been selected and overwrite acknoeldged
31 } fe_callback_types_t;
32 
33 
34 /* Public definitions */
35 #define GREY_90 RGB24TORGB16(0xE5E5E5) // Almost white
36 #define GREY_10 RGB24TORGB16(0x373737) // Almost black
37 
38 #define CHARCOAL_DARK RGB24TORGB16(0x202020)
39 #define CHARCOAL RGB24TORGB16(0x404040)
40 #define MID_GREY RGB24TORGB16(0x808080)
41 #define LIGHT_GREY RGB24TORGB16(0xC0C0C0)
42 #define BLACK RGB24TORGB16(0x000000)
43 #define WHITE RGB24TORGB16(0xFFFFFF)
44 #define RED RGB24TORGB16(0xFF0000)
45 #define GREEN RGB24TORGB16(0x00FF00)
46 #define BLUE RGB24TORGB16(0x0000FF)
47 #define MID_BLUE RGB24TORGB16(0x000080)
48 #define CYAN RGB24TORGB16(0x00FFFF)
49 #define MAGENTA RGB24TORGB16(0xFF00FF)
50 #define YELLOW RGB24TORGB16(0xFFFF00)
51 #define ORANGE RGB24TORGB16(0xEE9515)
52 #define DARK_GREEN RGB24TORGB16(0x009900)
53 #define GREEN_30 RGB24TORGB16(0x004C00)
54 
55 
56 /* Gradient equivelants of the 6 channel colours */
57 #define RED_FROM RGB24TORGB16(0xFF2D2D)
58 #define RED_TO RGB24TORGB16(0xB60000)
59 #define GREEN_FROM RGB24TORGB16(0xFF2D2D)
60 #define GREEN_TO RGB24TORGB16(0xB60000)
61 #define BLUE_FROM RGB24TORGB16(0xFF2D2D)
62 #define BLUE_TO RGB24TORGB16(0xB60000)
63 #define CYAN_FROM RGB24TORGB16(0xFF2D2D)
64 #define CYAN_TO RGB24TORGB16(0xB60000)
65 #define MAGENTA_FROM RGB24TORGB16(0xFF2D2D)
66 #define MAGENTA_TO RGB24TORGB16(0xB60000)
67 #define YELLOW_FROM RGB24TORGB16(0xFF2D2D)
68 #define YELLOW_TO RGB24TORGB16(0xB60000)
69 
70 
71 /* File explorer options - can be combined together */
72 #define FE_OPTIONS_INTERNAL 1
73 #define FE_OPTIONS_USB 2
74 #define FE_OPTIONS_FTP 4
75 #define FE_OPTIONS_DIRECTORIES_ONLY 8
76 #define FE_OPTIONS_INCLUDE_NEW_FILE 16
77 #define FE_OPTIONS_CONFIRMATION 32 // Add this option to bring up a dialog "Are you sure?" if selecting an existing file
78 #define FE_OPTIONS_COPY 64
79 #define FE_OPTIONS_COPY_ALL 128
80 
81 
82 /* Public functions */
83 void ui_goto_home_page (void);
84 void ui_force_cmenu_update (void);
85 void ui_show_clone_exception (uint16 z_exception);
86 void ui_force_feature_security_update (void);
87 void ui_select_password_field (void);
88 void ui_force_page_reinitialise (void);
89 void ui_horizontal_trend_redraw_scale (void);
90 void ui_invoke_file_explorer (unicode_p z_path, unicode_p z_filename, uint8 z_options, char* z_ext, void (*callback)(fe_callback_types_t));
91 void ui_invoke_virtual_keyboard (CISP_t z_cisp);
92 void PLATE_display_test (uint8 z_mode);
93 
94 
95 #endif /* UI_INTERFACE_H */