Standardize framebuffer APIs

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@1330 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2008-11-28 17:55:04 +00:00
parent 622b04229c
commit 87e58c952e
3 changed files with 100 additions and 49 deletions

View File

@ -1357,6 +1357,10 @@ static int dm320_setcursor(FAR struct fb_vtable_s *vtable, FAR struct fb_setcurs
/****************************************************************************
* Name: up_fbinitialize
*
* Description:
* Initialize the video hardware
*
****************************************************************************/
int up_fbinitialize(void)
@ -1379,46 +1383,43 @@ int up_fbinitialize(void)
}
/****************************************************************************
* Name: up_getvid0vtable
****************************************************************************/
* Name: up_fbgetvplane
*
* Description:
* Return a a reference to the framebuffer object for the specified video plane.
*
* Input parameters:
* None
*
* Returned value:
* Reference to the framebuffer object (NULL on failure)
*
***************************************************************************/
FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
{
switch (vplane)
{
#ifndef CONFIG_DM320_VID0_DISABLE
FAR struct fb_vtable_s up_getvid0vtable(void)
{
return g_vid0vtable;
}
case DM320_VIDWIN0: /* VID0 window */
return &g_vid0vtable;
#endif
/****************************************************************************
* Name: up_getvid1vtable
****************************************************************************/
#ifndef CONFIG_DM320_VID1_DISABLE
FAR struct fb_vtable_s up_getvid1vtable(void)
{
return g_vid1vtable;
}
case DM320_VIDWIN1: /* VID1 window */
return &g_vid1vtable;
#endif
/****************************************************************************
* Name: up_getosd0vtable
****************************************************************************/
#ifndef CONFIG_DM320_OSD0_DISABLE
FAR struct fb_vtable_s up_getosd0vtable(void)
{
return g_osd0vtable;
}
case DM320_OSDWIN0: /* OSD2 window */
return &g_osd0vtable;
#endif
/****************************************************************************
* Name: up_getosd1vtable
****************************************************************************/
#ifndef CONFIG_DM320_OSD1_DISABLE
FAR struct fb_vtable_s up_getosd1vtable(void)
{
return g_osd1vtable;
case DM320_OSDWIN1: /* OSD2 window */
return &g_osd1vtable;
#endif
default:
break;
}
return NULL;
}
#endif
@ -1426,7 +1427,7 @@ FAR struct fb_vtable_s up_getosd1vtable(void)
* Name: up_fbteardown
****************************************************************************/
void cleanup_module(void)
void fb_teardown(void)
{
/* Disable the hardware */

View File

@ -336,10 +336,23 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable,
****************************************************************************/
/****************************************************************************
* Name: up_getfbobject
* Name: up_fbinitialize
*
* Description:
* Get a reference to the framebuffer object
* Initialize the video hardware
*
****************************************************************************/
int up_fbinitialize(void)
{
return OK;
}
/****************************************************************************
* Name: up_fbgetvplane
*
* Description:
* Return a a reference to the framebuffer object for the specified video plane.
*
* Input parameters:
* None
@ -347,9 +360,25 @@ static int up_setcursor(FAR struct fb_vtable_s *vtable,
* Returned value:
* Reference to the framebuffer object (NULL on failure)
*
***************************************************************************/
FAR struct fb_vtable_s *up_fbgetvplane(int vplane)
{
if (vplane == 0)
{
return &g_fbobject;
}
else
{
return NULL;
}
}
/****************************************************************************
* Name: up_fbteardown
****************************************************************************/
FAR const struct fb_vtable_s *up_getfbobject(void)
void fb_uninitialize(void)
{
return &g_fbobject;
}

View File

@ -432,6 +432,39 @@ EXTERN void up_disable_irq(int irq);
EXTERN int up_prioritize_irq(int irq, int priority);
#endif
/****************************************************************************
* Name: up_mdelay and up_udelay
*
* Description:
* Some device drivers may require that the plaform-specific logic
* provide these timing loops for short delays.
*
***************************************************************************/
EXTERN void up_mdelay(unsigned int milliseconds);
EXTERN void up_udelay(unsigned int microseconds);
/****************************************************************************
* Name: up_fbinitialize, up_fbuninitialize, up_fbgetvplane
*
* Description:
* If an architecture supports a framebuffer, then it must provide APIs
* to access the framebuffer as follows:
*
* up_fbinitialize - Initialize the video hardware
* up_fbgetvplane - Return a a reference to the framebuffer object for
* the specified video plane. Most OSDs support
* multiple planes of video.
* up_fbuninitialize - Unitialize the framebuffer support
*
***************************************************************************/
struct fb_vtable_s; /* See nuttx/fb.h */
EXTERN int up_fbinitialize(void);
EXTERN FAR struct fb_vtable_s *up_fbgetvplane(int vplane);
EXTERN void fb_uninitialize(void);
/****************************************************************************
* These are standard interfaces that are exported by the OS
* for use by the architecture specific logic
@ -463,18 +496,6 @@ EXTERN void sched_process_timer(void);
EXTERN void irq_dispatch(int irq, FAR void *context);
/****************************************************************************
* Name: up_mdelay and up_udelay
*
* Description:
* Some device drivers may require that the plaform-specific logic
* provide these timing loops for short delays.
*
***************************************************************************/
EXTERN void up_mdelay(unsigned int milliseconds);
EXTERN void up_udelay(unsigned int microseconds);
/****************************************************************************
* Debug interfaces exported by the architecture-specific logic
****************************************************************************/