FlexBook / Mbed 2 deprecated FlexBook171204a

Dependencies:   SDFileSystem app epson mbed msp430 pl tests

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers eink.h Source File

eink.h

00001 //
00002 // Filename: eink.h
00003 //
00004 // Flexbook eInk display driver definitions.
00005 //
00006 
00007 #ifndef EINK_H
00008 #define EINK_H
00009 
00010 #include "mbed.h"
00011 
00012 /**
00013  * @brief Initialise the display hardware.
00014  * @param i2c The I2C to use for control data.
00015  * @param spi The SPI to use for data.
00016  * @param spics The SPI chip select line (the Epson driver manually sets it).
00017  * @param hven The display enable line.
00018  * @param rst The Epson controller rest line.
00019  * @param hvpok The power OK signal.
00020  */
00021 void InitDisplay(I2C &i2c, SPI &spi, DigitalOut &spics, DigitalOut &hven, DigitalOut &rst, DigitalIn &hvpok);
00022 void WriteImage(const int numimage);
00023 
00024 struct pl_epdc;
00025 
00026 /**
00027  * @brief Write a colour to the entire screen.
00028  * @param epdc The eInk device.
00029  * @param colour The colour to write.
00030  */
00031 void WriteColour(pl_epdc &epdc, uint8_t colour);
00032 
00033 /**
00034  * @brief Write an image to the screen.
00035  * @param file The file to write e.g. "/myfile.pgm".
00036  */
00037 void WriteImage(const char *file);
00038 
00039 /**
00040  * @brief Write a partial image to the display.
00041  * @param file The file to write e.g. "/myfile.pgm".
00042  * @param xd X display coordinate.
00043  * @param yd Y display coordinate.
00044  * @param xi X image coordinate.
00045  * @param yi Y image coordinate.
00046  * @param w Width of image.
00047  * @param h Height of image.
00048  */
00049 void WritePartImage(const char *filename, int xd, int yd, int xi, int yi, int w, int h);
00050 
00051 /**
00052  * @brief Update the eInk display.
00053  */
00054 void UpdateDisplay();
00055 
00056 /**
00057  * @brief Display hardware settings. Use the VERBOSE preprocessor define to see more information.
00058  */
00059 void DisplayHardwareSettings();
00060 
00061 /**
00062  * @ brief Get a handle to the display device information.
00063  * This information is only valid after InitDiaplay() has been called.
00064  * Use this to pass to WritePicture and WriteColour.
00065  * @return The eInk device information struct.
00066  */
00067 pl_epdc &Get_epdc();
00068 
00069 #endif // EINK_H
00070