Rename up_nxdrvinit() to board_graphics_setup(). Add CONFIG_BOARDCTL_GRAPHICS that will enabled calls to board_graphics_setup() from boardctrl(). In apps/ and NxWidgts/, replace all calls to up_nxdrvinit with calls to boardctl().
This commit is contained in:
parent
074b57aa69
commit
256abd6dba
@ -909,11 +909,15 @@ examples/nx
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
This test can be performed with either the single-user version of
|
This test can be performed with either the single-user version of
|
||||||
NX or with the multiple user version of NX selected with CONFIG_NX_MULTIUSER.
|
NX or with the multiple user version of NX selected with CONFIG_NX_MULTIUSER.
|
||||||
If CONFIG_NX_MULTIUSER is defined, then the following configuration
|
If CONFIG_NX_MULTIUSER is defined, then the following configuration
|
||||||
@ -982,11 +986,15 @@ examples/nxterm
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
CONFIG_EXAMPLES_NXCON_MINOR -- The NX console device minor number.
|
CONFIG_EXAMPLES_NXCON_MINOR -- The NX console device minor number.
|
||||||
Default is 0 corresponding to /dev/nxterm0
|
Default is 0 corresponding to /dev/nxterm0
|
||||||
CONFIG_EXAMPLES_NXCON_DEVNAME -- The quoated, full path to the
|
CONFIG_EXAMPLES_NXCON_DEVNAME -- The quoated, full path to the
|
||||||
@ -1054,11 +1062,15 @@ examplex/nxhello
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
examples/nximage
|
examples/nximage
|
||||||
^^^^^^^^^^^^^^^^
|
^^^^^^^^^^^^^^^^
|
||||||
|
|
||||||
@ -1090,11 +1102,15 @@ examples/nximage
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
How was that run-length encoded image produced?
|
How was that run-length encoded image produced?
|
||||||
|
|
||||||
a. I used GIMP output the image as a .c file.
|
a. I used GIMP output the image as a .c file.
|
||||||
@ -1148,11 +1164,15 @@ examplex/nxlines
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
CONFIG_NSH_BUILTIN_APPS - Build the NX lines examples as an NSH built-in
|
CONFIG_NSH_BUILTIN_APPS - Build the NX lines examples as an NSH built-in
|
||||||
function.
|
function.
|
||||||
|
|
||||||
@ -1203,11 +1223,15 @@ examples/nxtext
|
|||||||
function with a prototype like:
|
function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
CONFIG_EXAMPLES_NXTEXT_BMCACHE - The maximum number of characters that
|
CONFIG_EXAMPLES_NXTEXT_BMCACHE - The maximum number of characters that
|
||||||
can be put in the background window. Default is 128.
|
can be put in the background window. Default is 128.
|
||||||
CONFIG_EXAMPLES_NXTEXT_GLCACHE - The maximum nuber of pre-rendered
|
CONFIG_EXAMPLES_NXTEXT_GLCACHE - The maximum nuber of pre-rendered
|
||||||
|
@ -99,11 +99,15 @@ config EXAMPLES_NX_EXTERNINIT
|
|||||||
must provide an LCD initialization function with a prototype like:
|
must provide an LCD initialization function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
if NX_MULTIUSER
|
if NX_MULTIUSER
|
||||||
comment "Multi-User Configuration Options"
|
comment "Multi-User Configuration Options"
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nx/nx_internal.h
|
* examples/nx/nx_internal.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -276,21 +276,17 @@ extern nxgl_mxpixel_t g_tbcolor[CONFIG_NX_NPLANES];
|
|||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NX_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
|
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
|
||||||
extern int nx_servertask(int argc, char *argv[]);
|
int nx_servertask(int argc, char *argv[]);
|
||||||
extern FAR void *nx_listenerthread(FAR void *arg);
|
FAR void *nx_listenerthread(FAR void *arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef CONFIG_NX_KBD
|
#ifdef CONFIG_NX_KBD
|
||||||
extern void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
|
void nxeg_kbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
|
||||||
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
|
#ifndef CONFIG_EXAMPLES_NX_RAWWINDOWS
|
||||||
extern void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
|
void nxeg_tbkbdin(NXWINDOW hwnd, uint8_t nch, const uint8_t *ch, FAR void *arg);
|
||||||
#endif
|
#endif
|
||||||
extern void nxeg_filltext(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
void nxeg_filltext(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
||||||
FAR struct nxeg_state_s *st);
|
FAR struct nxeg_state_s *st);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nx/nx_main.c
|
* examples/nx/nx_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,6 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/boardctl.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@ -426,10 +427,10 @@ static inline int nxeg_suinitialize(void)
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxeg_initialize: Initializing external graphics device\n");
|
printf("nxeg_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
|
printf("nxeg_initialize: boardctl failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
|
||||||
g_exitcode = NXEXIT_EXTINITIALIZE;
|
g_exitcode = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nx/nx_server.c
|
* examples/nx/nx_server.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2008-2009, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/boardctl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -92,10 +93,11 @@ int nx_servertask(int argc, char *argv[])
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxeg_initialize: Initializing external graphics device\n");
|
printf("nxeg_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NX_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NX_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxeg_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NX_DEVNO);
|
printf("nxeg_initialize: boardctl failed, devno=%d\n",
|
||||||
|
CONFIG_EXAMPLES_NX_DEVNO);
|
||||||
g_exitcode = NXEXIT_EXTINITIALIZE;
|
g_exitcode = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
@ -84,9 +84,13 @@ config EXAMPLES_NXHELLO_EXTERNINIT
|
|||||||
must provide an LCD initialization function with a prototype like:
|
must provide an LCD initialization function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
endif
|
endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxhello/nxhello.h
|
* examples/nxhello/nxhello.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -169,12 +169,8 @@ extern const struct nx_callback_s g_nxhellocb;
|
|||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NXHELLO_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Background window interfaces */
|
/* Background window interfaces */
|
||||||
|
|
||||||
extern void nxhello_hello(NXWINDOW hwnd);
|
void nxhello_hello(NXWINDOW hwnd);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_NXHELLO_NXHELLO_H */
|
#endif /* __APPS_EXAMPLES_NXHELLO_NXHELLO_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxhello/nxhello_main.c
|
* examples/nxhello/nxhello_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,6 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/boardctl.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -126,10 +127,10 @@ static inline int nxhello_initialize(void)
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxhello_initialize: Initializing external graphics device\n");
|
printf("nxhello_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXHELLO_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXHELLO_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxhello_initialize: up_nxdrvinit failed, devno=%d\n",
|
printf("nxhello_initialize: boardctl failed, devno=%d\n",
|
||||||
CONFIG_EXAMPLES_NXHELLO_DEVNO);
|
CONFIG_EXAMPLES_NXHELLO_DEVNO);
|
||||||
g_nxhello.code = NXEXIT_EXTINITIALIZE;
|
g_nxhello.code = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nximage/nximage.h
|
* examples/nximage/nximage.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -182,18 +182,14 @@ extern const struct nx_callback_s g_nximagecb;
|
|||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NXIMAGE_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Background window interfaces */
|
/* Background window interfaces */
|
||||||
|
|
||||||
extern void nximage_image(NXWINDOW hwnd);
|
void nximage_image(NXWINDOW hwnd);
|
||||||
|
|
||||||
/* Image interfaces */
|
/* Image interfaces */
|
||||||
|
|
||||||
extern nxgl_mxpixel_t nximage_bgcolor(void);
|
nxgl_mxpixel_t nximage_bgcolor(void);
|
||||||
extern nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
|
nxgl_mxpixel_t nximage_avgcolor(nxgl_mxpixel_t color1, nxgl_mxpixel_t color2);
|
||||||
extern void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
|
void nximage_blitrow(FAR nxgl_mxpixel_t *run, FAR const void **state);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_NXIMAGE_NXIMAGE_H */
|
#endif /* __APPS_EXAMPLES_NXIMAGE_NXIMAGE_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nximage/nximage_main.c
|
* examples/nximage/nximage_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -40,6 +40,7 @@
|
|||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
|
#include <sys/boardctl.h>
|
||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
@ -130,10 +131,10 @@ static inline int nximage_initialize(void)
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nximage_initialize: Initializing external graphics device\n");
|
printf("nximage_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXIMAGE_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXIMAGE_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nximage_initialize: up_nxdrvinit failed, devno=%d\n",
|
printf("nximage_initialize: boardctl failed, devno=%d\n",
|
||||||
CONFIG_EXAMPLES_NXIMAGE_DEVNO);
|
CONFIG_EXAMPLES_NXIMAGE_DEVNO);
|
||||||
g_nximage.code = NXEXIT_EXTINITIALIZE;
|
g_nximage.code = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
@ -90,10 +90,13 @@ config EXAMPLES_NXLINES_EXTERNINIT
|
|||||||
initialization function with a prototype like:
|
initialization function with a prototype like:
|
||||||
|
|
||||||
#ifdef NX_LCDDRIVER
|
#ifdef NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
endif
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
|
endif
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxlines/nxlines.h
|
* examples/nxlines/nxlines.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -166,12 +166,8 @@ extern const struct nx_callback_s g_nxlinescb;
|
|||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NXLINES_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Background window interfaces */
|
/* Background window interfaces */
|
||||||
|
|
||||||
extern void nxlines_test(NXWINDOW hwnd);
|
void nxlines_test(NXWINDOW hwnd);
|
||||||
|
|
||||||
#endif /* __APPS_EXAMPLES_NXLINES_NXLINES_H */
|
#endif /* __APPS_EXAMPLES_NXLINES_NXLINES_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxlines/nxlines_main.c
|
* examples/nxlines/nxlines_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -122,10 +122,10 @@ static inline int nxlines_initialize(void)
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxlines_initialize: Initializing external graphics device\n");
|
printf("nxlines_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXLINES_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXLINES_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxlines_initialize: up_nxdrvinit failed, devno=%d\n",
|
printf("nxlines_initialize: boardctl failed, devno=%d\n",
|
||||||
CONFIG_EXAMPLES_NXLINES_DEVNO);
|
CONFIG_EXAMPLES_NXLINES_DEVNO);
|
||||||
g_nxlines.code = NXEXIT_EXTINITIALIZE;
|
g_nxlines.code = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxterm/nxterm_internal.h
|
* examples/nxterm/nxterm_internal.h
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -276,15 +276,10 @@ extern const struct nx_callback_s g_nxtoolcb;
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
/* Board-specific driver intiialization */
|
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NXCON_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
/* Server thread support */
|
/* Server thread support */
|
||||||
|
|
||||||
extern int nxterm_server(int argc, char *argv[]);
|
int nxterm_server(int argc, char *argv[]);
|
||||||
extern FAR void *nxterm_listener(FAR void *arg);
|
FAR void *nxterm_listener(FAR void *arg);
|
||||||
|
|
||||||
#endif /* __EXAMPLES_NXTERM_NXCON_INTERNAL_H */
|
#endif /* __EXAMPLES_NXTERM_NXCON_INTERNAL_H */
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxterm/nxterm_server.c
|
* examples/nxterm/nxterm_server.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -39,6 +39,7 @@
|
|||||||
|
|
||||||
#include <nuttx/config.h>
|
#include <nuttx/config.h>
|
||||||
|
|
||||||
|
#include <sys/boardctl.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
@ -90,10 +91,11 @@ int nxterm_server(int argc, char *argv[])
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxterm_server: Initializing external graphics device\n");
|
printf("nxterm_server: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXCON_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXCON_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxterm_server: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXCON_DEVNO);
|
printf("nxterm_server: boardctl failed, devno=%d\n",
|
||||||
|
CONFIG_EXAMPLES_NXCON_DEVNO);
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -118,11 +118,15 @@ config EXAMPLES_NXTEXT_EXTERNINIT
|
|||||||
must provide an LCD initialization function with a prototype like:
|
must provide an LCD initialization function with a prototype like:
|
||||||
|
|
||||||
#ifdef CONFIG_NX_LCDDRIVER
|
#ifdef CONFIG_NX_LCDDRIVER
|
||||||
FAR struct lcd_dev_s *up_nxdrvinit(unsigned int devno);
|
FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno);
|
||||||
#else
|
#else
|
||||||
FAR struct fb_vtable_s *up_nxdrvinit(unsigned int devno);
|
FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
and must also define: CONFIG_LIB_BOARDCTL=y and
|
||||||
|
CONFIG_BOARDCTL_GRAPHICS=y so that the boardctl() interface
|
||||||
|
will be available in order to access this function.
|
||||||
|
|
||||||
if NX_MULTIUSER
|
if NX_MULTIUSER
|
||||||
|
|
||||||
comment "Multi-User Configuration Options"
|
comment "Multi-User Configuration Options"
|
||||||
|
@ -315,31 +315,28 @@ extern int g_exitcode;
|
|||||||
* Public Function Prototypes
|
* Public Function Prototypes
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
#ifdef CONFIG_EXAMPLES_NXTEXT_EXTERNINIT
|
|
||||||
extern FAR NX_DRIVERTYPE *up_nxdrvinit(unsigned int devno);
|
|
||||||
#endif
|
|
||||||
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
|
#if defined(CONFIG_NX) && defined(CONFIG_NX_MULTIUSER)
|
||||||
extern int nxtext_server(int argc, char *argv[]);
|
int nxtext_server(int argc, char *argv[]);
|
||||||
extern FAR void *nxtext_listener(FAR void *arg);
|
FAR void *nxtext_listener(FAR void *arg);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Background window interfaces */
|
/* Background window interfaces */
|
||||||
|
|
||||||
extern FAR struct nxtext_state_s *nxbg_getstate(void);
|
FAR struct nxtext_state_s *nxbg_getstate(void);
|
||||||
extern void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
|
void nxbg_write(NXWINDOW hwnd, FAR const uint8_t *buffer, size_t buflen);
|
||||||
|
|
||||||
/* Pop-up window interfaces */
|
/* Pop-up window interfaces */
|
||||||
|
|
||||||
extern NXWINDOW nxpu_open(void);
|
NXWINDOW nxpu_open(void);
|
||||||
extern int nxpu_close(NXWINDOW hwnd);
|
int nxpu_close(NXWINDOW hwnd);
|
||||||
|
|
||||||
/* Generic text helpers */
|
/* Generic text helpers */
|
||||||
|
|
||||||
extern void nxtext_home(FAR struct nxtext_state_s *st);
|
void nxtext_home(FAR struct nxtext_state_s *st);
|
||||||
extern void nxtext_newline(FAR struct nxtext_state_s *st);
|
void nxtext_newline(FAR struct nxtext_state_s *st);
|
||||||
extern void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
|
void nxtext_putc(NXWINDOW hwnd, FAR struct nxtext_state_s *st,
|
||||||
NXHANDLE hfont, uint8_t ch);
|
NXHANDLE hfont, uint8_t ch);
|
||||||
extern void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
void nxtext_fillchar(NXWINDOW hwnd, FAR const struct nxgl_rect_s *rect,
|
||||||
FAR struct nxtext_state_s *st, NXHANDLE hfont,
|
FAR struct nxtext_state_s *st, NXHANDLE hfont,
|
||||||
FAR const struct nxtext_bitmap_s *bm);
|
FAR const struct nxtext_bitmap_s *bm);
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxtext/nxtext_main.c
|
* examples/nxtext/nxtext_main.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -168,10 +168,11 @@ static inline int nxtext_suinitialize(void)
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxtext_initialize: Initializing external graphics device\n");
|
printf("nxtext_initialize: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxtext_initialize: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
printf("nxtext_initialize: boardctl failed, devno=%d\n",
|
||||||
|
CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
||||||
g_exitcode = NXEXIT_EXTINITIALIZE;
|
g_exitcode = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
/****************************************************************************
|
/****************************************************************************
|
||||||
* examples/nxtext/nxtext_server.c
|
* examples/nxtext/nxtext_server.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2011-2012 Gregory Nutt. All rights reserved.
|
* Copyright (C) 2011-2012, 2015 Gregory Nutt. All rights reserved.
|
||||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||||
*
|
*
|
||||||
* Redistribution and use in source and binary forms, with or without
|
* Redistribution and use in source and binary forms, with or without
|
||||||
@ -92,10 +92,11 @@ int nxtext_server(int argc, char *argv[])
|
|||||||
/* Use external graphics driver initialization */
|
/* Use external graphics driver initialization */
|
||||||
|
|
||||||
printf("nxtext_server: Initializing external graphics device\n");
|
printf("nxtext_server: Initializing external graphics device\n");
|
||||||
dev = up_nxdrvinit(CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
dev = boardctl(BOARDIOC_GRAPHICS_SETUP, CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
||||||
if (!dev)
|
if (!dev)
|
||||||
{
|
{
|
||||||
printf("nxtext_server: up_nxdrvinit failed, devno=%d\n", CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
printf("nxtext_server: boardctl failed, devno=%d\n",
|
||||||
|
CONFIG_EXAMPLES_NXTEXT_DEVNO);
|
||||||
g_exitcode = NXEXIT_EXTINITIALIZE;
|
g_exitcode = NXEXIT_EXTINITIALIZE;
|
||||||
return ERROR;
|
return ERROR;
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user