Display Simple Graphics library  v0.5
Library containing shape, text, and bitmap drawing functions called by various display drivers
Functions
displayControl.c File Reference
#include "simplegfx.h"

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 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 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 getScrollHorizontal (screen_t *dev)
 Returns a value representing the status or speed of the display's horizontal scroll. More...
 
unsigned char getScrollVertical (screen_t *dev)
 Returns a value representing the status or speed of the display's vertical scroll. More...
 

Function Documentation

◆ clearDisplay()

void clearDisplay ( screen_t dev)

Clears (sets to the native background color of the screen, usually black) the entire screen.

Parameters
devPointer to the display's device structure returned by the initialization function.

◆ getDisplayHeight()

int getDisplayHeight ( screen_t dev)

Returns the height of the display in pixels with screen rotation taken into account.

Parameters
devPointer to the display's device structure returned by the initialization function.

◆ getDisplayRotation()

char getDisplayRotation ( screen_t dev)

Returns the screen's orientation.

Parameters
devPointer to the display's device structure returned by the initialization function.
Returns
A number representing the screen's orientation. (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.

◆ getDisplayWidth()

int getDisplayWidth ( screen_t dev)

Returns the width of the display in pixels with screen rotation taken into account.

Parameters
devPointer to the display's device structure returned by the initialization function.

◆ getScrollHorizontal()

unsigned char getScrollHorizontal ( screen_t dev)

Returns a value representing the status or speed of the display's horizontal scroll.

Parameters
devPointer to the display's device structure returned by the initialization function.
Returns
A value representing the horizontal scrolling velocity (or 1 if the screen only supports a single scrolling speed).

◆ getScrollVertical()

unsigned char getScrollVertical ( screen_t dev)

Returns a value representing the status or speed of the display's vertical scroll.

Parameters
devPointer to the display's device structure returned by the initialization function.
Returns
A value representing the vertical scrolling velocity (or 1 if the screen only supports a single scrolling speed).

◆ invertDisplay()

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.

Parameters
devPointer to the display's device structure returned by the initialization function.
iSet to 0 for normal and 1 for inverted.

◆ isAsleep()

char isAsleep ( screen_t dev)

Returns whether the screen is currently in a sleep mode or awake.

Parameters
devPointer to the display's device structure returned by the initialization function.
Returns
A value of 1 if the screenis asleep, and 0 if the screen is awake

◆ isInverted()

char isInverted ( screen_t dev)

Returns the status of the screen's colors - normal or inverted.

Parameters
devPointer to the display's device structure returned by the initialization function.
Returns
A value of 1 if the screen's colors are inverted, and 0 if the screen's colors are normal (not-inverted).

◆ resetDisplay()

void resetDisplay ( screen_t dev)

Resets the display.

Parameters
devPointer to the display's device structure returned by the initialization function.

◆ scrollDisplay()

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.

Parameters
devPointer to the display's device structure returned by the initialization function.
hSets 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.
vSets 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.

◆ setDisplayRotation()

void setDisplayRotation ( screen_t dev,
char  r 
)

Sets the screen's orientation.

Parameters
devPointer to the display's device structure returned by the initialization function.
rNumber 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.

◆ sleepWakeDisplay()

void sleepWakeDisplay ( screen_t dev,
char  i 
)

Toggle the display's sleep/wake mode. Not supported by all displays.

Parameters
devPointer to the display's device structure returned by the initialization function.
iSet to 0 for awake and 1 for asleep.

◆ updateDisplay()

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.

Parameters
devPointer to the display's device structure returned by the initialization function.