src/lq035q1dh02.h File Reference

The file contains function prototypes for the nuggets and macros related to LQ035Q1DH02DHO2 LCD. More...

#include "isrDisp.h"

Include dependency graph for lq035q1dh02.h:

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


Data Structures

struct  display_frameBufferDescr_s
struct  display_t
 display_t structure More...

Defines

#define TOTAL_FRAMES   200
#define whitecolor   0xffff
#define blackcolor   0x0000
#define bluecolor   0x0010
#define redcolor   0xf800
#define greencolor   0x07e0
#define cyancolor   0x7ff
#define yellowcolor   0xffe0
#define SPI_CLOCK_SPEED   5000000
#define magentacolor   0xf81f
#define BACKLIGHT_ON   1
#define BACKLIGHT_OFF   0
#define LCD_ACTIVE_PIXELS_PER_LINE   320
#define LCD_ACTIVE_LINES_PER_FRAME   240
#define TIMOD01   0x01
#define V_LINES   244
#define BLANKING_LINES   4
#define PRE_BLANKING_LINES   2
#define POST_BLANKING_LINES   2
#define HSYNC_PERIOD   336
#define VSYNC_PERIOD   HSYNC_PERIOD*V_LINES
#define HSYNC_WIDTH   2
#define VSYNC_WIDTH   2
#define HSYNC_DELAY   7
#define ERROR   -1
#define SPI_TRANSMISSION_ERR   -2
#define SPI_MODEFAULT_ERR   -3
#define SUCCESS   0
#define TIMEOUT   -4
#define TMODE_PWMOUT   0x0001
#define PORT_CFG_01   0x10
#define XFR_TYPE_11   0x0c
#define PORT_DIR_TRNS   0x02
#define pSPI_BAUDRATE   0xFFC00514
#define CMD   0x01
#define DATA   0x02
#define DISPLAY_WIDTH   320
#define DISPLAY_HEIGHT   240
#define LQ035Q1DH02_BGR   0x08
#define LQ035Q1DH02_REV   0x20
#define LQ035Q1DH02_NUMBERS   1

Typedefs

typedef display_frameBufferDescr_s display_frameBufferDescr_t

Enumerations

enum  dispaly_pixelFormat { LQ035Q1DH02_RGB565 = 0, LQ035Q1DH02_BGR565 = 1, LQ035Q1DH02_YUYV422 = 2 }
 Enumeration of the supported pixel formats. More...
enum  display_imageType { LQ035Q1DH02_TEST_PATTERN = 0, LQ035Q1DH02_PAINTED_IMAGE = 1, LQ035Q1DH02_CUSTOM = 2 }
 Enumeration of the supported image type. More...
enum  display_rev { LQ035Q1DH02_REV0 = 0, LQ035Q1DH02_REV1 = 1 }
 Enumeration of the supported image orientation. More...

Functions

int display_Init (display_t *state, int horizontalLength, int verticalLength, enum dispaly_pixelFormat pixFormat, enum display_rev reverse, unsigned short *dmaStartAddress1, isrDisp_t *pIsrDisp)
 Initializes the LQ035Q1DH02 LCD System.
int display_imageShow (display_t *state, unsigned short *displayScreen)
 Image Display.
int display_imageShowDone (display_t *state)
 Image Show Complete.
int display_slackGet (display_t *state)
 Slack Get.
int display_statsGet (display_t *state, unsigned int *nrUpdates, unsigned int *nrSame)
 statistic get
int dispLQ035Q1DH02_pixelPut (display_t *state, unsigned char red, unsigned char green, unsigned char blue, unsigned short x_pos, unsigned short y_pos)
 Pixel Plot.
int display_Release (display_t *state)
 Release the LQ035Q1DH02 LCD System.

Variables

display_t displayState [LQ035Q1DH02_NUMBERS]

Detailed Description

The file contains function prototypes for the nuggets and macros related to LQ035Q1DH02DHO2 LCD.

Version:
1.8
Date:
20120329
Author:
C. Lavania
XqJv Copyright(c) 2009-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: 20120329, Author: C. Lavania, Notes: Cleaned up, added macros for blank lines

Revised: 20120328, Author: C. Lavania, Notes: Modified the state variable structure to include the start address of the passive buffer

Revised: 20120327, Author: C. Lavania, Notes: Moved macros for conversion from RGB888 to RGB565 and RGB565 to BGR565, to the FB layer, modified the exposed function prototypes and the state structure to avoid usage of 3 buffers (2 DMA and 1 extra),

Revised: 20120322, Author: C. Lavania, Notes: Cleaned up, added enum for image orientation, and added macros for BGR and REV bits in register 01 of LCD

Revised: 20120321, Author: C. Lavania, Notes: Cleaned up

Revised: 20120321, Author: C. Lavania, Notes: Modified state structure and function prototypes.

Revised: 20120206, Author: C. Lavania, Notes: Added Nuggets, macros for pixel format conversion

Revised: 20111124, Author: C. Lavania, Notes: Ported from VDSP to GNU

Created: 20090204, Author: D. Kiran, Notes: Created the Initial Version

References:

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


Define Documentation

#define BACKLIGHT_OFF   0

#define BACKLIGHT_ON   1

#define blackcolor   0x0000

#define BLANKING_LINES   4

#define bluecolor   0x0010

#define CMD   0x01

#define cyancolor   0x7ff

#define DATA   0x02

#define DISPLAY_HEIGHT   240

#define DISPLAY_WIDTH   320

#define ERROR   -1

#define greencolor   0x07e0

#define HSYNC_DELAY   7

#define HSYNC_PERIOD   336

#define HSYNC_WIDTH   2

#define LCD_ACTIVE_LINES_PER_FRAME   240

#define LCD_ACTIVE_PIXELS_PER_LINE   320

#define LQ035Q1DH02_BGR   0x08

#define LQ035Q1DH02_NUMBERS   1

#define LQ035Q1DH02_REV   0x20

#define magentacolor   0xf81f

#define PORT_CFG_01   0x10

#define PORT_DIR_TRNS   0x02

#define POST_BLANKING_LINES   2

#define PRE_BLANKING_LINES   2

#define pSPI_BAUDRATE   0xFFC00514

#define redcolor   0xf800

#define SPI_CLOCK_SPEED   5000000

#define SPI_MODEFAULT_ERR   -3

#define SPI_TRANSMISSION_ERR   -2

#define SUCCESS   0

#define TIMEOUT   -4

#define TIMOD01   0x01

#define TMODE_PWMOUT   0x0001

#define TOTAL_FRAMES   200

#define V_LINES   244

#define VSYNC_PERIOD   HSYNC_PERIOD*V_LINES

#define VSYNC_WIDTH   2

#define whitecolor   0xffff

#define XFR_TYPE_11   0x0c

#define yellowcolor   0xffe0


Typedef Documentation

typedef struct display_frameBufferDescr_s display_frameBufferDescr_t


Enumeration Type Documentation

enum dispaly_pixelFormat

Enumeration of the supported pixel formats.

Enumerator:
LQ035Q1DH02_RGB565 
LQ035Q1DH02_BGR565 
LQ035Q1DH02_YUYV422 

enum display_imageType

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:
LQ035Q1DH02_TEST_PATTERN 
LQ035Q1DH02_PAINTED_IMAGE 
LQ035Q1DH02_CUSTOM 

enum display_rev

Enumeration of the supported image orientation.

Enumerator:
LQ035Q1DH02_REV0 
LQ035Q1DH02_REV1 


Function Documentation

int display_imageShow ( display_t state,
unsigned short *  displayScreen 
)

Image Display.

This function is responsible to setup the DMA to display the new image Note : This function needs to be called each time a new image needs to be displayed on the screen

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state address of LCD state variable
displayScreen the next frame to be displayed
Returns:
int status (0 for success, -1 for failure)

int display_imageShowDone ( display_t state  ) 

Image Show Complete.

Blocks until last display_imageShow has completed. If no imageShow is pending, call returns immediately.

Pre-conditions:

Post condtions:

Parameters:

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

int display_Init ( display_t state,
int  horizontalLength,
int  verticalLength,
enum dispaly_pixelFormat  pixFormat,
enum display_rev  reverse,
unsigned short *  dmaStartAddress1,
isrDisp_t pIsrDisp 
)

Initializes the LQ035Q1DH02 LCD System.

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

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state address of LCD state variable
horizontalLength width of the frame (in pixels)
verticalLength height of the frame (in pixels)
pixFormat pixel is RGB565 or BGR565 or YUYV422
reverse orientation of the image (0 for reverse and 1 for normal)
dmaStartAddress1 memory location of DMA buffer 1
dmaStartAddress2 memory location of DMA buffer 2
Returns:
int status (0 for success, -1 for failure)

int display_Release ( display_t state  ) 

Release the LQ035Q1DH02 LCD System.

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

Pre-conditions:

Post condtions:

Parameters:

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

int display_slackGet ( display_t state  ) 

Slack Get.

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

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state address of LCD state variable
Returns:
0.01 % of time between new frames => 3000 means 30% time left

int display_statsGet ( display_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)

int dispLQ035Q1DH02_pixelPut ( display_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 condtions:

Parameters:

Parameters:
state address of LCD 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)


Variable Documentation

display_t displayState[LQ035Q1DH02_NUMBERS]


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