group::DISPLAY

This is the interface for accessing displays. The driver allows an application to load the video memory pointer as well as the width and height of the device.

When an application accesses the LCD, it must issue a HOLD before modifying the memory and a RELEASE when modification is complete.

int fd;
display_info_t attr;

fd = open("/dev/lcd0", O_RDWR);
ioctl(fd, I_DISPLAY_GETINFO, &attr);
ioctl(fd, I_DISPLAY_REFRESH, &attr);
 //the display will refresh based on the value of attr.freq (usually in the tens of hertz range)

Details

defineDISPLAY_VERSION


defineDISPLAY_IOC_CHAR


defineI_DISPLAY_GETVERSION


defineI_DISPLAY_GETINFO

This request gets the attributes of the device.

Example:

display_info_t info;
ioctl(fildes, I_DISPLAY_GETINFO, &info);

defineI_DISPLAY_SETATTR


defineI_DISPLAY_SETACTION


defineI_DISPLAY_CLEAR

This request clears the LCD. This does not affect the video memory. This is only supported on devices that include a way to clear the memory using a hardware command.

Example:

ioctl(fildes, I_DISPLAY_CLEAR);

defineI_DISPLAY_REFRESH

This request tells the driver to update the display as soon as possible.

Example:

ioctl(fildes, I_DISPLAY_REFRESH);

defineI_DISPLAY_ISBUSY

Returns a positive value if the display is busy.

Example:

if( ioctl(fildes, I_DISPLAY_ISBUSY) > 0 ){
     //display is busy refreshing -- don't modify the display memory while display is busy
}

defineI_DISPLAY_GETPALETTE

Gets the palette attributes of the display.

Example:

display_palette_t palette;
ioctl(fildes, I_DISPLAY_GETPALETTE, &palette);

defineI_DISPLAY_TOTAL


enum@9

  • DISPLAY_PALETTE_PIXEL_FORMAT_1BPP
  • DISPLAY_PALETTE_PIXEL_FORMAT_RGB444
  • DISPLAY_PALETTE_PIXEL_FORMAT_RGB565
  • DISPLAY_PALETTE_PIXEL_FORMAT_RGB666
  • DISPLAY_PALETTE_PIXEL_FORMAT_RGB888

enumdisplay_flags

  • DISPLAY_FLAG_INIT Initializes the display
  • DISPLAY_FLAG_SET_WINDOW Sets the window used when writing to the display
  • DISPLAY_FLAG_CLEAR Clears the display
  • DISPLAY_FLAG_ENABLE Enables the display
  • DISPLAY_FLAG_DISABLE Disables the display
  • DISPLAY_FLAG_SET_MODE Sets the write mode to either raw or palette
  • DISPLAY_FLAG_IS_MODE_RAW Data is written directly to the display
  • DISPLAY_FLAG_IS_MODE_PALETTE Data is interpreted as a bitmap and is mapped using the palette


date: “2019-06-27” layout: post title: struct::display_palette_pixel_format_rgb444_t katex: true

categories: struct

Methods

Details

public u8r4g4


public u8b4r4


public u8g4b4



date: “2019-06-27” layout: post title: struct::display_palette_pixel_format_rgb888_t katex: true

categories: struct

Methods

  • public u8r8
  • public u8b8
  • public u8g8

Details

public u8r8


public u8b8


public u8g8



date: “2019-06-27” layout: post title: struct::display_palette_pixel_format_rgb666_t katex: true

categories: struct

Methods

Details

public u8r6x2


public u8b6x2


public u8g6x2



date: “2019-06-27” layout: post title: struct::display_palette_pixel_format_rgb565_t katex: true

categories: struct

Methods

Details

public u8r5g3


public u8g3b5



date: “2019-06-27” layout: post title: struct::display_palette_t katex: true

categories: struct

The display palette converts the bits_per_pixel to a native color. For example, if there are two bits per pixel, the display driver can handle 4 colors. The palette defines how those four colors are mapped to the display.

Methods

Details

public u8pixel_format

Pixel format of the display (e.g. DISPLAY_PALETTE_PIXEL_FORMAT_RGB565)


public u8count

The number of pixel entries in the palette


public void *colors

A pointer to the colors in the palette (should point to shareable memory)



date: “2019-06-27” layout: post title: struct::display_attr_t katex: true

categories: struct

Methods

Details

public u32o_flags

Flags used for performing various actions like DISPLAY_FLAG_INIT


public s16window_x

x position for the window (used with DISPLAY_FLAG_SET_WINDOW)


public s16window_y

y position for the window (used with DISPLAY_FLAG_SET_WINDOW)


public s16window_width

window width (used with DISPLAY_FLAG_SET_WINDOW)


public s16window_height

window height (used with DISPLAY_FLAG_SET_WINDOW)


public u32resd



date: “2019-06-27” layout: post title: struct::display_info_t katex: true

categories: struct

This contains the attributes of a display.

Methods

Details

public u32o_flags


public u32freq


public u16width


public u16height


public u16cols


public u16rows


public u16bits_per_pixel

The number of bits in each pixel: 1, 2, 4, 8, 16, 24, or 32


public u16margin_left


public u16margin_right


public u16margin_top


public u16margin_bottom


public u32resd


X

Thanks for Coming!

Subscribe to news and updates