Functions
Functions
Graphics » HAL DC » GDC
Collaboration diagram for 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. 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. 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] | flag | Flag 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] | ctrl | struct 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] | div | Set Divider 1
  [in] | div2 | Set Divider 2
  [in] | dma_prefetch | Set number of lines for the dma to prefetch
  [in] | phase | Clock phase shift

## ◆ hal_gdc_cursor_enable()

void hal_gdc_cursor_enable | ( | int | enable | ) |

Enable or Disable fixed cursor.

Parameters

  [in] | enable | 1 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] | x | Cursor X coordinate
  [in] | y | Cursor 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] | layer | Layer number
  [in] | index | Color 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] | index | Color 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_no | Layer Number

## ◆ hal_gdc_layer_enable()

void hal_gdc_layer_enable | ( | int | layer_no | ) |

Enable layer.

Parameters

  [in] | layer_no | Layer 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] | rgba | a 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] | img | Base 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] | index | Color index
  [in] | color | 32-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_no | The layer number
  [in] | layer | Attributes 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_no | The layer number
  [in] | addr | Layer 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] | layer | Layer number
  [in] | index | Layer Physical Address
  [in] | colour | 32-bit RGBA color value or gamma index

## ◆ hal_gdc_set_mode()

void hal_gdc_set_mode | ( | int | mode | ) |

Set operation mode.

Parameters

  [in] | mode | Mode 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] | index | Color Index
  [in] | colour | 32-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] | format | Texture color format
  [in] | width | Texture 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] | resx | Resolution X
  [in] | fpx | Front Porch X
  [in] | blx | Blanking X
  [in] | bpx | Back Porch X
  [in] | resy | Resolution Y
  [in] | fpy | Front Porch Y
  [in] | bly | Blanking Y
  [in] | bpy | Back Porch Y