Display Simple Graphics library
v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
|
#include "simpletools.h"
Go to the source code of this file.
Data Structures | |
struct | screen_st |
Macros | |
#define | SMALL 1 |
#define | MEDIUM 2 |
#define | LARGE 3 |
#define | FONT_SANS 0 |
#define | FONT_SERIF 1 |
#define | FONT_SCRIPT 2 |
#define | FONT_BUBBLE 3 |
#define | INTF_SPI_NO_BUFFER 0b00 |
#define | INTF_SPI_WITH_BUFFER 0b10 |
#define | INTF_I2C_NO_BUFFER 0b01 |
#define | INTF_I2C_WITH_BUFFER 0b11 |
#define | gfx_swap(a, b) (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) |
#define | absv(x) ((x)<0 ? -(x) : (x)) |
#define | HEX -16 |
#define | OCT -8 |
#define | BIN -2 |
#define | DEC -10 |
Typedefs | |
typedef struct screen_st | screen_t |
typedef screen_t | screen |
Functions | |
void | clearDisplay (screen_t *dev) |
Clears (sets to the native background color of the screen, usually black) the entire screen. More... | |
void | updateDisplay (screen_t *dev) |
Updates the display by writing the image buffer to it. Not necessary for screens that have their own image buffers. More... | |
void | resetDisplay (screen_t *dev) |
Resets the display. More... | |
void | drawPixel (screen_t *dev, int x, int y, int color) |
Draws a single pixel in the specified color. More... | |
void | drawFastHLine (screen_t *dev, int x, int y, int w, int color) |
Draws a horizontal line in the specified color. More... | |
void | drawFastVLine (screen_t *dev, int x, int y, int h, int color) |
Draws a vertical line in the specified color. More... | |
void | drawLine (screen_t *dev, int x0, int y0, int x1, int y1, int color) |
Draws a line in the specified color. More... | |
void | drawCircle (screen_t *dev, int x0, int y0, int r, int color) |
Draws a circle in the specified color. More... | |
void | drawCircleHelper (screen_t *dev, int x0, int y0, int r, char cornername, int color) |
Helper function used to help draw circles and rectangles with rounded corners. More... | |
void | fillCircle (screen_t *dev, int x0, int y0, int r, int color) |
Draws a filled circle in the specified color. More... | |
void | fillCircleHelper (screen_t *dev, int x0, int y0, int r, char cornername, int delta, int color) |
Helper function used to draw filled circles and rectangles with rounded corners. More... | |
void | drawRect (screen_t *dev, int x, int y, int w, int h, int color) |
Draws a rectangle in the specified color. More... | |
void | fillRect (screen_t *dev, int x, int y, int w, int h, int color) |
Draws a filled rectangle in the specified color. More... | |
void | drawRoundRect (screen_t *dev, int x, int y, int w, int h, int r, int color) |
Draws a rectangle with rounded corners in the specified color. More... | |
void | fillRoundRect (screen_t *dev, int x, int y, int w, int h, int r, int color) |
Draws a filled rectangle with rounded corners in the specified color. More... | |
void | drawTriangle (screen_t *dev, int x0, int y0, int x1, int y1, int x2, int y2, int color) |
Draws a triangle with in the specified color. More... | |
void | fillTriangle (screen_t *dev, int x0, int y0, int x1, int y1, int x2, int y2, int color) |
Draws a filled triangle with in the specified color. More... | |
void | drawCopy (screen_t *dev, int x, int y, int w, int h, int x1, int y1) |
Copies a rectagle and draws it at another location on the screen. More... | |
void | setTextSize (screen_t *dev, char s) |
Sets the size of the font to be used. Range is from 1 to 3. Size (1) is 5x7 (6x8 spacing) pixels, size (2) is 11x15 (12x16 spacing) pixels and size (3) is 15x23 (16x24 spacing) pixels. More... | |
void | setTextFont (screen_t *dev, char f) |
Sets the font face to be used. Range is from 0 to 3. More... | |
void | setTextColor (screen_t *dev, int color) |
Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent. More... | |
void | setBgColor (screen_t *dev, int color) |
Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent. More... | |
void | setTextWrap (screen_t *dev, char w) |
Toggles automatic wrapping of text printed to the screen. More... | |
void | setCursor (screen_t *dev, int x, int y, char size) |
Sets the cursor position based on the size parameter. More... | |
int | drawPrint (screen_t *dev, const char *fmt,...) |
Print format "..." args to the screen. The output is limited to 128 bytes. More... | |
void | drawNumber (screen_t *dev, float d, int r) |
Prints a number to the screen starting at the cursor position. Output is limited to 64 bytes. More... | |
void | drawText (screen_t *dev, char *myString) |
Prints a string of text to the screen starting at the cursor position. Output is limited to 64 bytes. More... | |
void | drawChar (screen_t *dev, char c) |
Prints single ASCII-encoded characters to the screen. Characters 32 (space) to 126 (~) are rendered. All other characters are rendered as a box. More... | |
int | getCursorX (screen_t *dev) |
Returns the current horizontal position of the cursor, measured from the left side of the screen in pixels. More... | |
int | getCursorY (screen_t *dev) |
Returns the current vertical position of the cursor, measured from the top of the screen in pixels. More... | |
void | setDisplayRotation (screen_t *dev, char r) |
Sets the screen's orientation. More... | |
char | getDisplayRotation (screen_t *dev) |
Returns the screen's orientation. More... | |
int | getDisplayWidth (screen_t *dev) |
Returns the width of the display in pixels with screen rotation taken into account. More... | |
int | getDisplayHeight (screen_t *dev) |
Returns the height of the display in pixels with screen rotation taken into account. More... | |
void | loadFonts (screen_t *dev, i2c *eeBus) |
Internal function used to load the EEPROM addresses of the bitmapped fonts to the device's structure. This function is called by the init function in the display's library. It can be called at any time to point to fonts stored in an EEPROM attached to a different i2c bus. More... | |
void | drawCharSmall (screen_t *dev, unsigned char c) |
Low-level helper function for printing single characters to the screen in the small (5x7) font. More... | |
void | drawCharMedium (screen_t *dev, unsigned char c) |
Low-level helper function for printing single characters to the screen in the medium (11x15) font. More... | |
void | drawCharLarge (screen_t *dev, unsigned char c) |
Low-level helper function for printing single characters to the screen in the large (17x23) font. More... | |
void | invertDisplay (screen_t *dev, char i) |
Toggles the invert/normal display modes for the display. Depending on the display type it may only invert existing drawings, or it may invert both existing and colors drawn when inversion is set. More... | |
void | sleepWakeDisplay (screen_t *dev, char i) |
Toggle the display's sleep/wake mode. Not supported by all displays. More... | |
void | scrollDisplay (screen_t *dev, int h, int v) |
Set the display's vertical or hrizontal scrolling functions. Not supported by all displays, and different display types behave differently. More... | |
char | isInverted (screen_t *dev) |
Returns the status of the screen's colors - normal or inverted. More... | |
char | isAsleep (screen_t *dev) |
Returns whether the screen is currently in a sleep mode or awake. More... | |
unsigned char | getScrollVertical (screen_t *dev) |
Returns a value representing the status or speed of the display's vertical scroll. More... | |
unsigned char | getScrollHorizontal (screen_t *dev) |
Returns a value representing the status or speed of the display's horizontal scroll. More... | |
void | drawBitmap (screen_t *dev, char *imgdir, int x, int y) |
Draw an image (bitmap) at the specified (x,y) position. Requires an SD card to be mounted. More... | |
#define absv | ( | x | ) | ((x)<0 ? -(x) : (x)) |
#define BIN -2 |
#define DEC -10 |
#define FONT_BUBBLE 3 |
#define FONT_SANS 0 |
#define FONT_SCRIPT 2 |
#define FONT_SERIF 1 |
#define gfx_swap | ( | a, | |
b | |||
) | (((a) ^= (b)), ((b) ^= (a)), ((a) ^= (b))) |
#define HEX -16 |
#define INTF_I2C_NO_BUFFER 0b01 |
#define INTF_I2C_WITH_BUFFER 0b11 |
#define INTF_SPI_NO_BUFFER 0b00 |
#define INTF_SPI_WITH_BUFFER 0b10 |
#define LARGE 3 |
#define MEDIUM 2 |
#define OCT -8 |
#define SMALL 1 |
void clearDisplay | ( | screen_t * | dev | ) |
Clears (sets to the native background color of the screen, usually black) the entire screen.
dev | Pointer to the display's device structure returned by the initialization function. |
void drawBitmap | ( | screen_t * | dev, |
char * | imgdir, | ||
int | x, | ||
int | y | ||
) |
Draw an image (bitmap) at the specified (x,y) position.
Requires an SD card to be mounted.
dev | Pointer to the display's device structure returned by the initialization function. |
imgdir | String of the filename of the bitmap stored on the SD card. |
x | Horizontal coordinate of the top-left corner of where to draw the image. |
y | Vertical coordinate of the top-left corner of where to draw the image. |
void drawChar | ( | screen_t * | dev, |
char | c | ||
) |
Prints single ASCII-encoded characters to the screen. Characters 32 (space) to 126 (~) are rendered. All other characters are rendered as a box.
dev | Pointer to the display's device structure returned by the initialization function. |
c | ASCII-encoded character to draw. |
void drawCharLarge | ( | screen_t * | dev, |
unsigned char | c | ||
) |
Low-level helper function for printing single characters to the screen in the large (17x23) font.
dev | Pointer to the display's device structure returned by the initialization function. |
c | ASCII-encoded character to draw. |
void drawCharMedium | ( | screen_t * | dev, |
unsigned char | c | ||
) |
Low-level helper function for printing single characters to the screen in the medium (11x15) font.
dev | Pointer to the display's device structure returned by the initialization function. |
c | ASCII-encoded character to draw. |
void drawCharSmall | ( | screen_t * | dev, |
unsigned char | c | ||
) |
Low-level helper function for printing single characters to the screen in the small (5x7) font.
dev | Pointer to the display's device structure returned by the initialization function. |
c | ASCII-encoded character to draw. |
void drawCircle | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | r, | ||
int | color | ||
) |
Draws a circle in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the center of the circle, counted from the left side of the screen. |
y0 | Vertical coordinate of the center of the circle, counted down from the top of the screen. |
r | Radius of the circle. |
color | Color of the shape, in the format native to the display. |
void drawCircleHelper | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | r, | ||
char | cornername, | ||
int | color | ||
) |
Helper function used to help draw circles and rectangles with rounded corners.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the center of the arc, counted from the left side of the screen. |
y0 | Vertical coordinate of the center of the arc, counted down from the top of the screen. |
r | Radius of the arc. |
cornername | Which corner (arc) to draw |
color | Color of the shape, in the format native to the display. |
void drawCopy | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | x1, | ||
int | y1 | ||
) |
Copies a rectagle and draws it at another location on the screen.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Horizontal coordinate of the top-left corner of the rectangle to be copied. |
y | Vertical coordinate of the top-left corner of the rectagle to be copied. |
w | Width of the rectagle to be copied. |
h | Height of the rectagle to be copied. |
x1 | Horizontal coordinate of the location to paste the copied rectagle to. |
y1 | Vertical coordinate of the location to paste the copied rectagle to. |
void drawFastHLine | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | color | ||
) |
Draws a horizontal line in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the line, counted from the left side of the screen. |
y | Starting vertical coordinate of the line, counted down from the top of the screen. |
w | Length of the line. |
color | Color of the line, in the format native to the display. |
void drawFastVLine | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | h, | ||
int | color | ||
) |
Draws a vertical line in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the line, counted from the left side of the screen. |
y | Starting vertical coordinate of the line, counted down from the top of the screen. |
h | Length of the line. |
color | Color of the line, in the format native to the display. |
void drawLine | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1, | ||
int | color | ||
) |
Draws a line in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Starting horizontal coordinate of the line, counted from the left side of the screen. |
y0 | Starting vertical coordinate of the line, counted down from the top of the screen. |
x1 | Ending horizontal coordinate of the line. |
y1 | Ending vertical coordinate of the line. |
color | Color of the shape, in the format native to the display. |
void drawNumber | ( | screen_t * | dev, |
float | d, | ||
int | r | ||
) |
Prints a number to the screen starting at the cursor position. Output is limited to 64 bytes.
dev | Pointer to the display's device structure returned by the initialization function. |
d | Number to be printed to the screen. The number can be either a floating point decimal or an integer. |
r | The number base to display the number in (for integers); HEX, BIN, OCT, and DEC are acceptable values. or the number of decimals to display following the decimal point (for floating point numbers). Negative numbers in bases other than DEC will display "Err". |
void drawPixel | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | color | ||
) |
Draws a single pixel in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Horizontal coordinate of the pixel, counted from the left side of the screen. |
y | Vertical coordinate of the pixel, counted down from the top of the screen. |
color | Color of the pixel, in the format native to the display. |
int drawPrint | ( | screen_t * | dev, |
const char * | fmt, | ||
... | |||
) |
Print format "..." args to the screen. The output is limited to 128 bytes.
dev | Pointer to the display's device structure returned by the initialization function. |
fmt | Formatted string to be printed to the display. |
void drawRect | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | color | ||
) |
Draws a rectangle in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the rectangle, counted from the left side of the screen. |
y | Starting vertical coordinate of the rectangle, counted down from the top of the screen. |
w | Width of the rectangle. |
h | Height of the rectangle. |
color | Color of the shape, in the format native to the display. |
void drawRoundRect | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | r, | ||
int | color | ||
) |
Draws a rectangle with rounded corners in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the rectangle, counted from the left side of the screen. |
y | Starting vertical coordinate of the rectangle, counted down from the top of the screen. |
w | Width of the rectangle. |
h | Height of the rectangle. |
r | Radius of the rounded corners. |
color | Color of the shape, in the format native to the display. |
void drawText | ( | screen_t * | dev, |
char * | myString | ||
) |
Prints a string of text to the screen starting at the cursor position. Output is limited to 64 bytes.
dev | Pointer to the display's device structure returned by the initialization function. |
*myString | Text to display on the screen. |
void drawTriangle | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | color | ||
) |
Draws a triangle with in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the first vertex (corner) of the triangle, counted from the left side of the screen. |
y0 | Vertical coordinate of the first vertex (corner) of the triangle, counted down from the top of the screen. |
x1 | Horizontal coordinate of the second vertex of the triangle. |
y1 | Vertical coordinate of the first vertex of the triangle. |
x2 | Horizontal coordinate of the third vertex of the triangle. |
y2 | Vertical coordinate of the third vertex of the triangle. |
color | Color of the shape, in the format native to the display. |
void fillCircle | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | r, | ||
int | color | ||
) |
Draws a filled circle in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the center of the circle, counted from the left side of the screen. |
y0 | Vertical coordinate of the center of the circle, counted down from the top of the screen. |
r | Radius of the circle. |
color | Color of the shape, in the format native to the display. |
void fillCircleHelper | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | r, | ||
char | cornername, | ||
int | delta, | ||
int | color | ||
) |
Helper function used to draw filled circles and rectangles with rounded corners.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the center of the arc, counted from the left side of the screen. |
y0 | Vertical coordinate of the center of the arc, counted down from the top of the screen. |
r | Radius of the arc. |
cornername | Which corner (arc) to draw |
delta | Offest from the center line (space between quarter circles) used for drawing rounded rectagles |
color | Color of the shape, in the format native to the display. |
void fillRect | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | color | ||
) |
Draws a filled rectangle in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the rectangle, counted from the left side of the screen. |
y | Starting vertical coordinate of the rectangle, counted down from the top of the screen. |
w | Width of the rectangle. |
h | Height of the rectangle. |
color | Color of the shape, in the format native to the display. |
void fillRoundRect | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
int | w, | ||
int | h, | ||
int | r, | ||
int | color | ||
) |
Draws a filled rectangle with rounded corners in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Starting horizontal coordinate of the rectangle, counted from the left side of the screen. |
y | Starting vertical coordinate of the rectangle, counted down from the top of the screen. |
w | Width of the rectangle. |
h | Height of the rectangle. |
r | Radius of the rounded corners. |
color | Color of the shape, in the format native to the display. |
void fillTriangle | ( | screen_t * | dev, |
int | x0, | ||
int | y0, | ||
int | x1, | ||
int | y1, | ||
int | x2, | ||
int | y2, | ||
int | color | ||
) |
Draws a filled triangle with in the specified color.
dev | Pointer to the display's device structure returned by the initialization function. |
x0 | Horizontal coordinate of the first vertex (corner) of the triangle, counted from the left side of the screen. |
y0 | Vertical coordinate of the first vertex (corner) of the triangle, counted down from the top of the screen. |
x1 | Horizontal coordinate of the second vertex of the triangle. |
y1 | Vertical coordinate of the first vertex of the triangle. |
x2 | Horizontal coordinate of the third vertex of the triangle. |
y2 | Vertical coordinate of the third vertex of the triangle. |
color | Color of the shape, in the format native to the display. |
int getCursorX | ( | screen_t * | dev | ) |
Returns the current horizontal position of the cursor, measured from the left side of the screen in pixels.
dev | Pointer to the display's device structure returned by the initialization function. |
int getCursorY | ( | screen_t * | dev | ) |
Returns the current vertical position of the cursor, measured from the top of the screen in pixels.
dev | Pointer to the display's device structure returned by the initialization function. |
int getDisplayHeight | ( | screen_t * | dev | ) |
Returns the height of the display in pixels with screen rotation taken into account.
dev | Pointer to the display's device structure returned by the initialization function. |
char getDisplayRotation | ( | screen_t * | dev | ) |
Returns the screen's orientation.
dev | Pointer to the display's device structure returned by the initialization function. |
int getDisplayWidth | ( | screen_t * | dev | ) |
Returns the width of the display in pixels with screen rotation taken into account.
dev | Pointer to the display's device structure returned by the initialization function. |
unsigned char getScrollHorizontal | ( | screen_t * | dev | ) |
Returns a value representing the status or speed of the display's horizontal scroll.
dev | Pointer to the display's device structure returned by the initialization function. |
unsigned char getScrollVertical | ( | screen_t * | dev | ) |
Returns a value representing the status or speed of the display's vertical scroll.
dev | Pointer to the display's device structure returned by the initialization function. |
void invertDisplay | ( | screen_t * | dev, |
char | i | ||
) |
Toggles the invert/normal display modes for the display. Depending on the display type it may only invert existing drawings, or it may invert both existing and colors drawn when inversion is set.
dev | Pointer to the display's device structure returned by the initialization function. |
i | Set to 0 for normal and 1 for inverted. |
char isAsleep | ( | screen_t * | dev | ) |
Returns whether the screen is currently in a sleep mode or awake.
dev | Pointer to the display's device structure returned by the initialization function. |
char isInverted | ( | screen_t * | dev | ) |
Returns the status of the screen's colors - normal or inverted.
dev | Pointer to the display's device structure returned by the initialization function. |
void loadFonts | ( | screen_t * | dev, |
i2c * | eeBus | ||
) |
Internal function used to load the EEPROM addresses of the bitmapped fonts to the device's structure. This function is called by the init function in the display's library. It can be called at any time to point to fonts stored in an EEPROM attached to a different i2c bus.
dev | Pointer to the display's device structure returned by the initialization function. |
eeBus | Pointer to the i2c bus where the EEPROM containing the font bitmaps is connected. |
void resetDisplay | ( | screen_t * | dev | ) |
Resets the display.
dev | Pointer to the display's device structure returned by the initialization function. |
void scrollDisplay | ( | screen_t * | dev, |
int | h, | ||
int | v | ||
) |
Set the display's vertical or hrizontal scrolling functions.
Not supported by all displays, and different display types behave differently.
dev | Pointer to the display's device structure returned by the initialization function. |
h | Sets the horizontal display velocity, or for displays with only on/off modes, any non-zero value will trigger a horizontal scroll. Enter zero to stop horizontal scrolling. |
v | Sets the vertical display velocity, or for displays with only on/off modes, any non-zero value will trigger a vertical scroll. Enter zero to stop vertical scrolling. |
void setBgColor | ( | screen_t * | dev, |
int | color | ||
) |
Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent.
dev | Pointer to the display's device structure returned by the initialization function. |
color | Color of the font, in the format native to the display. |
void setCursor | ( | screen_t * | dev, |
int | x, | ||
int | y, | ||
char | size | ||
) |
Sets the cursor position based on the size parameter.
dev | Pointer to the display's device structure returned by the initialization function. |
x | Horizontal position of the cursor, counted from the left side of the screen. |
y | Vertical position of the cursor, counted down from the top of the screen. |
size | The size of the cursor. Correlated to font size: (0) moves the cursor in 1 pixel increments, (1) moves the cursor in font size 1 character increments, (2) moves the cursor in font size 2 increments and (3) moves the cursor in font size 3 increments |
void setDisplayRotation | ( | screen_t * | dev, |
char | r | ||
) |
Sets the screen's orientation.
dev | Pointer to the display's device structure returned by the initialization function. |
r | Number representing the orientation to set the display to. (0) means pixels are drawn to the screen is at it's native orientation, (1) means pixels are drawn rotated 90 degrees clockwise, (2) means pixels are drawn upside-down - 180 degrees rotated, and (3) means pixels are drawn rotated 270 degrees clockwise. |
void setTextColor | ( | screen_t * | dev, |
int | color | ||
) |
Sets the color of the font and the color of the background (highlighting) to be used. Setting the text color and text background to the same color will make the background color transparent.
dev | Pointer to the display's device structure returned by the initialization function. |
color | Color of the font, in the format native to the display. |
void setTextFont | ( | screen_t * | dev, |
char | f | ||
) |
Sets the font face to be used. Range is from 0 to 3.
dev | Pointer to the display's device structure returned by the initialization function. |
f | Font face to use. Font face (0) is a sans-serif (console) font, face (1) is serif (typewriter) font, face (2) is a script (handwriting) font and face (3) is a bubble (outline/cartoon) font. |
void setTextSize | ( | screen_t * | dev, |
char | s | ||
) |
Sets the size of the font to be used. Range is from 1 to 3. Size (1) is 5x7 (6x8 spacing) pixels, size (2) is 11x15 (12x16 spacing) pixels and size (3) is 15x23 (16x24 spacing) pixels.
dev | Pointer to the display's device structure returned by the initialization function. |
s | Size of text to draw. 1 = small (5x7) font, 2 = medium (11x15) font, 3 = large (17x23) font. |
void setTextWrap | ( | screen_t * | dev, |
char | w | ||
) |
Toggles automatic wrapping of text printed to the screen.
dev | Pointer to the display's device structure returned by the initialization function. |
w | Wrapping (0) off -OR- (1) on. |
void sleepWakeDisplay | ( | screen_t * | dev, |
char | i | ||
) |
Toggle the display's sleep/wake mode. Not supported by all displays.
dev | Pointer to the display's device structure returned by the initialization function. |
i | Set to 0 for awake and 1 for asleep. |
void updateDisplay | ( | screen_t * | dev | ) |
Updates the display by writing the image buffer to it. Not necessary for screens that have their own image buffers.
dev | Pointer to the display's device structure returned by the initialization function. |