Microchip® Advanced Software Framework

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

This is hardware specific configuration that configures the graphical service for use with the HX8347A display controller and the ET024006DHU 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)   HX8347A_COLOR(r, g, b)
 
#define gfx_color(r, g, b)   gfx_hx8347a_color(r, g, b)
 HX8347A display driver specific function, see gfx_hx8347a_color. More...
 
#define GFX_COLOR_INVALID   GFX_COLOR(5, 5, 5)
 It is not possible to define a color that is outside the color spectrum for the HX8347A driver, hence use a dark color as an invalid color. More...
 
#define GFX_COLOR_TRANSPARENT   GFX_COLOR(240, 0, 240)
 It is not possible to define a color that is outside the color spectrum for the HX8347A driver, hence use a very uncommon strong magenta color as transparency mask color. More...
 
#define gfx_copy_pixels_from_screen(pixels, count)   hx8347a_copy_pixels_from_screen(pixels, count)
 HX8347A display driver specific function, see hx8347a_copy_pixels_from_screen. More...
 
#define gfx_copy_pixels_to_screen(pixels, count)   hx8347a_copy_pixels_to_screen(pixels, count)
 HX8347A display driver specific function, see hx8347a_copy_pixels_to_screen. More...
 
#define gfx_copy_progmem_pixels_to_screen(pixels, count)   hx8347a_copy_progmem_pixels_to_screen(pixels, count)
 HX8347A display driver specific function available for ATmega and ATXmega devices, see hx8347a_copy_progmem_pixels_to_screen. More...
 
#define gfx_draw_bitmap(bmp, x, y)   gfx_generic_draw_bitmap(bmp, x, y)
 HX8347A 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)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_circle(x, y, radius, color, octant_mask)   gfx_generic_draw_circle(x, y, radius, color, octant_mask)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_filled_circle(x, y, radius, color, quadrant_mask)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_filled_rect(x, y, width, height, color)   gfx_generic_draw_filled_rect(x, y, width, height, color)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_horizontal_line(x, y, length, color)   gfx_generic_draw_horizontal_line(x, y, length, color)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_line(x1, y1, x2, y2, color)   gfx_generic_draw_line(x1, y1, x2, y2, color)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_line_pixel(x, y, color)
 HX8347A display driver specific function, see gfx_hx8347a_draw_line_pixel. More...
 
#define gfx_draw_pixel(x, y, color)   gfx_hx8347a_draw_pixel(x, y, color)
 HX8347A display driver specific function, see gfx_hx8347a_draw_pixel. More...
 
#define gfx_draw_rect(x, y, width, height, color)   gfx_generic_draw_rect(x, y, width, height, color)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_draw_vertical_line(x, y, length, color)   gfx_generic_draw_vertical_line(x, y, length, color)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_duplicate_pixel(color, count)   hx8347a_duplicate_pixel(color, count)
 HX8347A display driver specific function, see hx8347a_duplicate_pixel. More...
 
#define gfx_get_pixel(x, y)   gfx_hx8347a_get_pixel(x, y)
 HX8347A display driver specific function, see gfx_hx8347a_get_pixel. More...
 
#define gfx_get_pixmap(pixmap, map_width, map_x, map_y, x, y, width, height)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_init()   gfx_hx8347a_init()
 HX8347A display driver specific function, see gfx_hx8347a_init. More...
 
#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)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_put_pixmap(pixmap, map_width, map_x, map_y, x, y, width, height)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_set_bottom_right_limit(x, y)   hx8347a_set_bottom_right_limit(x, y)
 HX8347A display driver specific function, see hx8347a_set_bottom_right_limit. More...
 
#define gfx_set_ext_handler(ext_draw_handler)   gfx_generic_set_ext_handler(ext_draw_handler)
 HX8347A display driver uses generic gfx implementation for this function. More...
 
#define gfx_set_limits(x1, y1, x2, y2)   hx8347a_set_limits(x1, y1, x2, y2)
 HX8347A display driver specific function, see hx8347a_set_limits. More...
 
#define gfx_set_orientation(flags)   gfx_hx8347a_set_orientation(flags)
 HX8347A display driver specific function, see gfx_hx8347a_set_orientation. More...
 
#define gfx_set_top_left_limit(x, y)   hx8347a_set_top_left_limit(x, y)
 HX8347A display driver specific function, see hx8347a_set_top_left_limit. More...
 
#define gfx_sync()   gfx_generic_sync()
 HX8347A display driver uses generic gfx implementation for this function. More...
 

Functions

gfx_color_t gfx_hx8347a_color (uint8_t r, uint8_t g, uint8_t b)
 Generate native color value from R/G/B values. More...
 
void gfx_hx8347a_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_hx8347a_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_hx8347a_get_pixel (gfx_coord_t x, gfx_coord_t y)
 Get the color of a pixel on the display. More...
 
void gfx_hx8347a_init (void)
 Initialize the hx8347a display controller. More...
 
void gfx_hx8347a_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...
 
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...
 
void gfx_ili9341_set_orientation (uint8_t flags)
 Set display orientation. More...
 
gfx_color_t gfx_ili9341_color (uint8_t r, uint8_t g, uint8_t b)
 Generate native color value from R/G/B values. More...
 
gfx_color_t gfx_ili9341_get_pixel (gfx_coord_t x, gfx_coord_t y)
 Get the color of a pixel on the display. More...
 
void gfx_ili9341_draw_pixel (gfx_coord_t x, gfx_coord_t y, gfx_color_t color)
 Draw a single pixel on the screen. More...
 
void gfx_ili9341_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_ili9341_init (void)
 Initialize the ili9341 display controller. More...
 

Driver-specific Definitions

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

#define GFX_COLOR (   r,
  g,
 
)    HX8347A_COLOR(r, g, b)
#define gfx_color (   r,
  g,
 
)    gfx_hx8347a_color(r, g, b)

HX8347A display driver specific function, see gfx_hx8347a_color.

#define GFX_COLOR_INVALID   GFX_COLOR(5, 5, 5)

It is not possible to define a color that is outside the color spectrum for the HX8347A driver, hence use a dark color as an invalid color.

Referenced by gfx_hx8347a_get_pixel(), and gfx_ili9341_get_pixel().

#define GFX_COLOR_TRANSPARENT   GFX_COLOR(240, 0, 240)

It is not possible to define a color that is outside the color spectrum for the HX8347A driver, hence use a very uncommon strong magenta color as transparency mask color.

Referenced by draw_finger_square(), draw_pallet_labels(), gfx_draw_char(), main(), show_out_of_memory_error(), wtk_button_handler(), wtk_check_box_handler(), wtk_frame_handler(), wtk_label_handler(), and wtk_radio_button_handler().

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

HX8347A display driver specific function, see hx8347a_copy_pixels_from_screen.

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

HX8347A display driver specific function, see hx8347a_copy_pixels_to_screen.

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

HX8347A display driver specific function available for ATmega and ATXmega devices, see hx8347a_copy_progmem_pixels_to_screen.

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

HX8347A 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

HX8347A 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)

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_draw_circle

Referenced by main(), and wtk_radio_button_handler().

#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

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_draw_filled_circle

Referenced by main(), mxt_handler(), wtk_continue_drag(), wtk_frame_handler(), wtk_radio_button_handler(), and wtk_start_drag().

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

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_draw_horizontal_line

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

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

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_draw_line

Referenced by main(), wtk_plot_draw(), and wtk_plot_grid_draw().

#define gfx_draw_line_pixel (   x,
  y,
  color 
)
Value:
color)
void gfx_hx8347a_draw_line_pixel(gfx_coord_t x, gfx_coord_t y, gfx_color_t color)
Draw a single pixel on the screen.
Definition: gfx_hx8347a_et024006dhu.c:109

HX8347A display driver specific function, see gfx_hx8347a_draw_line_pixel.

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

HX8347A display driver specific function, see gfx_hx8347a_draw_pixel.

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

HX8347A display driver uses generic gfx implementation for this function.

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 
)    hx8347a_duplicate_pixel(color, count)

HX8347A display driver specific function, see hx8347a_duplicate_pixel.

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

HX8347A display driver specific function, see gfx_hx8347a_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,\
width, height)
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

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_get_pixmap

Referenced by wtk_continue_drag(), and wtk_start_drag().

#define gfx_init ( )    gfx_hx8347a_init()

HX8347A display driver specific function, see gfx_hx8347a_init.

Referenced by main().

#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)

HX8347A 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,\
width, height)
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

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_put_pixmap

Referenced by wtk_continue_drag(), and wtk_stop_drag().

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

HX8347A display driver specific function, see hx8347a_set_bottom_right_limit.

#define gfx_set_ext_handler (   ext_draw_handler)    gfx_generic_set_ext_handler(ext_draw_handler)

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_set_ext_handler

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

HX8347A display driver specific function, see hx8347a_set_limits.

#define gfx_set_orientation (   flags)    gfx_hx8347a_set_orientation(flags)

HX8347A display driver specific function, see gfx_hx8347a_set_orientation.

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

HX8347A display driver specific function, see hx8347a_set_top_left_limit.

#define gfx_sync (   void)    gfx_generic_sync()

HX8347A display driver uses generic gfx implementation for this function.

See gfx_generic_sync

Data type for color values native to the display.

Data type representing a coordinate on the screen.

gfx_color_t gfx_hx8347a_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_hx8347a_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 gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_top_left_limit(), and hx8347a_write_gram().

void gfx_hx8347a_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 gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_limits(), and hx8347a_write_gram().

gfx_color_t gfx_hx8347a_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 gfx_bitmap::color, GFX_COLOR_INVALID, gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_limits(), and hx8347a_read_gram().

void gfx_hx8347a_init ( void  )

Initialize the hx8347a display controller.

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

References GFX_COLOR_BLACK, gfx_draw_filled_rect, gfx_height, gfx_set_clipping(), gfx_width, hx8347a_backlight_on(), HX8347A_DEFAULT_HEIGHT, HX8347A_DEFAULT_WIDTH, and hx8347a_init().

void gfx_hx8347a_set_orientation ( uint8_t  flags)
gfx_color_t gfx_ili9341_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_ili9341_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 gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_top_left_limit(), and ili9341_write_gram().

void gfx_ili9341_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 gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_limits(), and ili9341_write_gram().

gfx_color_t gfx_ili9341_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 gfx_bitmap::color, GFX_COLOR_INVALID, gfx_max_x, gfx_max_y, gfx_min_x, gfx_min_y, gfx_set_limits(), and ili9341_read_gram().

void gfx_ili9341_init ( void  )

Initialize the ili9341 display controller.

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

References GFX_COLOR_BLACK, gfx_draw_filled_rect, gfx_height, gfx_set_clipping(), gfx_width, ili9341_backlight_on(), ILI9341_DEFAULT_HEIGHT, ILI9341_DEFAULT_WIDTH, and ili9341_init().

void gfx_ili9341_set_orientation ( uint8_t  flags)

gfx_coord_t gfx_max_x

Minimum X of current clipping region.

gfx_coord_t gfx_max_y

Maximum Y of current clipping region.

gfx_coord_t gfx_min_x

Minimum X of current clipping region.

gfx_coord_t gfx_min_y

Maximum Y of current clipping region.

gfx_coord_t gfx_width

Current width of screen.