Functions

Functions

int hal_gdc_init (void)
 Initialize hal_gdc library. More...
 
uint32_t hal_gdc_get_config (void)
 Read Configuration Register. More...
 
uint32_t hal_gdc_get_crc (void)
 Read CRC Checksum Register. More...
 
void hal_gdc_set_bgcolor (uint32_t rgba)
 Set hal_gdc Background Color. More...
 
void hal_gdc_timing (int resx, int fpx, int blx, int bpx, int resy, int fpy, int bly, int bpy)
 Set Display timing parameters. More...
 
int hal_gdc_stride_size (hal_gdc_format_t format, int width)
 Get stride size in bytes. More...
 
void hal_gdc_clkdiv (int div, int div2, int dma_prefetch, int phase)
 Set the built-in Clock Dividers and DMA Line Prefetch. (See Configuration Register 0x4) More...
 
void hal_gdc_clkctrl (hal_gdc_clkctrl_t ctrl)
 Control the clock gaters. More...
 
void hal_gdc_set_mode (int mode)
 Set operation mode. More...
 
uint32_t hal_gdc_get_status (void)
 Get status from Status Register. More...
 
void hal_gdc_request_vsync_non_blocking (void)
 Request a VSync Interrupt without blocking. More...
 
void hal_gdc_set_layer (int layer_no, hal_gdc_layer_t *layer)
 Set the Layer Mode. This function can enable a layer and set attributes to it. More...
 
void hal_gdc_set_layer_addr (int layer_no, uintptr_t addr)
 Set the physical address of a layer. More...
 
void hal_gdc_set_layer_gamma_lut (int layer, int index, int colour)
 Set the physical address of a layer. More...
 
int hal_gdc_get_layer_gamma_lut (int layer, int index)
 Get an entry in the lut8 Palette Gamma table for a layer. More...
 
void hal_gdc_set_palette (uint32_t index, uint32_t colour)
 Sets an entry in the lut8 Palatte Gamma table. More...
 
int hal_gdc_get_palette (uint32_t index)
 Reads an entry from the lut8 Palatte Gamma table. More...
 
void hal_gdc_layer_disable (int layer_no)
 Disable layer. More...
 
void hal_gdc_layer_enable (int layer_no)
 Enable layer. More...
 
void hal_gdc_cursor_enable (int enable)
 Enable or Disable fixed cursor. More...
 
void hal_gdc_cursor_xy (int x, int y)
 Set the location of the cursor. More...
 
void hal_gdc_set_cursor_img (unsigned char *img)
 Set programmable cursor image (32x32 pixels) More...
 
void hal_gdc_set_cursor_lut (uint32_t index, uint32_t color)
 Set a color for the Cursor LUT. More...
 
unsigned char hal_gdc_check_config (hal_gdc_config_t flag)
 Check whether hal_gdc supports a specific characteristic. More...
 
uint32_t hal_gdc_get_col_mode (void)
 Read Color Mode Register. More...
 
int hal_gdc_get_layer_count (void)
 Get the number of layers available. More...
 

Detailed Description

Function Documentation

◆ hal_gdc_check_config()

unsigned char hal_gdc_check_config ( hal_gdc_config_t  flag)

Check whether hal_gdc supports a specific characteristic.

Parameters
[in]flagFlag to query
Returns
True if the characteristic is supported

◆ hal_gdc_clkctrl()

void hal_gdc_clkctrl ( hal_gdc_clkctrl_t  ctrl)

Control the clock gaters.

Parameters
[in]ctrlstruct control

◆ hal_gdc_clkdiv()

void hal_gdc_clkdiv ( int  div,
int  div2,
int  dma_prefetch,
int  phase 
)

Set the built-in Clock Dividers and DMA Line Prefetch. (See Configuration Register 0x4)

Parameters
[in]divSet Divider 1
[in]div2Set Divider 2
[in]dma_prefetchSet number of lines for the dma to prefetch
[in]phaseClock phase shift

◆ hal_gdc_cursor_enable()

void hal_gdc_cursor_enable ( int  enable)

Enable or Disable fixed cursor.

Parameters
[in]enable1 for enable or 0 for disable cursor

◆ hal_gdc_cursor_xy()

void hal_gdc_cursor_xy ( int  x,
int  y 
)

Set the location of the cursor.

Parameters
[in]xCursor X coordinate
[in]yCursor Y coordinate

◆ hal_gdc_get_col_mode()

uint32_t hal_gdc_get_col_mode ( void  )

Read Color Mode Register.

Returns
Color mode register

◆ hal_gdc_get_config()

uint32_t hal_gdc_get_config ( void  )

Read Configuration Register.

Returns
Configuration Register Value

◆ hal_gdc_get_crc()

uint32_t hal_gdc_get_crc ( void  )

Read CRC Checksum Register.

Returns
CRC checksum value of last frame. For testing purposes

◆ hal_gdc_get_layer_count()

int hal_gdc_get_layer_count ( void  )

Get the number of layers available.

Returns
Number of layers

◆ hal_gdc_get_layer_gamma_lut()

int hal_gdc_get_layer_gamma_lut ( int  layer,
int  index 
)

Get an entry in the lut8 Palette Gamma table for a layer.

Parameters
[in]layerLayer number
[in]indexColor Index
Returns
Palette index

◆ hal_gdc_get_palette()

int hal_gdc_get_palette ( uint32_t  index)

Reads an entry from the lut8 Palatte Gamma table.

Parameters
[in]indexColor Index
Returns
Colour for given palette index

◆ hal_gdc_get_status()

uint32_t hal_gdc_get_status ( void  )

Get status from Status Register.

Returns
Status of DC

◆ hal_gdc_init()

int hal_gdc_init ( void  )

Initialize hal_gdc library.

Returns
-1 on error

◆ hal_gdc_layer_disable()

void hal_gdc_layer_disable ( int  layer_no)

Disable layer.

Parameters
[in]layer_noLayer Number

◆ hal_gdc_layer_enable()

void hal_gdc_layer_enable ( int  layer_no)

Enable layer.

Parameters
[in]layer_noLayer Number

◆ hal_gdc_request_vsync_non_blocking()

void hal_gdc_request_vsync_non_blocking ( void  )

Request a VSync Interrupt without blocking.

Returns
Status of DC

◆ hal_gdc_set_bgcolor()

void hal_gdc_set_bgcolor ( uint32_t  rgba)

Set hal_gdc Background Color.

Parameters
[in]rgbaa 32-bit rgba value (0xRRGGBBXX - Red: color[31:24], Green: color[23:16], Blue: color[15:8])

◆ hal_gdc_set_cursor_img()

void hal_gdc_set_cursor_img ( unsigned char *  img)

Set programmable cursor image (32x32 pixels)

Parameters
[in]imgBase address of the 32x32 Cursor Image

◆ hal_gdc_set_cursor_lut()

void hal_gdc_set_cursor_lut ( uint32_t  index,
uint32_t  color 
)

Set a color for the Cursor LUT.

Parameters
[in]indexColor index
[in]color32-bit RGBA value

◆ hal_gdc_set_layer()

void hal_gdc_set_layer ( int  layer_no,
hal_gdc_layer_t layer 
)

Set the Layer Mode. This function can enable a layer and set attributes to it.

Parameters
[in]layer_noThe layer number
[in]layerAttributes struct

◆ hal_gdc_set_layer_addr()

void hal_gdc_set_layer_addr ( int  layer_no,
uintptr_t  addr 
)

Set the physical address of a layer.

Parameters
[in]layer_noThe layer number
[in]addrLayer Physical Address

◆ hal_gdc_set_layer_gamma_lut()

void hal_gdc_set_layer_gamma_lut ( int  layer,
int  index,
int  colour 
)

Set the physical address of a layer.

Parameters
[in]layerLayer number
[in]indexLayer Physical Address
[in]colour32-bit RGBA color value or gamma index

◆ hal_gdc_set_mode()

void hal_gdc_set_mode ( int  mode)

Set operation mode.

Parameters
[in]modeMode of operation (See Register 0)

◆ hal_gdc_set_palette()

void hal_gdc_set_palette ( uint32_t  index,
uint32_t  colour 
)

Sets an entry in the lut8 Palatte Gamma table.

Parameters
[in]indexColor Index
[in]colour32-bit RGBA colour value or Gamma index

◆ hal_gdc_stride_size()

int hal_gdc_stride_size ( hal_gdc_format_t  format,
int  width 
)

Get stride size in bytes.

Parameters
[in]formatTexture color format
[in]widthTexture width
Returns
Stride in bytes

◆ hal_gdc_timing()

void hal_gdc_timing ( int  resx,
int  fpx,
int  blx,
int  bpx,
int  resy,
int  fpy,
int  bly,
int  bpy 
)

Set Display timing parameters.

Parameters
[in]resxResolution X
[in]fpxFront Porch X
[in]blxBlanking X
[in]bpxBack Porch X
[in]resyResolution Y
[in]fpyFront Porch Y
[in]blyBlanking Y
[in]bpyBack Porch Y