CARME-M4 BSP  V1.5

CARME-M4 Graphic controller. More...

+ Collaboration diagram for LCD:

Modules

 CTRL
 CARME-M4 LCD Low level driver.
 

Files

file  lcd_conf.h
 Simple graphic library configuration.
 
file  ssd1963.h
 Driver for the SSD1963 Graphic-Controller.
 
file  ssd1963.c
 Driver for the SSD1963 Graphic-Controller.
 

Macros

#define TFT320x240
 
#define TFT_FPS   50ULL
 
#define TFT_WIDTH   320ULL
 
#define TFT_HSYNC_BACK_PORCH   40ULL
 
#define TFT_HSYNC_FRONT_PORCH   20ULL
 
#define TFT_HSYNC_PULSE   28ULL
 
#define TFT_HEIGHT   240ULL
 
#define TFT_VSYNC_BACK_PORCH   17ULL
 
#define TFT_VSYNC_FRONT_PORCH   4ULL
 
#define TFT_VSYNC_PULSE   3ULL
 
#define TFT_HSYNC_PERIOD   (TFT_HSYNC_PULSE + TFT_HSYNC_BACK_PORCH + TFT_WIDTH + TFT_HSYNC_FRONT_PORCH)
 
#define TFT_VSYNC_PERIOD   (TFT_VSYNC_PULSE + TFT_VSYNC_BACK_PORCH + TFT_HEIGHT + TFT_VSYNC_FRONT_PORCH)
 
#define TFT_PCLK   (TFT_HSYNC_PERIOD * TFT_VSYNC_PERIOD * TFT_FPS)
 
#define LCD_FPR   ((TFT_PCLK * 1048576)/100000000)
 
#define WR_HIGH_BYTE(x)   (x >> 8)
 
#define WR_LOW_BYTE(x)   (x & 0xFF)
 
#define USE_16BIT_PMP
 
#define LCD_HOR_RESOLUTION   320ULL
 
#define LCD_VER_RESOLUTION   240ULL
 
#define LCD_HOR_PULSE_WIDTH   64ULL /* 64 */
 
#define LCD_HOR_BACK_PORCH   96ULL /* 96 */
 
#define LCD_HOR_FRONT_PORCH   48ULL /* 48 */
 
#define LCD_VER_PULSE_WIDTH   2ULL /* 2 */
 
#define LCD_VER_BACK_PORCH   34ULL /* 34 */
 
#define LCD_VER_FRONT_PORCH   11ULL /* 11 */
 
#define HT   (LCD_HOR_RESOLUTION + LCD_HOR_PULSE_WIDTH + LCD_HOR_BACK_PORCH + LCD_HOR_FRONT_PORCH)
 
#define HPS   (LCD_HOR_PULSE_WIDTH + LCD_HOR_BACK_PORCH)
 
#define VT   (LCD_VER_PULSE_WIDTH + LCD_VER_BACK_PORCH + LCD_VER_FRONT_PORCH + LCD_VER_RESOLUTION)
 
#define VSP   (LCD_VER_PULSE_WIDTH + LCD_VER_BACK_PORCH)
 
#define X_BYTES   40
 
#define Y_BYTES   30
 
#define SCRN_LEFT   0
 
#define SCRN_TOP   0
 
#define SCRN_RIGHT   LCD_HOR_RESOLUTION-1
 
#define SCRN_BOTTOM   LCD_VER_RESOLUTION-1
 
#define CCW   -1
 
#define CW   1
 
#define DOTS_PER_CM_X   64
 
#define DOTS_PER_CM_Y   60
 
#define INCR   1
 
#define DECR   -1
 
#define PREDX   1
 
#define PREDY   0
 
#define COEFF_PIXELS_MM   1.5
 

Functions

void SSD1963_Init (void)
 Init the SSD1963 LCD-Controller and clear the display. More...
 
void SSD1963_WritePixel (uint16_t x, uint16_t y, uint16_t color)
 Puts pixel. More...
 
uint16_t SSD1963_ReadPixel (uint16_t x, uint16_t y)
 Reads pixel. More...
 
void SSD1963_SetArea (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2)
 defines start/end columns and start/end rows for memory access from host to SSD1963. More...
 
void SSD1963_FillArea (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t color)
 Fill area of specified color. More...
 
void SSD1963_WriteArea (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, uint16_t *pData)
 Write a array of data to the display. More...
 
void SSD1963_SetTearingCfg (uint8_t state, uint8_t mode)
 This function enable/disable tearing effect. More...
 
void SSD1963_GetDeviceDescriptorBlock (uint16_t *ddb)
 Get SSD1963 Device Descriptor Block. More...
 
void SSD1963_WriteCommand (uint16_t cmd)
 
void SSD1963_WriteData (uint16_t data)
 
uint16_t SSD1963_ReadData (void)
 
static void SSD1963_EnterSleepMode (void)
 SSD1963 enters sleep mode.
Host must wait 5mS after sending before sending next command.
 
static void SSD1963_ExitSleepMode (void)
 SSD1963 exit sleep mode.
 
static void SSD1963_DisplayOff (void)
 SSD1963 changes the display state to OFF state.
 
static void SSD1963_DisplayOn (void)
 SSD1963 changes the display state to ON state.
 
static void SSD1963_Delay (uint32_t nCount)
 Inserts a delay time. More...
 

Variables

static uint16_t deviceDescriptorBlock [3]
 

Detailed Description

CARME-M4 Graphic controller.

Function Documentation

static void SSD1963_Delay ( uint32_t  nCount)
static

Inserts a delay time.

Parameters
[in]nCountspecifies the delay time length.
Returns
None

Definition at line 100 of file ssd1963.c.

+ Here is the caller graph for this function:

void SSD1963_FillArea ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
uint16_t  color 
)

Fill area of specified color.

Parameters
[in]x1start column from the left.
[in]y1start row from the top.
[in]x2end column from the left.
[in]y2end row from the top.
[in]color16-Bit color value in the RGB 5-6-5 format.
Returns
None

Definition at line 276 of file ssd1963.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SSD1963_GetDeviceDescriptorBlock ( uint16_t *  ddb)

Get SSD1963 Device Descriptor Block.

Parameters
[out]ddbDevice descriptor block information, stored in 3 uint16_t variables.
Returns
None

Definition at line 346 of file ssd1963.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SSD1963_Init ( void  )

Init the SSD1963 LCD-Controller and clear the display.

Returns
None

Set pll parameters Target system clock : 110MHz Crystal frequency : 10MHz VCO range : 250MHz - 800MHz Multiplier : 33 (N = 0x20) Divider : 3 (M = 0x02)

Set LSHIFT freq, i.e. the DCLK with PLL freq 120 MHz set previously Typical DCLK for TFT-320x240 is 6.5MHz in 18 bit format 6.5 MHz = 120 MHz*(LCDC_FPR+1)/2^20

Definition at line 115 of file ssd1963.c.

+ Here is the call graph for this function:

uint16_t SSD1963_ReadPixel ( uint16_t  x,
uint16_t  y 
)

Reads pixel.

Parameters
[in]xcolumn from the left.
[in]yrow from the top.
Returns
16-Bit color value in the RGB 5-6-5 format.

Definition at line 231 of file ssd1963.c.

+ Here is the call graph for this function:

void SSD1963_SetArea ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2 
)

defines start/end columns and start/end rows for memory access from host to SSD1963.

Parameters
[in]x1start column from the left.
[in]y1start row from the top.
[in]x2end column from the left.
[in]y2end row from the top.
Returns
None

Definition at line 250 of file ssd1963.c.

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

void SSD1963_SetTearingCfg ( uint8_t  state,
uint8_t  mode 
)

This function enable/disable tearing effect.

Parameters
[in]state1: to enable
0: to disable
[in]mode0: the tearing effect output line consists of V-blanking information only.
1: the tearing effect output line consists of both V-blanking and H-blanking info.
Returns
None

Definition at line 326 of file ssd1963.c.

+ Here is the call graph for this function:

void SSD1963_WriteArea ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
uint16_t *  pData 
)

Write a array of data to the display.

Parameters
[in]x1start column from the left.
[in]y1start row from the top.
[in]x2end column from the left.
[in]y2end row from the top.
[in]pDataPointer to the array of pixels in format of 16-Bit color value in the RGB 5-6-5 format.
Returns
None

Definition at line 301 of file ssd1963.c.

+ Here is the call graph for this function:

void SSD1963_WritePixel ( uint16_t  x,
uint16_t  y,
uint16_t  color 
)

Puts pixel.

Parameters
[in]xcolumn from the left.
[in]yrow from the top.
[in]color16-Bit color value in the RGB 5-6-5 format.
Returns
None

Definition at line 215 of file ssd1963.c.

+ Here is the call graph for this function: