configs/boardctl.c and include/sys/boardctl.h: Add support for BOARDIOC_NXTERM which can be used to create an NxTerm terminal.

This commit is contained in:
Gregory Nutt
2019-03-06 09:17:19 -06:00
parent c8004c7e00
commit ddf7f32158
3 changed files with 109 additions and 4 deletions
+34 -2
View File
@@ -45,6 +45,10 @@
#include <nuttx/fs/ioctl.h>
#ifdef CONFIG_NXTERM
# include <nuttx/nx/nxterm.h>
#endif
#ifdef CONFIG_LIB_BOARDCTL
/****************************************************************************
@@ -115,6 +119,14 @@
* CONFIGURATION: CONFIG_NX
* DEPENDENCIES: Base graphics logic provides nxmu_start()
*
* CMD: BOARDIOC_NXTERM
* DESCRIPTION: Create an NX terminal device
* ARG: A reference readable/writable instance of struct
* boardioc_nxterm_create_s
* CONFIGURATION: CONFIG_NXTERM
* DEPENDENCIES: Base NX terminal logic provides nx_register() and
* nxtk_register()
*
* CMD: BOARDIOC_TESTSET
* DESCRIPTION: Access architecture-specific up_testset() operation
* ARG: A pointer to a write-able spinlock object. On success
@@ -133,7 +145,8 @@
#define BOARDIOC_OS_SYMTAB _BOARDIOC(0x0007)
#define BOARDIOC_USBDEV_CONTROL _BOARDIOC(0x0008)
#define BOARDIOC_NX_START _BOARDIOC(0x0009)
#define BOARDIOC_TESTSET _BOARDIOC(0x000a)
#define BOARDIOC_NXTERM _BOARDIOC(0x000a)
#define BOARDIOC_TESTSET _BOARDIOC(0x000b)
/* If CONFIG_BOARDCTL_IOCTL=y, then board-specific commands will be support.
* In this case, all commands not recognized by boardctl() will be forwarded
@@ -142,7 +155,7 @@
* User defined board commands may begin with this value:
*/
#define BOARDIOC_USER _BOARDIOC(0x000b)
#define BOARDIOC_USER _BOARDIOC(0x000c)
/****************************************************************************
* Public Type Definitions
@@ -240,6 +253,25 @@ struct boardioc_usbdev_ctrl_s
};
#endif /* CONFIG_BOARDCTL_USBDEVCTRL */
#ifdef CONFIG_NXTERM
enum boardioc_termtype_e
{
BOARDIOC_XTERM_RAW = 0, /* Raw NX terminal window */
BOARDIOC_XTERM_FRAMED, /* Framed NxTK terminal window */
BOARDIOC_XTERM_TOOLBAR /* Tooolbar of framed NxTK terminal window */
};
struct boardioc_nxterm_create_s
{
NXTERM nxterm; /* Returned NXTERM handle */
FAR void *hwnd; /* Window handle (NXWINDOW or NXTKWINDOW). */
struct nxterm_window_s wndo; /* Describes the initial window: color, size, font */
enum boardioc_termtype_e type; /* Terminal window type */
uint8_t minor; /* Terminal device minor number, N, in
* /dev/nxtermN. 0 <= N <= 255 */
};
#endif /* CONFIG_NXTERM */
/****************************************************************************
* Public Data
****************************************************************************/