ST / EPD_GDE021A1

Dependents:   DISCO-L053C8_ePD_demo DISCO-L053C8_ePD_demo Ruche_V1 DISCO-L053C8_ePD_demo ... more

Embed: (wiki syntax)

« Back to documentation index

EPD_GDE021A1 Class Reference

EPD_GDE021A1 Class Reference

ePaperDisplay on SPI More...

#include <EPD_GDE021A1.h>

Public Member Functions

 EPD_GDE021A1 (PinName cs, PinName dc, PinName rst, PinName bsy, PinName pwr, PinName spi_mosi, PinName spi_miso, PinName spi_scl)
 Constructor.
 ~EPD_GDE021A1 ()
 Destructor.
uint32_t GetXSize (void)
 Gets the EPD X size.
uint32_t GetYSize (void)
 Gets the EPD Y size.
void SetFont (sFONT *pFonts)
 Sets the Text Font.
sFONT * GetFont (void)
 Gets the Text Font.
void Clear (uint16_t Color)
 Clears the EPD.
void DisplayChar (uint16_t Xpos, uint16_t Ypos, uint8_t Ascii)
 Displays one character.
void DisplayStringAt (uint16_t Xpos, uint16_t Ypos, uint8_t *Text, Text_AlignModeTypdef Mode)
 Displays characters on the EPD.
void DisplayStringAtLine (uint16_t Line, uint8_t *ptr, Text_AlignModeTypdef Mode)
 Displays a character on the EPD.
void DrawHLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
 Draws an horizontal line.
void DrawVLine (uint16_t Xpos, uint16_t Ypos, uint16_t Length)
 Draws a vertical line.
void DrawRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
 Draws a rectangle.
void FillRect (uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Height)
 Displays a full rectangle.
void DrawImage (uint16_t Xpos, uint16_t Ypos, uint16_t Xsize, uint16_t Ysize, uint8_t *pdata)
 Draws an Image.
void CloseChargePump (void)
 Disables the clock and the charge pump.
void RefreshDisplay (void)
 Updates the display from the data located into the RAM.

Detailed Description

ePaperDisplay on SPI

Example:

 #include "mbed.h"
 #include "EPD_GDE021A1.h"

 #define EPD_CS       PA_15
 #define EPD_DC       PB_11
 #define EPD_RESET    PB_2
 #define EPD_BUSY     PA_8
 #define EPD_POWER    PB_10
 #define EPD_SPI_MOSI PB_5
 #define EPD_SPI_MISO PB_4
 #define EPD_SPI_SCK  PB_3
 
 EPD_GDE021A1 epd(EPD_CS, EPD_DC, EPD_RESET, EPD_BUSY, EPD_POWER, EPD_SPI_MOSI, EPD_SPI_MISO, EPD_SPI_SCK);
 
 int main()
 {
   epd.Clear(EPD_COLOR_WHITE);  
   epd.DisplayStringAtLine(5, (uint8_t*)"MBED", CENTER_MODE);
   epd.DisplayStringAtLine(3, (uint8_t*)"Epaper display", LEFT_MODE);
   epd.DisplayStringAtLine(2, (uint8_t*)"demo", LEFT_MODE);
   epd.RefreshDisplay();
   wait(2);
  
   while(1) {
     led1 = !led1;
     wait(1);
   }
 }

Definition at line 78 of file EPD_GDE021A1.h.


Constructor & Destructor Documentation

EPD_GDE021A1 ( PinName  cs,
PinName  dc,
PinName  rst,
PinName  bsy,
PinName  pwr,
PinName  spi_mosi,
PinName  spi_miso,
PinName  spi_scl 
)

Constructor.

Parameters:
csEPD CS pin
dcEPD DC pin
rstEPD RESET pin
bsyEPD BUSY pin
pwrEPD POWER pin
mosiSPI MOSI pin
misoSPI MISO pin
sclSPI SCLK pin

Definition at line 85 of file EPD_GDE021A1.cpp.

~EPD_GDE021A1 (  )

Destructor.

Definition at line 111 of file EPD_GDE021A1.cpp.


Member Function Documentation

void Clear ( uint16_t  Color )

Clears the EPD.

Parameters:
Color,:Color of the background
Return values:
None

Definition at line 137 of file EPD_GDE021A1.cpp.

void CloseChargePump ( void   )

Disables the clock and the charge pump.

Parameters:
None
Return values:
None

Definition at line 270 of file EPD_GDE021A1.cpp.

void DisplayChar ( uint16_t  Xpos,
uint16_t  Ypos,
uint8_t  Ascii 
)

Displays one character.

Parameters:
Xpos,:start column address.
Ypos,:the Line where to display the character shape.
Ascii,:character ascii code, must be between 0x20 and 0x7E.
Return values:
None

Definition at line 149 of file EPD_GDE021A1.cpp.

void DisplayStringAt ( uint16_t  Xpos,
uint16_t  Ypos,
uint8_t *  Text,
Text_AlignModeTypdef  Mode 
)

Displays characters on the EPD.

Parameters:
Xpos,:X position
Ypos,:Y position
Text,:Pointer to string to display on EPD
Mode,:Display mode This parameter can be one of the following values:

  • CENTER_MODE
  • RIGHT_MODE
  • LEFT_MODE
Return values:
None

Definition at line 156 of file EPD_GDE021A1.cpp.

void DisplayStringAtLine ( uint16_t  Line,
uint8_t *  ptr,
Text_AlignModeTypdef  Mode 
)

Displays a character on the EPD.

Parameters:
Line,:Line where to display the character shape This parameter can be one of the following values:

  • 0..8: if the Current fonts is Font8
  • 0..5: if the Current fonts is Font12
  • 0..3: if the Current fonts is Font16
  • 0..2: if the Current fonts is Font20
ptr,:Pointer to string to display on EPD
Return values:
None

Definition at line 205 of file EPD_GDE021A1.cpp.

void DrawHLine ( uint16_t  Xpos,
uint16_t  Ypos,
uint16_t  Length 
)

Draws an horizontal line.

Parameters:
Xpos,:X position
Ypos,:Y position
Length,:line length
Return values:
None

Definition at line 210 of file EPD_GDE021A1.cpp.

void DrawImage ( uint16_t  Xpos,
uint16_t  Ypos,
uint16_t  Xsize,
uint16_t  Ysize,
uint8_t *  pdata 
)

Draws an Image.

Parameters:
Xpos,:X position in the EPD
Ypos,:Y position in the EPD
Xsize,:X size in the EPD
Ysize,:Y size in the EPD
pdata,:Pointer to the Image address
Return values:
None

Definition at line 260 of file EPD_GDE021A1.cpp.

void DrawRect ( uint16_t  Xpos,
uint16_t  Ypos,
uint16_t  Width,
uint16_t  Height 
)

Draws a rectangle.

Parameters:
Xpos,:X position
Ypos,:Y position
Height,:rectangle height
Width,:rectangle width
Return values:
None

Definition at line 236 of file EPD_GDE021A1.cpp.

void DrawVLine ( uint16_t  Xpos,
uint16_t  Ypos,
uint16_t  Length 
)

Draws a vertical line.

Parameters:
Xpos,:X position
Ypos,:Y position
Length,:line length.
Return values:
None

Definition at line 223 of file EPD_GDE021A1.cpp.

void FillRect ( uint16_t  Xpos,
uint16_t  Ypos,
uint16_t  Width,
uint16_t  Height 
)

Displays a full rectangle.

Parameters:
Xpos,:X position.
Ypos,:Y position.
Height,:display rectangle height.
Width,:display rectangle width.
Return values:
None

Definition at line 247 of file EPD_GDE021A1.cpp.

sFONT * GetFont ( void   )

Gets the Text Font.

Parameters:
None.
Return values:
theused layer font.

Definition at line 132 of file EPD_GDE021A1.cpp.

uint32_t GetXSize ( void   )

Gets the EPD X size.

Parameters:
None
Return values:
EPDX size

Definition at line 117 of file EPD_GDE021A1.cpp.

uint32_t GetYSize ( void   )

Gets the EPD Y size.

Parameters:
None
Return values:
EPDY size

Definition at line 122 of file EPD_GDE021A1.cpp.

void RefreshDisplay ( void   )

Updates the display from the data located into the RAM.

Parameters:
None
Return values:
None

Definition at line 283 of file EPD_GDE021A1.cpp.

void SetFont ( sFONT *  pFonts )

Sets the Text Font.

Parameters:
pFonts,:specifies the layer font to be used.
Return values:
None

Definition at line 127 of file EPD_GDE021A1.cpp.