src/lq035q1dh02.c File Reference

This file contains LQ035Q1DH02 Nuggets for Init, image display, and plotting of pixels. More...

#include "lq035q1dh02.h"
#include "ad7879.h"
#include "ADP5588_Driver.h"
#include "bf52x_spi.h"
#include "DPM_Config.h"
#include "bf52x_uart.h"
#include "tll_config.h"
#include "tll6527_core_timer.h"
#include "isrDisp.h"

Include dependency graph for lq035q1dh02.c:


Functions

void display_DMA_INTERRUPT_HANDLER (void *)
static void display_lcdBackLight (unsigned char state)
static void display_dmaInit (display_t *state)
 function for initializing dma
static void display_dmaDisable (void)
 function for disabling dma
static void display_ppiInit (void)
 function for initializing ppi
static void __attribute__ ((section(".sram_app.text")))
 function for turning off backlight
static void display_dmaEnable (void)
 function for enabling dma
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 display_Release (display_t *state)
 Release the LQ035Q1DH02 LCD System.

Variables

tscrAD7879_t tscrState
display_t displayState [LQ035Q1DH02_NUMBERS]

Detailed Description

This file contains LQ035Q1DH02 Nuggets for Init, image display, and plotting of pixels.

It also contains internal (non user exposed) functions. The functions are as follows:

User Exposed Functions:

display_Init : sets up the DMA, Timers, PPI, and LCD display_imageShow dispLQ035Q1DH02_Release : disables LCD, DMA, Timers and PPI

Internal Functions:

dispLQ035Q1DH02_lcdBackLight : switches on/off the backlight dispLQ035Q1DH02_dmaInit : configures DMA dispLQ035Q1DH02_dmaEnable dispLQ035Q1DH02_dmaDisable dispLQ035Q1DH02_ppiInit : configures PPI dispLQ035Q1DH02_ppiEnable dispLQ035Q1DH02_ppiDisable dispLQ035Q1DH02_timerInit : configures TIMER0 and Timer1 for use as Frame Syncs for PPI dispLQ035Q1DH02_timerEnable dispLQ035Q1DH02_timerDisable dispLQ035Q1DH02_lcdConfig : Configures LCD in accordance with the pixel format and orientation of image passed to display_Init.

Version:
1.12
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: Moved Blanking Lines to the beginning of the DMA Buffer for better synchronization, modified passiveBuffer start address to be shifted such that blanking lines are not included in its calculation.

Revised: 20120328, Author: C.Lavania, Notes: Introduced a static instance of the state structure which can be modified by the ISR, and hence the passive buffer addresses can be updated. Modified the dispLQ035Q1DH02_Init() and dispLQ035Q1DH02_dmaInit(), and the ISR in accordance with this

Revised: 20120327, Author: C.Lavania, Notes: Cleaned up the code, modified the exposed function prototypes to avoid usage of 3 buffers (2 DMA and 1 extra). Now only 2 DMA buffers are used, used core timers to generate delays, removed hard coded addresses.

Revised: 20120326, Author: C.Lavania, Notes: Cleaned up the code, added boiler plate.

Revised: 20120324, Author: C.Lavania, Notes: Modified the file to use NEU common code.

Revised: 20120323, Author: C.Lavania, Notes: Modified the delays in lcdConfig to use core timers.

Revised: 20120322, Author: C.Lavania, Notes: Moved the PPI, Timer and LCD Initialization, Enable, Disable functions to sram, moved pixelPut function to FB layer, added SPI nugget support to the lcdConfig and lcdDisable functions, cleaned up the code, modified the display_Init function to also take image orientation as input param, while adding support for BGR565 pixel format

Revised: 20120321, Author: C. Lavania, Notes: Added Interrupt Handler, and moved filling up of DMA buffers to FB layer

Revised: 20120317, Author: C. Lavania, Notes: Modified the code to act as device level driver

Revised: 20120206, Author: C. Lavania, Notes: Added Nuggets

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


Function Documentation

static void __attribute__ ( (section(".sram_app.text"))   )  [static]

function for turning off backlight

INTERNAL FUNCTION

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state backlight is to be switched on/off
Returns:
void

void display_DMA_INTERRUPT_HANDLER ( void *   ) 

static void display_dmaDisable ( void   )  [static]

function for disabling dma

INTERNAL FUNCTION

Pre-conditions:

Post condtions:

Parameters:

Parameters:
None 
Returns:
void

static void display_dmaEnable ( void   )  [static]

function for enabling dma

INTERNAL FUNCTION

Pre-conditions:

Post condtions:

Parameters:

Parameters:
None 
Returns:
void

static void display_dmaInit ( display_t state  )  [static]

function for initializing dma

INTERNAL FUNCTION

Pre-conditions:

Post condtions:

Parameters:

Parameters:
state address of LCD state variable
Returns:
void

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)

static void display_lcdBackLight ( unsigned char  state  )  [static]

static void display_ppiInit ( void   )  [static]

function for initializing ppi

INTERNAL FUNCTION

Pre-conditions:

Post condtions:

Parameters:

Parameters:
None 
Returns:
void

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)


Variable Documentation

display_t displayState[LQ035Q1DH02_NUMBERS]

tscrAD7879_t tscrState


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