draw.h File Reference

Buffered graphics routines. More...

#include "pic_utils.h"
Include dependency graph for draw.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Defines

#define BOTTOM_LEFT   1
#define draw_paint()   drv_paint()
#define DRAW_PIXELS_PER_BYTE   (8 / DRAW_BITS_PER_PIXEL)
#define draw_set_display_brightness(brightness)   drv_set_display_brightness(brightness)
#define drv_setup()   drv_setup_io()
#define HORIZONTAL   0
#define TOP_LEFT   0
#define VERTICAL   1

Functions

void draw_bitmap (uns8 x, uns8 y, uns8 colour, char *bitmap)
void draw_circle (int x_centre, int y_centre, int r, uns8 colour)
void draw_circle2 (int x_centre, int y_centre, int r, uns8 colour)
void draw_clear_screen ()
uns8 draw_get_pixel (uns8 x, uns8)
void draw_init ()
uns16 draw_length_str (char *str)
void draw_line (uns8 x0, uns8 y0, uns8 x1, uns8 y1, uns8 colour)
void draw_print_buffer ()
void draw_print_str (uns8 x, uns8 y, uns8 width, uns8 start_pixel, uns8 colour, char *str)
void draw_rect (uns8 x, uns8 y, uns16 width, uns8 height, uns8 colour)
void draw_set_pixel (uns8 x, uns8 y, uns8 colour)
void draw_setup_io ()
void drv_init ()
void drv_paint ()
void drv_print_buffer ()
void drv_refresh ()
void drv_set_display_brightness (uns8 brightness)
void drv_setup_io ()

Detailed Description

You will need to pick a hardware buffering mode for the draw routines.

Draw buffer addressing

4 | U V W X Y 3 | P Q R S T 2 | K L M N O 1 | F G H I J 0 | A B C D E --------- 0 1 2 3 4 DRAW_HW_Y_ORIGIN == BOTTOM_LEFT DRAW_HW_BUFFER_ORIENTATION == HORIZONTAL

0 | A B C D E 1 | F G H I J 2 | K L M N O 3 | P Q R S T 4 | U V W X Y --------- 0 1 2 3 4 DRAW_HW_Y_ORIGIN == TOP_LEFT DRAW_HW_BUFFER_ORIENTATION == HORIZONTAL

0 | E J O T Y 1 | D I N S X 2 | C H M R W 3 | B G L Q V 4 | A F K P U --------- 0 1 2 3 4 DRAW_HW_Y_ORIGIN == BOTTOM_LEFT DRAW_HW_BUFFER_ORIENTATION == VERTICAL

0 | A F K P U 1 | B G L Q V 2 | C H M R W 3 | D I N S X 4 | E J O T Y --------- 0 1 2 3 4 DRAW_HW_Y_ORIGIN == TOP_LEFT DRAW_HW_BUFFER_ORIENTATION == VERTICAL

Put the following in your config.h:

// - - - - - - - - - - - - - - - - - - - - 
// Draw defines
// - - - - - - - - - - - - - - - - - - - - 

#define DRAW_PIXELS_HIGH 24
#define DRAW_PIXELS_WIDE 16
#define DRAW_BITS_PER_PIXEL 1

#define DRAW_HW_Y_ORIGIN TOP_LEFT
// or BOTTOM_LEFT

#define DRAW_HW_BUFFER_ORIENTATION VERTICAL
// or HORIZONTAL

//Enable debug to see what's happening under the hood
//#define DRAW_DEBUG

// - - - - - - - - - - - - - - - - - - - - 

Definition in file draw.h.


Define Documentation

#define BOTTOM_LEFT   1

Definition at line 120 of file draw.h.

 
#define draw_paint (  )     drv_paint()

Definition at line 136 of file draw.h.

Referenced by draw_tests_run().

#define DRAW_PIXELS_PER_BYTE   (8 / DRAW_BITS_PER_PIXEL)

Definition at line 122 of file draw.h.

Referenced by draw_print_buffer(), and drv_paint().

#define draw_set_display_brightness ( brightness   )     drv_set_display_brightness(brightness)

Definition at line 157 of file draw.h.

 
#define drv_setup (  )     drv_setup_io()

Definition at line 151 of file draw.h.

#define HORIZONTAL   0

Definition at line 116 of file draw.h.

#define TOP_LEFT   0

Definition at line 119 of file draw.h.

#define VERTICAL   1

Definition at line 117 of file draw.h.


Function Documentation

void draw_bitmap ( uns8  x,
uns8  y,
uns8  colour,
char *  bitmap 
)

Definition at line 591 of file draw.c.

References draw_set_pixel(), and uns8.

Referenced by draw_tests_run().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_circle ( int  x_centre,
int  y_centre,
int  r,
uns8  colour 
)

Definition at line 390 of file draw.c.

References draw_circle_points().

Here is the call graph for this function:

void draw_circle2 ( int  x_centre,
int  y_centre,
int  r,
uns8  colour 
)

Definition at line 426 of file draw.c.

References draw_circle_points2().

Referenced by draw_tests_run().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_clear_screen (  ) 

Definition at line 49 of file draw.c.

References draw_buffer0, DRAW_TOTAL_BUFFER_SIZE, and uns8.

Referenced by draw_init(), and draw_tests_run().

Here is the caller graph for this function:

uns8 draw_get_pixel ( uns8  x,
uns8   
)

Definition at line 246 of file draw.c.

void draw_init (  ) 

Definition at line 128 of file draw.c.

References draw_clear_screen(), and drv_init().

Here is the call graph for this function:

uns16 draw_length_str ( char *  str  ) 

Definition at line 514 of file draw.c.

References PicPack5x7_index, uns16, and uns8.

void draw_line ( uns8  x0,
uns8  y0,
uns8  x1,
uns8  y1,
uns8  colour 
)

Definition at line 307 of file draw.c.

References draw_set_pixel().

Referenced by draw_circle_lines(), and draw_tests_run().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_print_buffer (  ) 

Definition at line 266 of file draw.c.

References draw_buffer0, DRAW_PIXELS_PER_BYTE, serial_print_int(), serial_print_int_hex(), serial_print_str(), serial_putc(), uns16, and uns8.

Here is the call graph for this function:

void draw_print_str ( uns8  x,
uns8  y,
uns8  width,
uns8  start_pixel,
uns8  colour,
char *  str 
)

Definition at line 529 of file draw.c.

References draw_set_pixel(), PicPack5x7_bitmap_0, PicPack5x7_bitmap_1, PicPack5x7_index, uns16, and uns8.

Referenced by draw_tests_run().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_rect ( uns8  x,
uns8  y,
uns16  width,
uns8  height,
uns8  colour 
)

Definition at line 251 of file draw.c.

References draw_set_pixel(), and uns16.

Referenced by draw_tests_run().

Here is the call graph for this function:

Here is the caller graph for this function:

void draw_set_pixel ( uns8  x,
uns8  y,
uns8  colour 
)

Definition at line 135 of file draw.c.

References draw_buffer0, uns16, and uns8.

Referenced by draw_bitmap(), draw_circle_points(), draw_circle_points2(), draw_line(), draw_print_str(), draw_rect(), and draw_tests_run().

Here is the caller graph for this function:

void draw_setup_io (  ) 

Definition at line 124 of file draw.c.

References drv_setup_io().

Here is the call graph for this function:

void drv_init (  ) 

Definition at line 287 of file drv_ea_ldp6416.c.

References ea_ldp6416_init(), ea_ldp6432_init(), ea_ldp8008_init(), HT1632_CMD_PMOS_16_COMMON, ht1632_init(), and pcd8544_init().

Referenced by draw_init().

Here is the call graph for this function:

Here is the caller graph for this function:

void drv_paint (  ) 
void drv_print_buffer (  ) 

Definition at line 94 of file drv_ea_ldp6416.c.

References buffer0, serial_print_int(), serial_print_nl(), serial_print_spc(), and uns8.

Here is the call graph for this function:

void drv_refresh (  ) 
void drv_set_display_brightness ( uns8  brightness  ) 

Definition at line 108 of file drv_ea_ldp6416.c.

References bright_level, and MAX_BRIGHTNESS.

void drv_setup_io (  ) 

Definition at line 283 of file drv_ea_ldp6416.c.

References ea_ldp6416_setup_io(), ea_ldp6432_setup_io(), ea_ldp8008_setup_io(), ht1632_setup_io(), and pcd8544_setup_io().

Referenced by draw_setup_io().

Here is the call graph for this function:

Here is the caller graph for this function:


Generated on Wed Dec 8 13:47:02 2010 for Pic Pack by  doxygen 1.6.1