Version 6.0. Animaiton demo.

Dependents:   MIP8f_FRDM_Animation_sample

MIP8F_SPI_Ver6.0

Ver6.0 Addtional function is animation code sample.

Revision:
3:c67b96404016
Parent:
2:944f2968c19f
Child:
4:c41da26fe04a
--- a/MIP8F_SPI.h	Wed Oct 31 02:05:47 2018 +0000
+++ b/MIP8F_SPI.h	Tue Nov 06 02:16:10 2018 +0000
@@ -1,7 +1,11 @@
 /**
 * @file MIP8F_SPI.h
-* @brief ver3.0 Library header file: Class for JDI MIP8 display
+* @brief ver4.0 Library header file: Class for JDI MIP8 display
 * @details  
+* Ver4.0 Addtional function is Line buffer version
+* Ver3.0 Addtional function is font display
+* ver2.0 Addtional function is Monochome display by 1bit mode of SPI transfer.
+*
 * <license>
 * Copyright 2018 Japan Display Inc.
 * Licensed under the Apache License, Version 2.0 (the "License");
@@ -20,16 +24,22 @@
 * Select compile option
 ******************************************/
 /**
-* @def LINEBUFF_MODE
-* @ brief If you will use a Line Buffer mode,you must define LINEBUFF_MODE 
+* @def LINEBUFF_MODE 0
+* @brief If you will use a Line Buffer mode,you must define LINEBUFF_MODE 1
 */
-//#define LINEBUFF_MODE
+#define LINEBUFF_MODE 1
+/**
+* @def FRAMEBUFF_MODE 1
+* @brief If you will use a Frame Buffer mode,you must define LINEBUFF_MODE 1
+*/
+#define FRAMEBUFF_MODE 0
 /*****************************************
 ******************************************/
-#ifdef LINEBUFF_MODE
+#if LINEBUFF_MODE
     //  1dot = 4bit
     #define LINE_SIZE  320  // 640 / 2
-#else
+#endif
+#if FRAMEBUFF_MODE
     //#define FRAME_SIZE 9328  //1flame = 212dot X 88dot  1dot = 4bit
     #define FRAME_SIZE  153600  //  153600 640 x 480        103600  400dot x 200dot    1dot = 4bit
 #endif
@@ -61,29 +71,44 @@
 class memLCD8 : public Stream {
 public:
 
-/**
-* @brief Constructor : Set MPU pin names
-*/
+    unsigned char* font;
+
+    /**
+    * @brief Constructor : Set MPU pin names
+    */
     memLCD8(PinName mosi,PinName miso,PinName sclk,PinName cs,PinName disp,PinName power); 
-#ifndef LINEBUFF_MODE
-    void  writeDISP(void);
-    void  writeDISP(int transfermode);           // transfermode : 4bit,3bit,1bit
-    void  writeDISP(int startline , int endline , int transfermode);    // refresh display selected line
-    void  pixel(int x, int y, uint8_t color);     //for framebuffer
-#else
-    void  writeDISP(int line,int transfermode);// for linebuffer
-    void  pixel(int x, uint8_t color);           // for linebuffer
-#endif
-    void  clsBUF(void);
     void  locate(int x, int y);
+    void set_font(unsigned char* f);
+    void setWH(int width, int height);
+    void SwDisp(bool ONorOFF);
     void foreground(uint8_t colour);
     void background(uint8_t colour);
     void command(char command);
+    //ver2.0
+    void SetTransfermode(int transfermode);
+  
+    //ver3.0
+    void set_FixedFontWidth( unsigned char width );
+    void set_ActualFontWidth(void);
+    unsigned char get_Background(void);
+
+#if LINEBUFF_MODE
+    //ver3.0
+    void  pixel(int x, uint8_t color);
+    void  clsLINEBUF(void);
+    int*  GetPixelValueFromLineBuffer(int _x,uint8_t* buff);
+    void  writeDISPLinebuffer(void);
+    void  writeDISP(int line,int transfermode);
+#endif
+
+#if FRAMEBUFF_MODE
+    void  pixel(int x, int y, uint8_t color);
+    void  writeDISP(void);
+    void  writeDISP(int transfermode);// transfermode : 4bit,3bit,1bit
+    void  writeDISP(int startline , int endline , int transfermode);// refresh display selected line
+    void  clsBUF(void);
     void setmarge(bool ifMarge);
-    void setWH(int width, int height);
-    void SwDisp(bool ONorOFF);
     void character(int x, int y, int c);
-//    void LayerCopy(void);
     void circle(int x0, int y0, int r, uint8_t color);
     void fillcircle(int x0, int y0, int r, uint8_t color);
     void hline(int x0, int x1, int y, uint8_t color);
@@ -92,20 +117,13 @@
     void rect(int x0, int y0, int x1, int y1, uint8_t color);
     void fillrect(int x0, int y0, int x1, int y1, uint8_t color);
     void Symbol(unsigned int x, unsigned int y, unsigned char *symbol);
-    void set_font(unsigned char* f);
-
-    unsigned char* font;
-
     //ver2.0
-    void SetTransfermode(int transfermode);
     int* GetPixelValue(int x , int y , uint8_t* buff);
     //ver3.0
-    void set_FixedFontWidth( unsigned char width );
-    void set_ActualFontWidth(void);
-    unsigned char get_Background(void);
     int  textout(int x,int y,char* text);
     void oblique(int x, int y, int c);
     int  obliqueout(int x,int y,char* text);
+#endif
 
 protected:
     virtual int _putc(int value);
@@ -131,14 +149,15 @@
     //! Fixed Font width size  if _FixedFontWidth==0, use actual Font width size.
     unsigned char _FixedFontWidth;
     
-#ifndef LINEBUFF_MODE
+#if FRAMEBUFF_MODE
     //! frame buffer for display
     uint8_t _dispBUF[FRAME_SIZE];
     //uint8_t _LayerBUF[FRAME_SIZE];
-#else
+#endif
+#if LINEBUFF_MODE
     //uint8_t *_pLineBuf;
     //! line buffer for display
-    uint8_t _dispBUF[LINE_SIZE];
+    uint8_t _dispLINEBUF[LINE_SIZE];
 #endif
 
     //! height,diplay pixel size