mirror of
https://github.com/apache/nuttx.git
synced 2026-06-07 09:18:00 +08:00
Generalize graphics driver type
git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@2597 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
@@ -65,6 +65,7 @@ struct lcd_planeinfo_s
|
||||
int (*putrun)(struct lcd_dev_s *dev, unsigned int planeno,
|
||||
fb_coord_t row, fb_coord_t col, FAR const uint8_t *buffer,
|
||||
size_t npixels);
|
||||
|
||||
int (*getrun)(struct lcd_dev_s *dev, unsigned int planeno,
|
||||
fb_coord_t row, fb_coord_t col, FAR uint8_t *buffer,
|
||||
size_t npixels);
|
||||
|
||||
+23
-7
@@ -1,7 +1,7 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/nx.h
|
||||
*
|
||||
* Copyright (C) 2008-2009 Gregory Nutt. All rights reserved.
|
||||
* Copyright (C) 2008-2010 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <spudmonkey@racsa.co.cr>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
@@ -44,7 +44,13 @@
|
||||
|
||||
#include <stdint.h>
|
||||
#include <stdbool.h>
|
||||
#include <nuttx/fb.h>
|
||||
|
||||
#ifdef CONFIG_NX_LCDDRIVER
|
||||
# include <nuttx/lcd.h>
|
||||
#else
|
||||
# include <nuttx/fb.h>
|
||||
#endif
|
||||
|
||||
#include <nuttx/nxglib.h>
|
||||
|
||||
/****************************************************************************
|
||||
@@ -62,6 +68,16 @@
|
||||
#define NX_MOUSE_CENTERBUTTON 0x02
|
||||
#define NX_MOUSE_RIGHTBUTTON 0x04
|
||||
|
||||
/* NX_DRIVERTYPE selects either the framebuffer or LCD driver. A define is
|
||||
* used instead of a typedef to avoid type mismatches.
|
||||
*/
|
||||
|
||||
#ifdef CONFIG_NX_LCDDRIVER
|
||||
# define NX_DRIVERTYPE struct lcd_dev_s
|
||||
#else
|
||||
# define NX_DRIVERTYPE struct fb_vtable_s
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* Public Types
|
||||
****************************************************************************/
|
||||
@@ -215,7 +231,7 @@ extern "C" {
|
||||
*
|
||||
* Input Parameters:
|
||||
* mqname - The name for the server incoming message queue
|
||||
* fb - Vtable "object" of the framebuffer "driver" to use
|
||||
* dev - Vtable "object" of the framebuffer "driver" to use
|
||||
*
|
||||
* Return:
|
||||
* This function usually does not return. If it does return, it will
|
||||
@@ -224,8 +240,8 @@ extern "C" {
|
||||
****************************************************************************/
|
||||
|
||||
#ifdef CONFIG_NX_MULTIUSER
|
||||
EXTERN int nx_runinstance(FAR const char *mqname, FAR struct fb_vtable_s *fb);
|
||||
# define nx_run(fb) nx_runinstance(NX_DEFAULT_SERVER_MQNAME, fb)
|
||||
EXTERN int nx_runinstance(FAR const char *mqname, FAR NX_DRIVERTYPE *dev);
|
||||
# define nx_run(dev) nx_runinstance(NX_DEFAULT_SERVER_MQNAME, dev)
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
@@ -273,7 +289,7 @@ EXTERN NXHANDLE nx_connectinstance(FAR const char *svrmqname);
|
||||
* Single user mode only!
|
||||
*
|
||||
* Input Parameters:
|
||||
* fb - Vtable "object" of the framebuffer "driver" to use
|
||||
* dev - Vtable "object" of the framebuffer/LCD "driver" to use
|
||||
* cb - Callbacks used to process received NX server messages
|
||||
*
|
||||
* Return:
|
||||
@@ -283,7 +299,7 @@ EXTERN NXHANDLE nx_connectinstance(FAR const char *svrmqname);
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_NX_MULTIUSER
|
||||
EXTERN NXHANDLE nx_open(FAR struct fb_vtable_s *fb);
|
||||
EXTERN NXHANDLE nx_open(FAR NX_DRIVERTYPE *dev);
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
|
||||
Reference in New Issue
Block a user