sys/lcd.h

#include <sys/lcd.h>

This header includes defines for the PL111 LCD controller used in the CE.

API Documentation

CE PL111 LCD controller define file.

Authors

Matt “MateoConLechuga” Waltz

Jacob “jacobly” Young

prime17569

Defines

lcd_Ram

Base address of memory-mapped RAM for the LCD.

lcd_Control

LCD Control register.

lcd_Palette

LCD palette registers, 512 bytes.

lcd_BacklightLevel

Current backlight level of the LCD.

0 is brightest, 255 is darkest.

LCD_WIDTH

Width of LCD in pixels.

LCD_HEIGHT

Height of LCD in pixels.

LCD_SIZE

Total size of VRAM in bytes.

lcd_CrsrSetup()

Sets up the hardware cursor.

lcd_CrsrSetSize(size)

Sets cursor size.

Parameters
  • size[in] The cursor size.

lcd_CrsrGetSize()

Gets cursor size.

Returns

The cursor size.

lcd_CrsrSetImageSmall(data, index)

Sets a small cursor image at the specified index.

Note

To use convimg to create the required data, add bpp: 2 to the converts section in convimg.yaml corresponding to your image(s).

Parameters
  • data[in] A pointer to 256 bytes of packed 2bpp image data.

  • index[in] The cursor image index to copy the data to (0-3).

lcd_CrsrSetImageLarge(data)

Sets a large cursor image.

Note

To use convimg to create the required data, add bpp: 2 to the converts section in convimg.yaml corresponding to your image(s).

Parameters
  • data[in] A pointer to 1024 bytes of packed 2bpp image data.

lcd_CrsrSetPosition(x, y)

Sets the position of the cursor on screen.

Parameters
  • x[in] X coordinate.

  • y[in] Y coordinate.

lcd_CrsrSetClipPosition(x, y)

Sets the cursor clip position.

The cursor clip is the distance from the top-left edge of the cursor image to the first displayed pixel in the cursor image.

Parameters
  • x[in] X coordinate.

  • y[in] Y coordinate.

lcd_CrsrShow()

Shows the cursor.

lcd_CrsrSetImageIndex(index)

Sets the cursor image index (0-3).

The cursor is capable of holding up to four small (32x32) images at once, each occupying a quarter of the cursor RAM. This function lets you choose which image you want to display.

Note

There is no effect if the cursor size is set to large (64x64), since the cursor RAM can only hold one 64x64 image.

Parameters
  • index[in] The index of the cursor image to display (0-3).

lcd_CrsrHide()

Hides the cursor.

lcd_CrsrCleanup()

Enums

enum lcd_cursor_size_t

Hardware cursor sizes.

Values:

enumerator LCD_CURSOR_SIZE_SMALL = 0

Small size, 32x32, 256 bytes of packed 2bpp image data.

enumerator LCD_CURSOR_SIZE_LARGE = 1

Large size, 64x64, 1024 bytes of packed 2bpp image data.