Arduino GLCD Library: glcd_Device Class Reference

# glcd_Device Class Reference

Low level device functions. More...

Inheritance diagram for glcd_Device:

List of all members.

## Protected Member Functions

void | GotoXY (uint8_t x, uint8_t y)
void | Init (uint8_t invert=false)
uint8_t | ReadData (void)
void | SetDot (uint8_t x, uint8_t y, uint8_t color)
void | SetPixels (uint8_t x, uint8_t y, uint8_t x1, uint8_t y1, uint8_t color)
void | WriteData (uint8_t data)

## Static Protected Attributes

static lcdCoord | Coord
static uint8_t | Inverted

## Detailed Description

Low level device functions.

## Member Function Documentation

void GotoXY | ( | uint8_t | x,
|  | uint8_t | y |
| ) |  |  | `[protected]`

set current x,y coordinate on display device

Parameters:

  | x | X coordinate
  | y | Y coordinate

Sets the current pixel location to x,y. x and y are relative to the 0,0 origin of the display which is the upper left most pixel on the display.

Reimplemented in glcd.

void Init | ( | uint8_t | invert = `false` | ) | `[protected]`

Low level h/w initialization of display and AVR pins

Parameters:

  | invert | specifices whether display is in normal mode or inverted mode.

This should only be called by other library code.

It does all the low level hardware initalization of the display device.

The optional invert parameter specifies if the display should be run in a normal mode, dark pixels on light background or inverted, light pixels on a dark background.

To specify dark pixels use the define NON-INVERTED and to use light pixels use the define INVERTED

Upon completion of the initialization, the entire display will be cleared and the x,y postion will be set to 0,0

Reimplemented in glcd.

uint8_t ReadData | ( | void |  | ) | `[inline, protected]`

read a data byte from display device memory

Returns:
  the data byte at the current x,y position

Note:
  the current x,y location is not modified by the routine. This allows a read/modify/write operation. Code can call ReadData() modify the data then call WriteData() and update the same location.

See also:
  WriteData()

Reimplemented in glcd.

void SetDot | ( | uint8_t | x,
|  | uint8_t | y,
|  | uint8_t | color |
| ) |  |  | `[protected]`

set pixel at x,y to the given color

Parameters:

  | x | X coordinate, a value from 0 to GLCD.Width-1
  | y | Y coordinate, a value from 0 to GLCD.Heigh-1
  | color | WHITE or BLACK

Sets the pixel at location x,y to the specified color. x and y are relative to the 0,0 origin of the display which is the upper left corner. Requests to set pixels outside the range of the display will be ignored.

Note:
  If the display has been set to INVERTED mode then the colors will be automically reversed.

Reimplemented in glcd.

void SetPixels | ( | uint8_t | x,
|  | uint8_t | y,
|  | uint8_t | x2,
|  | uint8_t | y2,
|  | uint8_t | color |
| ) |  |  | `[protected]`

set an area of pixels

Parameters:

  | x | X coordinate of upper left corner
  | y | Y coordinate of upper left corner
  | x2 | X coordinate of lower right corner
  | y2 | Y coordinate of lower right corner
  | color | sets the pixels an area bounded by x,y to x2,y2 inclusive to the specified color.

The width of the area is x2-x + 1. The height of the area is y2-y+1

Reimplemented in glcd.

void WriteData | ( | uint8_t | data | ) | `[protected]`

Write a byte to display device memory

Parameters:

  | data | date byte to write to memory

The data specified is written to glcd memory at the current x,y position. If the y location is not on a byte boundary, the write is fragemented up into multiple writes.

Note:
  the full behavior of this during split byte writes currently varies depending on a compile time define. The code can be configured to either OR in 1 data bits or set all the data bits. TRUE_WRITE controls this behavior.
  the x,y address will not be the same as it was prior to this call. The y address will remain the aame but the x address will advance by one. This allows back to writes to write sequentially through memory without having to do additional x,y positioning.

See also:
  ReadData()

Reimplemented in glcd.

The documentation for this class was generated from the following files:

- glcd_Device.h
- glcd_Device.cpp