inc/framebuffer.h File Reference

This file contains enums, and function prototypes for Frame Buffer Nuggets. More...

#include "isrDisp.h"

Include dependency graph for framebuffer.h:

This graph shows which files directly or indirectly include this file:


Data Structures

struct  fb_t
 fb_t structure More...

Defines

#define RGB888toRGB565(r, g, b)
#define RGB5A1toRGB565(color)
#define RGB5A1isTransparent(color)   (color & 0x1)
#define RGB565toBGR565(color)
#define QVGA_WIDTH   320
#define QVGA_HEIGHT   240
#define FB_NUM_BUFFERS   3
#define QVGA_TESTPATTERN_HEIGHT   30

Enumerations

enum  pixel_format { RGB565 = 0, YUYV422 = 1 }
 Enumeration of the supported pixel formats. More...
enum  image_type { TEST_PATTERN = 0, PAINTED_IMAGE = 1, CUSTOM = 2 }
 Enumeration of the supported image type. More...
enum  fb_device_type { LQ035Q1DH02 = 0 }
 Enumeration of the supported Display Scrrens. More...

Functions

int fb_Init (fb_t *state, int devicenumber, enum fb_device_type devicetype, enum pixel_format pixFormat, isrDisp_t *pIsrDisp)
 Initialize the Frame Buffer System.
int fb_imageShow (fb_t *state)
 Image Display.
int fb_imageShowComplete (fb_t *state)
 Image Display Complete.
int fb_slackGet (fb_t *state)
 Slack Get.
int fb_statsGet (fb_t *state, unsigned int *nrUpdates, unsigned int *nrSame)
 statistic get
int fb_pixelPut (fb_t *state, unsigned char red, unsigned char green, unsigned char blue, unsigned short x_pos, unsigned short y_pos)
 Pixel Plot.
unsigned int fb_colorTargetGet (fb_t *state, unsigned char red, unsigned char green, unsigned char blue)
 return color in target format of display
void fb_pixelPutRaw (fb_t *state, unsigned int color, unsigned short x_pos, unsigned short y_pos)
 Pixel Plot.
int fb_qvgaRgb565TestPatternCreate (fb_t *state)
 function to fill color bar pattern
int fb_passiveBufferGet (fb_t *state, unsigned short **passiveBuffer)
 find passive buffer
int fb_Release (fb_t *state)
 Release the FB System.
int bb_Init (fb_t *state)
 Initialize the Background Buffer System.
int bb_pixelPut (unsigned char red, unsigned char green, unsigned char blue, unsigned short x_pos, unsigned short y_pos)
 Background Pixel Plot.
void bb_pixelPutRaw (unsigned int color, unsigned short x_pos, unsigned short y_pos)
 Background Pixel Plot.
int bb_imageShow (unsigned short *displayBuffer)
 Background Image Display.
int bb_imageCommit ()
 Background Image Commit.
int bb_isReady ()
 Background MDMA Ready.
int bb_clearPassive ()
 Passive Buffer Clear.
void bb_imageWaitForReady ()
 Block until we are sure that the MDMA has finished copying the background for the provided foreground buffer.

Detailed Description

This file contains enums, and function prototypes for Frame Buffer Nuggets.

Version:
1.5
Date:
20120331
Author:
C. Lavania
XqJv Copyright(c) 2010-2012 The Learning Labs,Inc. All Rights Reserved jVkB

Organization: The Learning Labs

Tested: Compiler bfin-elf-gcc; Output format Bare Metal Elf; Target TLL6527M V1.2

Revised: 20120331, Author: C. Lavania, Notes: Cleaned Up

Revised: 20120328, Author: C. Lavania, Notes: Added macros for QVGA width and QVGA height, and test pattern height

Revised: 20120327, Author: C. Lavania, Notes: Modified state structure and exposed function interface, introduced new functions for test pattern generation and providing user with the passive buffer.

Revised: 20120322, Author: C. Lavania, Notes: Cleaned Up

Revised: 20120321, Author: C. Lavania, Notes: Modified state structure and added the screen buffer to it, modified fb_Init() and fb_imageShow() prototypes.

Created: 20120317, Author: C. Lavania, Notes: Created the Initial Version

References:

1. ADSP-BF52x Blackfin Processor Hardware Reference, Revision 1.0, March 2010


Define Documentation

#define FB_NUM_BUFFERS   3

#define QVGA_HEIGHT   240

#define QVGA_TESTPATTERN_HEIGHT   30

#define QVGA_WIDTH   320

#define RGB565toBGR565 ( color   ) 

Value:

((color << 11) | (color >> 11) | \
                (color & (0x07E0)))

#define RGB5A1isTransparent ( color   )     (color & 0x1)

#define RGB5A1toRGB565 ( color   ) 

Value:

(color & 0xFFC0)| \
        ((color & 0x3E) >> 1)

#define RGB888toRGB565 ( r,
g,
 ) 

Value:

((r >> 3) << 11)| \
        ((g >> 2) << 5)| ((b >> 3) << 0)


Enumeration Type Documentation

enum fb_device_type

Enumeration of the supported Display Scrrens.

Enumerator:
LQ035Q1DH02 

enum image_type

Enumeration of the supported image type.

DEFAULT = Displays the Color Bar Pattern STATE_VARIABLE = Displays Contents of state->buffer CUSTOM = Displays image passed as parameter

Enumerator:
TEST_PATTERN 
PAINTED_IMAGE 
CUSTOM 

enum pixel_format

Enumeration of the supported pixel formats.

Enumerator:
RGB565 
YUYV422 


Function Documentation

int bb_clearPassive (  ) 

Passive Buffer Clear.

This function clears the current passive buffer

Note: Call this function to reset passive buffer

Pre-conditions:

Post conditions

int bb_imageCommit (  ) 

Background Image Commit.

This function switches between active and passive background buffers

Note: This function needs to be called to commit changes to the background buffer

Pre-conditions:

Post conditions

Returns:
int status (0 for success, -1 for failure)

int bb_imageShow ( unsigned short *  displayBuffer  ) 

Background Image Display.

This function loads image stored in the active background buffer onto the passive frame buffer.

Note : This function needs to be called each time the active frame buffer is changed

Pre-conditions:

Post conditions:

Parameters:

Parameters:
displayBuffer pointer to receiving buffer
Returns:
int status (0 for success, -1 for failure)

void bb_imageWaitForReady (  ) 

Block until we are sure that the MDMA has finished copying the background for the provided foreground buffer.

int bb_Init ( fb_t state  ) 

Initialize the Background Buffer System.

This function initializes the background overlay buffers

Pre-conditions:

Post conditions:

Parameters:

Returns:
int status (0 for success, -1 for failure)

int bb_isReady (  ) 

Background MDMA Ready.

This function checks if the MDMA used in the Background buffer is ready

Note: Call this function to check if a background buffer to frame buffer copy is taking place

Pre-conditions:

Post conditions

Returns:
int ready (0 for not ready, 1 for ready)

int bb_pixelPut ( unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned short  x_pos,
unsigned short  y_pos 
)

Background Pixel Plot.

This function plots a pixel at the given location with given color

Pre-conditions:

Post conditions:

Parameters:

Parameters:
red red value of the color
green green value of the color
blue blue value of the color
x_pos X Coordinate (in pixels)
y_pos Y Coordinate (in pixels)
Returns:
int status (0 for success, -1 for failure)

void bb_pixelPutRaw ( unsigned int  color,
unsigned short  x_pos,
unsigned short  y_pos 
) [inline]

Background Pixel Plot.

This function plots a pixel at the given location with given color

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
color in target format
x_pos X Coordinate (in pixels)
y_pos Y Coordinate (in pixels)
Returns:
int status (0 for success, -1 for failure)

unsigned int fb_colorTargetGet ( fb_t state,
unsigned char  red,
unsigned char  green,
unsigned char  blue 
)

return color in target format of display

int fb_imageShow ( fb_t state  ) 

Image Display.

This function displays an image stored in the passive buffer on the screen.

Note : This function needs to be called each time a new image needs to be displayed on the screen

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
Returns:
int status (0 for success, -1 for failure)

int fb_imageShowComplete ( fb_t state  ) 

Image Display Complete.

Blocks caller until last image show is completed. Returns immediately if no switch is pending.

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
Returns:
int status (0 for success, -1 for failure)

int fb_Init ( fb_t state,
int  devicenumber,
enum fb_device_type  devicetype,
enum pixel_format  pixFormat,
isrDisp_t pIsrDisp 
)

Initialize the Frame Buffer System.

This function initializes LCD System including related Timer, PPI, DMA Systems.

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
devicenumber to store the instance of the device being used (0 - 4)
devicetype the actual display device being accessed
pixFormat pixel is RGB565 or YUYV422
Returns:
int status (0 for success, -1 for failure)

int fb_passiveBufferGet ( fb_t state,
unsigned short **  passiveBuffer 
)

find passive buffer

This function stores the address of the passive buffer in the passed buffer parameter

Pre-conditions:

Post conditions:

Parameters:
state address of FB state variable
passiveBuffer stores the address of the pointer which will store the passiveBuffer starting point
Returns:
void

int fb_pixelPut ( fb_t state,
unsigned char  red,
unsigned char  green,
unsigned char  blue,
unsigned short  x_pos,
unsigned short  y_pos 
)

Pixel Plot.

This function plots a pixel at the given location with given color

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
red red value of the color
green green value of the color
blue blue value of the color
x_pos X Coordinate (in pixels)
y_pos Y Coordinate (in pixels)
Returns:
int status (0 for success, -1 for failure)

void fb_pixelPutRaw ( fb_t state,
unsigned int  color,
unsigned short  x_pos,
unsigned short  y_pos 
) [inline]

Pixel Plot.

This function plots a pixel at the given location with given color

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
color in target format
x_pos X Coordinate (in pixels)
y_pos Y Coordinate (in pixels)
Returns:
int status (0 for success, -1 for failure)

int fb_qvgaRgb565TestPatternCreate ( fb_t state  ) 

function to fill color bar pattern

This function creates the color bar pattern in the passive DMA Buffer

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
Returns:
void

int fb_Release ( fb_t state  ) 

Release the FB System.

This function releases FB System including related Timer, PPI, DMA Systems.

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of FB state variable
Returns:
int status (0 for success, -1 for failure)

int fb_slackGet ( fb_t state  ) 

Slack Get.

Returns nanoSec until pending image switch is executed, 0 if no switch is pending.

Pre-conditions:

Post conditions:

Parameters:

Parameters:
state address of LCD state variable
Returns:
nanoseconds until pending switch occurs

int fb_statsGet ( fb_t state,
unsigned int *  nrUpdates,
unsigned int *  nrSame 
)

statistic get

gathers display statistics nrUpdates number of images updated nrSame number of identical images displayed

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state address of LCD state variable
Returns:
int status (0 for success, -1 for failure)


Generated on 3 Mar 2014 for PAL bare-c Library by  doxygen 1.4.7