Librarie pour ecran 128x32 de MyLab

Dependents:   MyLab_Lib

Embed: (wiki syntax)

« Back to documentation index

C12832 Class Reference

The C12832 class. More...

#include <C12832.h>

Inherits GraphicsDisplay.

Public Member Functions

 C12832 (PinName e, PinName rw, PinName a0, PinName cs, PinName d0, PinName d1, PinName d2, PinName d3, PinName d4, PinName d5, PinName d6, PinName d7, const char *name="LCD")
 Create a C12832 object connected to SPI1.
virtual int width ()
 Get the width of the screen in pixel.
virtual int height ()
 Get the height of the screen in pixel.
virtual void pixel (int x, int y, int colour)
 Draw a pixel at x,y black or white.
void circle (int x, int y, int r, int colour)
 Draw a circle.
void fillcircle (int x, int y, int r, int colour)
 Draw a filled circle.
void line (int x0, int y0, int x1, int y1, int colour)
 Draw a 1 pixel line.
void rect (int x0, int y0, int x1, int y1, int colour)
 Draw a rect.
void fillrect (int x0, int y0, int x1, int y1, int colour)
 Draw a filled rect.
void copy_to_lcd (void)
 Copy display buffer to LCD.
void set_contrast (unsigned int o)
 Set the orienation of the screen.
unsigned int get_contrast (void)
 Read the contrast level.
void invert (unsigned int o)
 Invert the screen.
virtual void cls (void)
 Clear the screen.
void setmode (int mode)
 Set the drawing mode.
virtual int rows (void)
 Calculate the max number of columns.
virtual int _putc (int value)
 Put a char on the screen.
virtual void character (int x, int y, int c)
 Draw a character on given position out of the active font to the LCD.
virtual void locate (int x, int y)
 Setup cursor position.
void set_auto_up (unsigned int up)
 Setup auto update of screen.
unsigned int get_auto_up (void)
 Get status of the auto update function.
void set_font (unsigned char *f)
 Select the font to use.
void print_bm (Bitmap bm, int x, int y)
 Print bitmap to buffer.
virtual bool claim (FILE *stream)
 redirect output from a stream (stoud, sterr) to display

Data Fields

DigitalOut _e
 Vars.

Protected Member Functions

void hline (int x0, int x1, int y, int colour)
 Draw a horizontal line.
void vline (int y0, int y1, int x, int colour)
 Draw a vertical line.
void lcd_reset ()
 Init the C12832 LCD controller.
void wr_dat (unsigned char value)
 Write data to the LCD controller.
void wr_cmd (unsigned char value)
 Write a command the LCD controller.

Detailed Description

The C12832 class.

Definition at line 70 of file C12832.h.


Constructor & Destructor Documentation

C12832 ( PinName  e,
PinName  rw,
PinName  a0,
PinName  cs,
PinName  d0,
PinName  d1,
PinName  d2,
PinName  d3,
PinName  d4,
PinName  d5,
PinName  d6,
PinName  d7,
const char *  name = "LCD" 
)

Create a C12832 object connected to SPI1.

Definition at line 32 of file C12832.cpp.


Member Function Documentation

int _putc ( int  value ) [virtual]

Put a char on the screen.

Parameters:
valuechar to print
Returns:
printed char

Definition at line 268 of file C12832.cpp.

void character ( int  x,
int  y,
int  c 
) [virtual]

Draw a character on given position out of the active font to the LCD.

Parameters:
xx-position of char (top left)
yy-position
cchar to print

Definition at line 283 of file C12832.cpp.

void circle ( int  x,
int  y,
int  r,
int  colour 
)

Draw a circle.

Parameters:
x0,y0center
rradius
color- 1 set pixel, 0 erase pixel
bool claim ( FILE *  stream ) [virtual, inherited]

redirect output from a stream (stoud, sterr) to display

Parameters:
streamstream that shall be redirected to the TextDisplay

Definition at line 65 of file TextDisplay.cpp.

void cls ( void   ) [virtual]

Clear the screen.

Definition at line 232 of file C12832.cpp.

void copy_to_lcd ( void   )

Copy display buffer to LCD.

Definition at line 186 of file C12832.cpp.

void fillcircle ( int  x,
int  y,
int  r,
int  colour 
)

Draw a filled circle.

Parameters:
x0,y0center
rradius
color- 1 set pixel, 0 erase pixel

Use circle with different radius, Can miss some pixels

void fillrect ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

Draw a filled rect.

Parameters:
x0,y0top left corner
x1,y1down right corner
color- 1 set pixel, 0 erase pixel
unsigned int get_auto_up ( void   )

Get status of the auto update function.

Returns:
if auto update is on

Definition at line 336 of file C12832.cpp.

unsigned int get_contrast ( void   )

Read the contrast level.

Definition at line 126 of file C12832.cpp.

int height (  ) [virtual]

Get the height of the screen in pixel.

Returns:
height of screen in pixel

Definition at line 106 of file C12832.cpp.

void hline ( int  x0,
int  x1,
int  y,
int  colour 
) [protected]

Draw a horizontal line.

Parameters:
x0horizontal start
x1horizontal stop
yvertical position
color- 1 set pixel, 0 erase pixel
void invert ( unsigned int  o )

Invert the screen.

Parameters:
o= 0 normal, 1 invert

Definition at line 112 of file C12832.cpp.

void lcd_reset (  ) [protected]

Init the C12832 LCD controller.

void line ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

Draw a 1 pixel line.

Parameters:
x0,y0start point
x1,y1stop point
color- 1 set pixel, 0 erase pixel
void locate ( int  x,
int  y 
) [virtual]

Setup cursor position.

Parameters:
xx-position (top left)
yy-position

Definition at line 246 of file C12832.cpp.

void pixel ( int  x,
int  y,
int  colour 
) [virtual]

Draw a pixel at x,y black or white.

Parameters:
xhorizontal position
yvertical position
color- 1 set pixel, 0 erase pixel

Definition at line 168 of file C12832.cpp.

void print_bm ( Bitmap  bm,
int  x,
int  y 
)

Print bitmap to buffer.

Parameters:
bmBitmap in flash
xx start
yy start

Definition at line 341 of file C12832.cpp.

void rect ( int  x0,
int  y0,
int  x1,
int  y1,
int  colour 
)

Draw a rect.

Parameters:
x0,y0top left corner
x1,y1down right corner
color- 1 set pixel, 0 erase pixel
int rows ( void   ) [virtual]

Calculate the max number of columns.

Depends on actual font size

Returns:
max column

Definition at line 261 of file C12832.cpp.

void set_auto_up ( unsigned int  up )

Setup auto update of screen.

Parameters:
up1 = on , 0 = off

if switched off the program has to call copy_to_lcd() to update screen from framebuffer

Definition at line 330 of file C12832.cpp.

void set_contrast ( unsigned int  o )

Set the orienation of the screen.

Definition at line 119 of file C12832.cpp.

void set_font ( unsigned char *  f )

Select the font to use.

Parameters:
fpointer to font array

font array can created with GLCD Font Creator from http://www.mikroe.com you have to add 4 parameter at the beginning of the font array to use:

  • the number of byte / char
  • the vertial size in pixel
  • the horizontal size in pixel
  • the number of byte per vertical line you also have to change the array to char[]

Definition at line 325 of file C12832.cpp.

void setmode ( int  mode )

Set the drawing mode.

Parameters:
modeNORMAl or XOR

Definition at line 241 of file C12832.cpp.

void vline ( int  y0,
int  y1,
int  x,
int  colour 
) [protected]

Draw a vertical line.

Parameters:
xhorizontal position
y0vertical start
y1vertical stop
color- 1 set pixel, 0 erase pixel
int width (  ) [virtual]

Get the width of the screen in pixel.

Returns:
width of screen in pixel

Definition at line 101 of file C12832.cpp.

void wr_cmd ( unsigned char  value ) [protected]

Write a command the LCD controller.

Parameters:
cmd,:command to be written

Definition at line 134 of file C12832.cpp.

void wr_dat ( unsigned char  value ) [protected]

Write data to the LCD controller.

Parameters:
datdata written to LCD controller

Definition at line 151 of file C12832.cpp.


Field Documentation

DigitalOut _e

Vars.

Definition at line 238 of file C12832.h.