Library for the EADOG LCD displays from electronic assembly.
More...
#include <EADOG.h>
Public Member Functions |
| | EADOG (PinName mosi, PinName sck, PinName reset, PinName a0, PinName cs, uint8_t type) |
| | create a EADOG object connected to SPI
|
| void | pixel (int x, int y, uint8_t colour) |
| | draw a pixel in buffer at x, y black or white
|
| void | point (int x, int y, uint8_t colour) |
| | draw a single point
|
| void | line (int x0, int y0, int x1, int y1, uint8_t colour) |
| | draw a 1 pixel line
|
| void | rectangle (int x0, int y0, int x1, int y1, uint8_t colour) |
| | draw a rect
|
| void | fillrect (int x0, int y0, int x1, int y1, uint8_t colour) |
| | draw a filled rect
|
| void | roundrect (int x0, int y0, int x1, int y1, int rnd, uint8_t colour) |
| | draw a rounded rect
|
| void | fillrrect (int x0, int y0, int x1, int y1, int rnd, uint8_t colour) |
| | draw a filled rounded rect
|
| void | circle (int x, int y, int r, uint8_t colour) |
| | draw a circle
|
| void | fillcircle (int x, int y, int r, uint8_t colour) |
| | draw a filled circle
|
| void | update () |
| | update copy display buffer to lcd
|
| void | display (uint8_t display) |
| | display functions
|
| void | display (uint8_t display, uint8_t value) |
| | display functions
|
| void | cls () |
| | clear the screen
|
| void | character (uint8_t x, uint8_t y, uint8_t c) |
| | draw a character on given position out of the active font to the LCD
|
| void | locate (uint8_t x, uint8_t y) |
| | set top left position of char/printf
|
| void | font (uint8_t *f) |
| | select the font to use
|
| void | bitmap (Bitmap bm, int x, int y) |
| | print bitmap to buffer
|
Protected Member Functions |
| virtual int | _putc (int value) |
| | stream class, put a char on the screen
|
| virtual int | _getc () |
| | stream class, dummy
|
| void | init () |
| | init the DOGM132 LCD controller
|
| void | write_data (uint8_t data) |
| | write data to the LCD controller
|
| void | write_command (uint8_t command) |
| | Write a command the LCD controller.
|
Detailed Description
Library for the EADOG LCD displays from electronic assembly.
Example for EA DOGM132x-5 with STM32F401RE Nucleo
#include "mbed.h"
#include "EADOG.h"
#include "Small_7.h"
#include "Fonts/ArialR12x14.h"
EADOG lcd(PA_7, PA_5, PC_7, PA_9, PB_6, DOGM132);
int main() {
lcd.update(MANUAL);
lcd.rectangle(0, 0, 131, 31, 1);
lcd.fillrect(2, 2, 4, 4, 1);
lcd.fillrect(2, 27, 4, 29, 1);
lcd.fillrect(61, 2, 63, 4, 1);
lcd.fillrect(61, 27, 63, 29, 1);
lcd.line(65, 0, 65, 31, 1);
lcd.circle(33, 15, 10, 1);
lcd.circle(33, 15, 6, 1);
lcd.fillcircle(33, 15, 3, 1);
lcd.update();
lcd.update(AUTO);
lcd.locate(70, 1);
lcd.font((unsigned char*)ArialR12x14);
lcd.printf("mbed");
lcd.locate(70, 13);
lcd.font((unsigned char*)Small_7);
lcd.printf("EA");
lcd.locate(70, 22);
lcd.printf("DOGM132x-5");
wait(1);
lcd.display(CONTRAST, 16);
wait(1);
lcd.display(CONTRAST, 40);
wait(1);
lcd.display(CONTRAST);
wait(1);
lcd.display(OFF);
wait(1);
lcd.display(ON);
wait(1);
lcd.display(SLEEP);
wait(1);
lcd.display(ON);
while(1) {
lcd.display(INVERT);
lcd.display(BOTTOM);
wait(2);
lcd.display(DEFAULT);
lcd.display(TOPVIEW);
wait(2);
}
}
Definition at line 150 of file EADOG.h.
Constructor & Destructor Documentation
| EADOG |
( |
PinName |
mosi, |
|
|
PinName |
sck, |
|
|
PinName |
reset, |
|
|
PinName |
a0, |
|
|
PinName |
cs, |
|
|
uint8_t |
type |
|
) |
| |
create a EADOG object connected to SPI
- Parameters:
-
| mosi | pinname |
| sck | pinname |
| reset | pinname |
| a0 | pinname |
| cs | pinname |
Definition at line 20 of file EADOG.cpp.
Member Function Documentation
| int _getc |
( |
) |
[protected, virtual] |
stream class, dummy
Definition at line 406 of file EADOG.cpp.
| int _putc |
( |
int |
value ) |
[protected, virtual] |
stream class, put a char on the screen
- Parameters:
-
- Returns:
- printed char
Definition at line 391 of file EADOG.cpp.
| void bitmap |
( |
Bitmap |
bm, |
|
|
int |
x, |
|
|
int |
y |
|
) |
| |
print bitmap to buffer
- Parameters:
-
| bm | Bitmap in flash |
| x | x start |
| y | y start |
Definition at line 454 of file EADOG.cpp.
| void character |
( |
uint8_t |
x, |
|
|
uint8_t |
y, |
|
|
uint8_t |
c |
|
) |
| |
draw a character on given position out of the active font to the LCD
- Parameters:
-
| x | x-position of char (top left) |
| y | y-position |
| c | char to print |
Definition at line 410 of file EADOG.cpp.
| void circle |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
r, |
|
|
uint8_t |
colour |
|
) |
| |
draw a circle
- Parameters:
-
| x0,y0 | center |
| r | radius |
| colour | 1 set pixel, 0 erase pixel |
Definition at line 356 of file EADOG.cpp.
| void display |
( |
uint8_t |
display, |
|
|
uint8_t |
value |
|
) |
| |
display functions
- Parameters:
-
| display | CONTRAST set display contrast with value, |
| value | sets display contrast 0 - 63, default 31 |
Definition at line 88 of file EADOG.cpp.
| void display |
( |
uint8_t |
display ) |
|
display functions
- Parameters:
-
| display | ON switch display on, or wake up from sleep |
| display | OFF set display off |
| display | SLEEP set display off and to sleep mode |
| display | BOTTOM (default) set display orientation 0° |
| display | TOPVIEW draw display oriention to 180° |
| display | INVERT invert the pixels |
| display | DEFAULT normal pixel display |
| display | CONTRAST set display contrast to default |
Definition at line 43 of file EADOG.cpp.
| void fillcircle |
( |
int |
x, |
|
|
int |
y, |
|
|
int |
r, |
|
|
uint8_t |
colour |
|
) |
| |
draw a filled circle
- Parameters:
-
| x0,y0 | center |
| r | radius |
| color | 1 set pixel, 0 erase pixel |
use circle with different radius, can miss some pixel
Definition at line 370 of file EADOG.cpp.
| void fillrect |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
uint8_t |
colour |
|
) |
| |
draw a filled rect
- Parameters:
-
| x0,y0 | top left corner |
| x1,y1 | down right corner |
| color | 1 set pixel, 0 erase pixel |
Definition at line 298 of file EADOG.cpp.
| void fillrrect |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
int |
rnd, |
|
|
uint8_t |
colour |
|
) |
| |
draw a filled rounded rect
- Parameters:
-
| x0,y0 | top left corner |
| x1,y1 | down right corner |
| rnd | radius of the rounding |
| color | 1 set pixel, 0 erase pixel |
Definition at line 333 of file EADOG.cpp.
| void font |
( |
uint8_t * |
f ) |
|
select the font to use
- Parameters:
-
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[]
lcd.font((unsigned char*)Small_7);
Definition at line 450 of file EADOG.cpp.
| void init |
( |
) |
[protected] |
init the DOGM132 LCD controller
Definition at line 114 of file EADOG.cpp.
| void line |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
uint8_t |
colour |
|
) |
| |
draw a 1 pixel line
- Parameters:
-
| x0,y0 | start point |
| x1,y1 | end point |
| color | 1 set pixel, 0 erase pixel |
Definition at line 272 of file EADOG.cpp.
| void locate |
( |
uint8_t |
x, |
|
|
uint8_t |
y |
|
) |
| |
set top left position of char/printf
- Parameters:
-
Definition at line 386 of file EADOG.cpp.
| void pixel |
( |
int |
x, |
|
|
int |
y, |
|
|
uint8_t |
colour |
|
) |
| |
draw a pixel in buffer at x, y black or white
- Parameters:
-
| x | horizontal position |
| y | vertical position |
| colour | 1 set pixel, 0 erase pixel there is no update, it writes the pixel only in the buffer |
Definition at line 260 of file EADOG.cpp.
| void point |
( |
int |
x, |
|
|
int |
y, |
|
|
uint8_t |
colour |
|
) |
| |
draw a single point
- Parameters:
-
| x | horizontal position |
| y | vertical position |
| colour | 1 set pixel, 0 erase pixel |
Definition at line 266 of file EADOG.cpp.
| void rectangle |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
uint8_t |
colour |
|
) |
| |
draw a rect
- Parameters:
-
| x0,y0 | top left corner |
| x1,y1 | down right corner |
| color | 1 set pixel, 0 erase pixel |
Definition at line 287 of file EADOG.cpp.
| void roundrect |
( |
int |
x0, |
|
|
int |
y0, |
|
|
int |
x1, |
|
|
int |
y1, |
|
|
int |
rnd, |
|
|
uint8_t |
colour |
|
) |
| |
draw a rounded rect
- Parameters:
-
| x0,y0 | top left corner |
| x1,y1 | down right corner |
| rnd | radius of the rounding |
| color | 1 set pixel, 0 erase pixel |
Definition at line 309 of file EADOG.cpp.
update copy display buffer to lcd
- Parameters:
-
| AUTO | set update mode to auto, default |
| MANUELL | the update function must manually set update() copy display buffer to lcd |
Definition at line 162 of file EADOG.cpp.
| void write_command |
( |
uint8_t |
command ) |
[protected] |
Write a command the LCD controller.
- Parameters:
-
Definition at line 98 of file EADOG.cpp.
| void write_data |
( |
uint8_t |
data ) |
[protected] |
write data to the LCD controller
- Parameters:
-
| dat | data written to LCD controller |
Definition at line 106 of file EADOG.cpp.