SG12864A

Dependents:   SG12864A_TestProgram

Embed: (wiki syntax)

« Back to documentation index

SG12864A Class Reference

SG12864A Class Reference

SG12864A Graphics LCD module driver class. More...

#include <SG12864A.h>

Public Types

enum  Target
 

Target of a chip.

More...

Public Member Functions

 SG12864A (PinName di, PinName rw, PinName en, PinName db0, PinName db1, PinName db2, PinName db3, PinName db4, PinName db5, PinName db6, PinName db7, PinName cs1, PinName cs2, PinName res)
 Create.
 ~SG12864A ()
 Destroy.
void bufferPush (void)
 Push images from a internal buffer.
void bufferPull (void)
 Pull images to a internal buffer.
void bufferClear (bool reverse=false)
 Clear a internal buffer images.
void bufferDrawLine (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool reverse=false)
 Draw a line to a internal buffer.
void bufferDrawBox (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool reverse=false)
 Draw a box to a internal buffer.
void bufferFillBox (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool reverse=false)
 Fill a box to a internal buffer.
void bufferDrawString (uint8_t x, uint8_t y, char *str, bool reverse=false)
 Draw a text string to a internal buffer.
void bufferDrawChar (uint8_t x, uint8_t y, char c, bool reverse=false)
 Draw a character to a internal buffer.
void bufferDrawCheckbox (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, bool state, bool reverse=false)
 Draw a checkbox to a internal buffer.
void bufferDrawProgressbar (uint16_t x1, uint16_t y1, uint16_t x2, uint16_t y2, int min, int max, int value, bool reverse=false)
 Draw a progressbar to a internal buffer.
void reset (void)
 Reset module.
void clear (void)
 Clear display.
void setDisplayOnOff (Target t, bool on)
 Set display ON/OFF.
void setDisplayStartLine (Target t, uint8_t displayStartLine)
 Set display start line.
void setPageAddress (Target t, uint8_t addr)
 Set page address.
void setColumnAddress (Target t, uint8_t addr)
 Set column address.
void readStatus (Target t, uint8_t *c)
 Read status.
void writeData (Target t, uint8_t c)
 Write data.
void readData (Target t, uint8_t *c)
 Read data.

Detailed Description

SG12864A Graphics LCD module driver class.

Definition at line 19 of file SG12864A.h.


Member Enumeration Documentation

enum Target

Target of a chip.

Definition at line 63 of file SG12864A.h.


Constructor & Destructor Documentation

SG12864A ( PinName  di,
PinName  rw,
PinName  en,
PinName  db0,
PinName  db1,
PinName  db2,
PinName  db3,
PinName  db4,
PinName  db5,
PinName  db6,
PinName  db7,
PinName  cs1,
PinName  cs2,
PinName  res 
)

Create.

Parameters:
diD-/I (H:Instruction, L:Data)
rwR/W- (H:Read, L:Write)
enEnable signal
db0Data bus line bit-0.
db1Data bus line bit-1.
db2Data bus line bit-2.
db3Data bus line bit-3.
db4Data bus line bit-4.
db5Data bus line bit-5.
db6Data bus line bit-6.
db7Data bus line bit-7.
cs1Chip select signal for IC1.
cs2Chip select signal for IC2.
resReset signal.

Definition at line 116 of file SG12864A.cpp.

~SG12864A (  )

Destroy.

Definition at line 142 of file SG12864A.cpp.


Member Function Documentation

void bufferClear ( bool  reverse = false )

Clear a internal buffer images.

Parameters:
reverseTrue if images are reversed.

Definition at line 165 of file SG12864A.cpp.

void bufferDrawBox ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
bool  reverse = false 
)

Draw a box to a internal buffer.

Parameters:
x1Starting point at x-axis.
y1Starting point at y-axis.
x2Ending point at x-axis.
y2Ending point at y-axis.
reverseTrue if images are reversed.

Definition at line 220 of file SG12864A.cpp.

void bufferDrawChar ( uint8_t  x,
uint8_t  y,
char  c,
bool  reverse = false 
)

Draw a character to a internal buffer.

The font size is 5x7 dots.

Parameters:
xStarting point at x-axis.
yStarting point at y-axis.
cA character.
reverseTrue if images are reversed.

Definition at line 263 of file SG12864A.cpp.

void bufferDrawCheckbox ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
bool  state,
bool  reverse = false 
)

Draw a checkbox to a internal buffer.

Parameters:
x1Starting point at x-axis.
y1Starting point at y-axis.
x2Ending point at x-axis.
y2Ending point at y-axis.
stateTrue if state is checked.
reverseTrue if images are reversed.

Definition at line 306 of file SG12864A.cpp.

void bufferDrawLine ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
bool  reverse = false 
)

Draw a line to a internal buffer.

Parameters:
x1Starting point at x-axis.
y1Starting point at y-axis.
x2Ending point at x-axis.
y2Ending point at y-axis.
reverseTrue if images are reversed.

Definition at line 175 of file SG12864A.cpp.

void bufferDrawProgressbar ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
int  min,
int  max,
int  value,
bool  reverse = false 
)

Draw a progressbar to a internal buffer.

Parameters:
x1Starting point at x-axis.
y1Starting point at y-axis.
x2Ending point at x-axis.
y2Ending point at y-axis.
minMinimum value on a scale.
maxMaximum value on a scale.
valueCurrent value on a scale.
reverseTrue if images are reversed.

Definition at line 314 of file SG12864A.cpp.

void bufferDrawString ( uint8_t  x,
uint8_t  y,
char *  str,
bool  reverse = false 
)

Draw a text string to a internal buffer.

The font size is 5x7 dots.

Parameters:
xStarting point at x-axis.
yStarting point at y-axis.
strText string. (NULL terminate.)
reverseTrue if images are reversed.

Definition at line 253 of file SG12864A.cpp.

void bufferFillBox ( uint16_t  x1,
uint16_t  y1,
uint16_t  x2,
uint16_t  y2,
bool  reverse = false 
)

Fill a box to a internal buffer.

Parameters:
x1Starting point at x-axis.
y1Starting point at y-axis.
x2Ending point at x-axis.
y2Ending point at y-axis.
reverseTrue if images are reversed.

Definition at line 241 of file SG12864A.cpp.

void bufferPull ( void   )

Pull images to a internal buffer.

Definition at line 162 of file SG12864A.cpp.

void bufferPush ( void   )

Push images from a internal buffer.

Definition at line 145 of file SG12864A.cpp.

void clear ( void   )

Clear display.

High Level Interface.

Clear display module.

Definition at line 351 of file SG12864A.cpp.

void readData ( Target  t,
uint8_t *  c 
)

Read data.

Middle Level Interface.

Parameters:
tTarget.
cStatus.

Definition at line 455 of file SG12864A.cpp.

void readStatus ( Target  t,
uint8_t *  c 
)

Read status.

Middle Level Interface.

Parameters:
tTarget.
cStatus.

Definition at line 437 of file SG12864A.cpp.

void reset ( void   )

Reset module.

High Level Interface.

Reset display module.

Definition at line 330 of file SG12864A.cpp.

void setColumnAddress ( Target  t,
uint8_t  addr 
)

Set column address.

Middle Level Interface.

Parameters:
tTarget.
addrAddress.

Set column address.

Parameters:
tTarget. (CS1, CS2)
addrColumn address (0-63).

Definition at line 427 of file SG12864A.cpp.

void setDisplayOnOff ( Target  t,
bool  on 
)

Set display ON/OFF.

Middle Level Interface.

Parameters:
tTarget.
onTrue if the display is ON.

Set display on/off.

Parameters:
tTarget (CS1, CS2).
onON/OFF (true, false).

Definition at line 382 of file SG12864A.cpp.

void setDisplayStartLine ( Target  t,
uint8_t  addr 
)

Set display start line.

Middle Level Interface.

Parameters:
tTarget.
displayStartLineStart line number.

Set display start line.

Parameters:
tTarget (CS1, CS2).
addrDisplay start line (0-63).

Definition at line 397 of file SG12864A.cpp.

void setPageAddress ( Target  t,
uint8_t  addr 
)

Set page address.

Middle Level Interface.

Parameters:
tTarget.
addrAddress.

Set page address.

Parameters:
tTarget (CS1, CS2).
addrPage address(0-7).

Definition at line 412 of file SG12864A.cpp.

void writeData ( Target  t,
uint8_t  c 
)

Write data.

Middle Level Interface.

Parameters:
tTarget.
cStatus.

Definition at line 446 of file SG12864A.cpp.