diff options
author | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 16:20:21 -0600 |
---|---|---|
committer | Gregory Nutt <gnutt@nuttx.org> | 2015-03-31 16:20:21 -0600 |
commit | 1aa554ab19210a162ab3ba7f8a635b1f11586aa2 (patch) | |
tree | 32eded82fe4e2e27796081de9c73f57613d1a322 /nuttx/include | |
parent | 89e6ac65fdaef533a95ad504bb18ec50c9cd977f (diff) | |
download | px4-nuttx-1aa554ab19210a162ab3ba7f8a635b1f11586aa2.tar.gz px4-nuttx-1aa554ab19210a162ab3ba7f8a635b1f11586aa2.tar.bz2 px4-nuttx-1aa554ab19210a162ab3ba7f8a635b1f11586aa2.zip |
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().
Diffstat (limited to 'nuttx/include')
-rw-r--r-- | nuttx/include/nuttx/board.h | 23 | ||||
-rw-r--r-- | nuttx/include/sys/boardctl.h | 29 |
2 files changed, 51 insertions, 1 deletions
diff --git a/nuttx/include/nuttx/board.h b/nuttx/include/nuttx/board.h index 80ec312c6..643a164c0 100644 --- a/nuttx/include/nuttx/board.h +++ b/nuttx/include/nuttx/board.h @@ -208,6 +208,29 @@ void board_tsc_teardown(void); int board_adc_setup(void); /**************************************************************************** + * Name: board_graphics_setup + * + * Description: + * If the driver for the graphics device on the platform some unusual + * initialization, then this board interface should be provided. + * + * This is an internal OS interface but may be invoked indirectly from + * application-level graphics logic. If CONFIG_LIB_BOARDCTL=y and + * CONFIG_BOARDCTL_GRAPHICS=y, then this functions will be invoked via the + * (non-standard) boardctl() interface using the commands + * BOARDIOC_GRAPHICS_SETUP command. + * + ****************************************************************************/ + +#ifdef CONFIG_NX_LCDDRIVER +struct lcd_dev_s; +FAR struct lcd_dev_s *board_graphics_setup(unsigned int devno); +#else +struct fb_vtable_s; +FAR struct fb_vtable_s *board_graphics_setup(unsigned int devno); +#endif + +/**************************************************************************** * Name: board_ioctl * * Description: diff --git a/nuttx/include/sys/boardctl.h b/nuttx/include/sys/boardctl.h index 8da574ec3..5b6741570 100644 --- a/nuttx/include/sys/boardctl.h +++ b/nuttx/include/sys/boardctl.h @@ -76,12 +76,19 @@ * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_ADCTEST * DEPENDENCIES: Board logic must provide board_adc_setup() * + * CMD: BOARDIOC_GRAPHICS_SETUP + * DESCRIPTION: Configure graphics that require special initialization + * procedures + * ARG: A pointer to an instance of struct boardioc_graphics_s + * CONFIGURATION: CONFIG_LIB_BOARDCTL && CONFIG_BOARDCTL_GRAPHICS + * DEPENDENCIES: Board logic must provide board_adc_setup() */ #define BOARDIOC_INIT _BOARDIOC(0x0001) #define BOARDIOC_TSCTEST_SETUP _BOARDIOC(0x0002) #define BOARDIOC_TSCTEST_TEARDOWN _BOARDIOC(0x0003) #define BOARDIOC_ADCTEST_SETUP _BOARDIOC(0x0004) +#define BOARDIOC_GRAPHICS_SETUP _BOARDIOC(0x0005) /* If CONFIG_BOARDCTL_IOCTL=y, then boad-specific commands will be support. * In this case, all commands not recognized by boardctl() will be forwarded @@ -90,12 +97,32 @@ * User defined board commands may begin with this value: */ -#define BOARDIOC_USER _BOARDIOC(0x0005) +#define BOARDIOC_USER _BOARDIOC(0x0006) /**************************************************************************** * Public Type Definitions ****************************************************************************/ +/* Structure used to pass arguments and get returned values from the + * BOARDIOC_GRAPHICS_SETUP command. + */ + +#ifdef CONFIG_NX_LCDDRIVER +struct lcd_dev_s; /* Forward reference */ +#else +struct fb_vtable_s; /* Forward reference */ +#endif + +struct boardioc_graphics_s +{ + int devno; /* IN: Graphics device number */ +#ifdef CONFIG_NX_LCDDRIVER + FAR struct lcd_dev_s *dev; /* OUT: LCD driver instance */ +#else + FAR struct fb_vtable_s *dev; /* OUT: Framebuffer driver instance */ +#endif +}; + /**************************************************************************** * Public Function Prototypes ****************************************************************************/ |