Microchip® Advanced Software Framework

 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
ET024006DHU display using HX8347A display controller over EBI

This is hardware specific configuration that configures the graphical service for use with the ET024006DHU TFT display.

All the drawing functionality in this configuration is provided by the Generic Implementation of Graphics Primitives driver. This configuration includes information about the panel size, data type used for coordinates and color and functionality to convert RGB color to the color format native to the display.

Macros

#define gfx_color(r, g, b)   gfx_et024006dhu_color(r, g, b)
 ET024006DHU display driver specific function, see gfx_et024006dhu_color. More...
 
#define gfx_copy_pixels_from_screen(pixels, count)   et024006_CopyPixelsFromScreen(pixels, count)
 ET024006DHU display driver specific function, see et024006_CopyPixelsFromScreen. More...
 
#define gfx_copy_pixels_to_screen(pixels, count)   et024006_CopyPixelsToScreen(pixels, count)
 ET024006DHU display driver specific function, see et024006_CopyPixelsToScreen. More...
 
#define gfx_copy_progmem_pixels_to_screen(pixels, count)   et024006_CopyPixelsToScreen(pixels, count)
 ET024006DHU display driver specific function available for ATmega and ATXmega devices, see et024006_CopyPixelsToScreen. More...
 
#define gfx_draw_bitmap(bmp, x, y)   gfx_generic_draw_bitmap(bmp, x, y)
 ET024006DHU display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_bitmap_tiled(bmp, x1, y1, x2, y2, tile_origin_x, tile_origin_y)
 ET024006DHU display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_line_pixel(x, y, color)   gfx_et024006dhu_draw_line_pixel(x, y, color)
 ET024006DHU display driver specific function, see gfx_et024006dhu_draw_line_pixel. More...
 
#define gfx_draw_pixel(x, y, color)   gfx_et024006dhu_draw_pixel(x, y, color)
 ET024006DHU display driver specific function, see gfx_et024006dhu_draw_pixel. More...
 
#define gfx_duplicate_pixel(color, count)   et024006_DuplicatePixel(color, count)
 ET024006DHU display driver specific function, see et024006_DuplicatePixel. More...
 
#define gfx_get_pixel(x, y)   gfx_et024006dhu_get_pixel(x, y)
 ET024006DHU display driver specific function, see gfx_et024006dhu_get_pixel. More...
 
#define gfx_init()   gfx_et024006dhu_init()
 ET024006DHU display driver specific function, see gfx_et024006dhu_init() More...
 
#define GFX_PANELHEIGHT   ET024006_HEIGHT
 
#define GFX_PANELWIDTH   ET024006_WIDTH
 
#define gfx_put_bitmap(bmp, map_x, map_y, x, y, width, height)   gfx_generic_put_bitmap(bmp, map_x, map_y, x, y, width, height)
 ET024006DHU display driver uses generic gfx implementation for this function. More...
 
#define gfx_set_bottom_right_limit(x, y)   et024006_SetQuickLimits2(x, y)
 ET024006DHU display driver specific function, see et024006_SetQuickLimits2. More...
 
#define gfx_set_limits(x1, y1, x2, y2)   et024006_SetLimits(x1, y1, x2, y2)
 ET024006DHU display driver specific function, see et024006_SetLimits. More...
 
#define gfx_set_orientation(flags)   gfx_et024006dhu_set_orientation(flags)
 ET024006DHU display driver specific function, see gfx_et024006dhu_set_orientation. More...
 
#define gfx_set_top_left_limit(x, y)   et024006_SetQuickLimits(x, y)
 ET024006DHU display driver specific function, see et024006_SetQuickLimits. More...
 

Functions

gfx_color_t gfx_et024006dhu_color (uint8_t r, uint8_t g, uint8_t b)
 Generate native color value from R/G/B values. More...
 
void gfx_et024006dhu_draw_line_pixel (gfx_coord_t x, gfx_coord_t y, gfx_color_t color)
 Draw a single pixel on the screen. More...
 
void gfx_et024006dhu_draw_pixel (gfx_coord_t x, gfx_coord_t y, gfx_color_t color)
 Draw a single pixel on the screen. More...
 
gfx_color_t gfx_et024006dhu_get_pixel (gfx_coord_t x, gfx_coord_t y)
 Get the color of a pixel on the display. More...
 
void gfx_et024006dhu_init (void)
 Initialize the et024006dhu display controller. More...
 
void gfx_et024006dhu_set_orientation (uint8_t flags)
 Set display orientation. More...
 
gfx_coord_t gfx_height
 Current height of screen. More...
 
gfx_coord_t gfx_width
 Current width of screen. More...
 
gfx_coord_t gfx_min_x
 Minimum X of current clipping region. More...
 
gfx_coord_t gfx_min_y
 Maximum Y of current clipping region. More...
 
gfx_coord_t gfx_max_x
 Minimum X of current clipping region. More...
 
gfx_coord_t gfx_max_y
 Maximum Y of current clipping region. More...
 

Driver-specific Definitions

typedef et024006_color_t gfx_color_t
 Data type for color values native to the display. More...
 
typedef uint16_t gfx_coord_t
 Data type representing a coordinate on the screen. More...
 

Graphics Drawing Primitives

#define gfx_draw_horizontal_line(x, y, length, color)   gfx_generic_draw_horizontal_line(x, y, length, color)
 Draw a horizontal line, one pixel wide. More...
 
#define gfx_draw_vertical_line(x, y, length, color)   gfx_generic_draw_vertical_line(x, y, length, color)
 Draw a vertical line, one pixel wide. More...
 
#define gfx_draw_line(x1, y1, x2, y2, color)   gfx_generic_draw_line(x1, y1, x2, y2, color)
 Draw a line between two arbitrary points. More...
 
#define gfx_draw_rect(x, y, width, height, color)   gfx_generic_draw_rect(x, y, width, height, color)
 Draw an outline of a rectangle. More...
 
#define gfx_draw_filled_rect(x, y, width, height, color)   gfx_generic_draw_filled_rect(x, y, width, height, color)
 Draw a filled rectangle. More...
 
#define gfx_draw_circle(x, y, radius, color, octant_mask)   gfx_generic_draw_circle(x, y, radius, color, octant_mask)
 Draw an outline of a circle or arc. More...
 
#define gfx_draw_filled_circle(x, y, radius, color, quadrant_mask)
 Draw a filled circle or sector. More...
 
#define gfx_get_pixmap(pixmap, map_width, map_x, map_y, x, y, width, height)
 Read a rectangular block of pixels from the screen into data memory. More...
 
#define gfx_put_pixmap(pixmap, map_width, map_x, map_y, x, y, width, height)
 Write a rectangular block of pixels stored in data memory to the screen. More...
 

#define gfx_color (   r,
  g,
 
)    gfx_et024006dhu_color(r, g, b)

ET024006DHU display driver specific function, see gfx_et024006dhu_color.

#define gfx_copy_pixels_from_screen (   pixels,
  count 
)    et024006_CopyPixelsFromScreen(pixels, count)

ET024006DHU display driver specific function, see et024006_CopyPixelsFromScreen.

#define gfx_copy_pixels_to_screen (   pixels,
  count 
)    et024006_CopyPixelsToScreen(pixels, count)

ET024006DHU display driver specific function, see et024006_CopyPixelsToScreen.

#define gfx_copy_progmem_pixels_to_screen (   pixels,
  count 
)    et024006_CopyPixelsToScreen(pixels, count)

ET024006DHU display driver specific function available for ATmega and ATXmega devices, see et024006_CopyPixelsToScreen.

#define gfx_draw_bitmap (   bmp,
  x,
 
)    gfx_generic_draw_bitmap(bmp, x, y)

ET024006DHU display driver uses generic gfx implementation for this function.

See gfx_generic_draw_bitmap

#define gfx_draw_bitmap_tiled (   bmp,
  x1,
  y1,
  x2,
  y2,
  tile_origin_x,
  tile_origin_y 
)
Value:
gfx_generic_draw_bitmap_tiled(bmp, x1, y1, x2, y2,\
tile_origin_x, tile_origin_y)
void gfx_generic_draw_bitmap_tiled(const struct gfx_bitmap *bmp, gfx_coord_t x1, gfx_coord_t y1, gfx_coord_t x2, gfx_coord_t y2, gfx_coord_t tile_origin_x, gfx_coord_t tile_origin_y)
Definition: gfx_generic.c:546

ET024006DHU display driver uses generic gfx implementation for this function.

See gfx_generic_draw_bitmap_tiled

#define gfx_draw_circle (   x,
  y,
  radius,
  color,
  octant_mask 
)    gfx_generic_draw_circle(x, y, radius, color, octant_mask)

Draw an outline of a circle or arc.

ET024006DHU display driver uses generic gfx implementation for this function.

The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).

The octant_mask parameter is a bitmask that decides which octants of the circle to draw. Use the GFX_OCTANTn, GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.

Parameters
xX coordinate of center.
yY coordinate of center.
radiusCircle radius in pixels.
colorCircle color in display native format.
octant_maskBitmask indicating which octants to draw.

See gfx_generic_draw_circle

Referenced by main().

#define gfx_draw_filled_circle (   x,
  y,
  radius,
  color,
  quadrant_mask 
)
Value:
gfx_generic_draw_filled_circle(x, y, radius, color,\
quadrant_mask)
void gfx_generic_draw_filled_circle(gfx_coord_t x, gfx_coord_t y, gfx_coord_t radius, gfx_color_t color, uint8_t quadrant_mask)
Definition: gfx_generic.c:296

Draw a filled circle or sector.

ET024006DHU display driver uses generic gfx implementation for this function.

The radius is the distance from the center to the circumference, which means that the total width or height of a circle will be (radius*2+1).

The quadrant_mask parameter is a bitmask that decides which quadrants of the circle to draw. Use the GFX_QUADRANTn, GFX_xHALF and GFX_WHOLE constants and OR them together if required. Radius equal to zero gives a single pixel.

Note
This function only supports quadrants while gfx_draw_circle() supports octants. This is to improve performance on drawing filled circles.
Parameters
xX coordinate of center.
yY coordinate of center.
radiusCircle radius in pixels.
colorCircle color in display native format.
quadrant_maskBitmask indicating which quadrants to draw.

See gfx_generic_draw_filled_circle

Referenced by main().

#define gfx_draw_filled_rect (   x,
  y,
  width,
  height,
  color 
)    gfx_generic_draw_filled_rect(x, y, width, height, color)

Draw a filled rectangle.

ET024006DHU display driver uses generic gfx implementation for this function.

Parameters
xX coordinate of the left side.
yY coordinate of the top side.
widthWidth of the rectangle.
heightHeight of the rectangle.
colorColor of the rectangle, in display native format.

See gfx_generic_draw_filled_rect

Referenced by gfx_draw_char(), gfx_et024006dhu_init(), gfx_generic_draw_bitmap_tiled(), gfx_generic_draw_horizontal_line(), gfx_generic_draw_vertical_line(), gfx_generic_put_bitmap(), and main().

#define gfx_draw_horizontal_line (   x,
  y,
  length,
  color 
)    gfx_generic_draw_horizontal_line(x, y, length, color)

Draw a horizontal line, one pixel wide.

ET024006DHU display driver uses generic gfx implementation for this function.

Parameters
xX coordinate of leftmost pixel.
yY coordinate of the line.
lengthLength of the line in pixels.
colorColor of the line, in display native format.

See gfx_generic_draw_horizontal_line

Referenced by gfx_generic_draw_rect(), and main().

#define gfx_draw_line (   x1,
  y1,
  x2,
  y2,
  color 
)    gfx_generic_draw_line(x1, y1, x2, y2, color)

Draw a line between two arbitrary points.

ET024006DHU display driver uses generic gfx implementation for this function.

Parameters
x1Start X coordinate.
y1Start Y coordinate.
x2End X coordinate.
y2End Y coordinate.
colorColor of the line, in display native format.

See gfx_generic_draw_line

Referenced by main().

#define gfx_draw_line_pixel (   x,
  y,
  color 
)    gfx_et024006dhu_draw_line_pixel(x, y, color)

ET024006DHU display driver specific function, see gfx_et024006dhu_draw_line_pixel.

#define gfx_draw_pixel (   x,
  y,
  color 
)    gfx_et024006dhu_draw_pixel(x, y, color)

ET024006DHU display driver specific function, see gfx_et024006dhu_draw_pixel.

#define gfx_draw_rect (   x,
  y,
  width,
  height,
  color 
)    gfx_generic_draw_rect(x, y, width, height, color)

Draw an outline of a rectangle.

ET024006DHU display driver uses generic gfx implementation for this function.

Parameters
xX coordinate of the left side.
yY coordinate of the top side.
widthWidth of the rectangle.
heightHeight of the rectangle.
colorColor of the rectangle, in display native format.

See gfx_generic_draw_rect

Referenced by main().

#define gfx_draw_vertical_line (   x,
  y,
  length,
  color 
)    gfx_generic_draw_vertical_line(x, y, length, color)

Draw a vertical line, one pixel wide.

ET024006DHU display driver uses generic gfx implementation for this function.

Parameters
xX coordinate of the line.
yY coordinate of the topmost pixel.
lengthLength of the line in pixels.
colorColor of the line, in display native format.

See gfx_generic_draw_vertical_line

Referenced by gfx_generic_draw_filled_circle(), gfx_generic_draw_rect(), and main().

#define gfx_duplicate_pixel (   color,
  count 
)    et024006_DuplicatePixel(color, count)

ET024006DHU display driver specific function, see et024006_DuplicatePixel.

#define gfx_get_pixel (   x,
 
)    gfx_et024006dhu_get_pixel(x, y)

ET024006DHU display driver specific function, see gfx_et024006dhu_get_pixel.

#define gfx_get_pixmap (   pixmap,
  map_width,
  map_x,
  map_y,
  x,
  y,
  width,
  height 
)
Value:
gfx_generic_get_pixmap(pixmap, map_width, map_x, map_y, x, y,\
uint8_t height
Definition: gfx_text.h:130
void gfx_generic_get_pixmap(gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
Definition: gfx_generic.c:358
uint8_t width
Definition: gfx_text.h:128

Read a rectangular block of pixels from the screen into data memory.

ET024006DHU display driver uses generic gfx implementation for this function.

If the area to read is outside the clipping region, those pixels will not be read, and the corresponding data memory will be left untouched. Note that this function fails if width or height is negative or the pixel rectangle is outside the pixmap buffer extents. Clipping is only performed on the screen, not inside the pixmap buffer itself. Note that there is no checking if the pixel rectangle exceeds the bottom of the pixmap buffer.

Parameters
pixmapPointer to pixel buffer in data memory.
map_widthWidth of the pixel buffer.
map_xX coordinate inside pixel buffer.
map_yY coordinate inside pixel buffer.
xX coordinate on screen.
yY coordinate on screen.
widthWidth of pixel rectangle to copy.
heightHeight of pixel rectangle to copy.

See gfx_generic_get_pixmap

#define gfx_init ( )    gfx_et024006dhu_init()

ET024006DHU display driver specific function, see gfx_et024006dhu_init()

Referenced by main().

#define GFX_PANELHEIGHT   ET024006_HEIGHT

Referenced by gfx_et024006dhu_init().

#define GFX_PANELWIDTH   ET024006_WIDTH

Referenced by gfx_et024006dhu_init().

#define gfx_put_bitmap (   bmp,
  map_x,
  map_y,
  x,
  y,
  width,
  height 
)    gfx_generic_put_bitmap(bmp, map_x, map_y, x, y, width, height)

ET024006DHU display driver uses generic gfx implementation for this function.

See gfx_generic_put_bitmap

#define gfx_put_pixmap (   pixmap,
  map_width,
  map_x,
  map_y,
  x,
  y,
  width,
  height 
)
Value:
gfx_generic_put_pixmap(pixmap, map_width, map_x, map_y, x, y,\
uint8_t height
Definition: gfx_text.h:130
void gfx_generic_put_pixmap(const gfx_color_t *pixmap, gfx_coord_t map_width, gfx_coord_t map_x, gfx_coord_t map_y, gfx_coord_t x, gfx_coord_t y, gfx_coord_t width, gfx_coord_t height)
Definition: gfx_generic.c:452
uint8_t width
Definition: gfx_text.h:128

Write a rectangular block of pixels stored in data memory to the screen.

ET024006DHU display driver uses generic gfx implementation for this function.

If the area to write is outside the clipping region, those pixels will not be written. Note that this function fails if the width or height is negative or the pixel rectangle is outside the pixmap buffer extents. Clipping is only performed on the screen, not inside the pixmap buffer itself. Note that there is no checking if the pixel rectangle exceeds the bottom of the pixmap buffer.

Parameters
pixmapPointer to pixel buffer in data memory.
map_widthWidth of the pixel buffer.
map_xX coordinate inside pixel buffer.
map_yY coordinate inside pixel buffer.
xX coordinate on screen.
yY coordinate on screen.
widthWidth of pixel rectangle to copy.
heightHeight of pixel rectangle to copy.

See gfx_generic_put_pixmap

#define gfx_set_bottom_right_limit (   x,
 
)    et024006_SetQuickLimits2(x, y)

ET024006DHU display driver specific function, see et024006_SetQuickLimits2.

#define gfx_set_limits (   x1,
  y1,
  x2,
  y2 
)    et024006_SetLimits(x1, y1, x2, y2)

ET024006DHU display driver specific function, see et024006_SetLimits.

#define gfx_set_orientation (   flags)    gfx_et024006dhu_set_orientation(flags)

ET024006DHU display driver specific function, see gfx_et024006dhu_set_orientation.

#define gfx_set_top_left_limit (   x,
 
)    et024006_SetQuickLimits(x, y)

ET024006DHU display driver specific function, see et024006_SetQuickLimits.

Data type for color values native to the display.

Data type representing a coordinate on the screen.

gfx_color_t gfx_et024006dhu_color ( uint8_t  r,
uint8_t  g,
uint8_t  b 
)

Generate native color value from R/G/B values.

Converts 8-bit R/G/B values to a color value native to the display.

The macro GFX_COLOR does the same, only allows the preprocessor to handle the calculations.

Parameters
r8-bit red value.
g8-bit green value.
b8-bit blue value.
Returns
Color value in display native format.

References GFX_COLOR.

void gfx_et024006dhu_draw_line_pixel ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_color_t  color 
)

Draw a single pixel on the screen.

This function draws a single pixel on screen only setting top limit which makes it more suitable for line drawing. If outside the clipping region, nothing is drawn.

Parameters
xX coordinate of the pixel to be drawn.
yY coordinate of the pixel to be drawn.
colorColor value of the pixel in display native format.

References et024006_DrawQuickPixel(), gfx_max_x, gfx_max_y, gfx_min_x, and gfx_min_y.

void gfx_et024006dhu_draw_pixel ( gfx_coord_t  x,
gfx_coord_t  y,
gfx_color_t  color 
)

Draw a single pixel on the screen.

Draw a single pixel on screen setting top and bottom limits. If outside the clipping region, nothing is drawn.

Parameters
xX coordinate of the pixel to be drawn.
yY coordinate of the pixel to be drawn.
colorColor value of the pixel in display native format.

References et024006_DrawPixel(), gfx_max_x, gfx_max_y, gfx_min_x, and gfx_min_y.

gfx_color_t gfx_et024006dhu_get_pixel ( gfx_coord_t  x,
gfx_coord_t  y 
)

Get the color of a pixel on the display.

Parameters
xX coordinate of the pixel to be sampled.
yY coordinate of the pixel to be sampled.
Returns
Color value of the pixel at (x, y) in display native format, or GFX_COLOR_INVALID if outside the clipping region.

References et024006_GetPixel(), GFX_COLOR_INVALID, gfx_max_x, gfx_max_y, gfx_min_x, and gfx_min_y.

void gfx_et024006dhu_init ( void  )

Initialize the et024006dhu display controller.

This function will be called when calling gfx_init. It will draw a black bacground to the display and enable the display backlight if available.

References et024006_Init(), ET024006DHU_BL_PIN, GFX_COLOR, gfx_draw_filled_rect, gfx_height, GFX_PANELHEIGHT, GFX_PANELWIDTH, gfx_set_clipping(), gfx_width, IOPORT_DIR_OUTPUT, ioport_enable_pin(), ioport_set_pin_dir(), ioport_set_pin_level(), sysclk_get_cpu_hz(), and sysclk_get_pbb_hz().

void gfx_et024006dhu_set_orientation ( uint8_t  flags)

Set display orientation.

Set the display orientation

Parameters
flags

gfx_coord_t gfx_height

Current height of screen.

Referenced by gfx_et024006dhu_init(), gfx_generic_draw_line(), gfx_get_height(), and gfx_set_clipping().

gfx_coord_t gfx_width

Current width of screen.

Referenced by gfx_et024006dhu_init(), gfx_generic_draw_line(), gfx_get_width(), and gfx_set_clipping().