[][src]Union card10_sys::disp_framebuffer

#[repr(C)]
pub union disp_framebuffer {
    pub fb: [[[u8; 2]; 160]; 80],
    pub raw: [u8; 25600],
    // some fields omitted
}

Framebuffer

The frambuffer stores pixels as RGB565, but byte swapped. That is, for every (x, y) coordinate, there are two uint8_t\ s storing 16 bits of pixel data.

.. todo::

Document (x, y) in relation to chirality.

Example: Fill framebuffer with red

.. code-block:: cpp

union disp_framebuffer fb;
uint16_t red = 0b1111100000000000;
for (int y = 0; y < DISP_HEIGHT; y++) {
	for (int x = 0; x < DISP_WIDTH; x++) {
		fb.fb[y][x][0] = red >> 8;
		fb.fb[y][x][1] = red & 0xFF;
	}
}
epic_disp_framebuffer(&fb);

Fields

fb: [[[u8; 2]; 160]; 80]

Coordinate based access (as shown in the example above).

raw: [u8; 25600]

Raw byte-indexed access.

Trait Implementations

impl Copy for disp_framebuffer[src]

impl Clone for disp_framebuffer[src]

Auto Trait Implementations

Blanket Implementations

impl<T> From<T> for T[src]

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> Any for T where
    T: 'static + ?Sized
[src]