Version 5.0. 4bit,3bit,1bit transfermode
Dependents: MIP8f_FRDM_TransferMode_sample MIP8f_FRDM_CountUpNumber_sample2
MIP8F_SPI_Ver5.0
Ver5.0 Addtional function is checking the refresh display speed between 4bit,3bit and 1bit transfer mode
- spi-transfer to Display has 3 mode. 4bit mode is color display, this bit arrange is R,G,B,x. R,G,B = R,G,B subpixel bit. x bit is Dummy. 3bit mode is color display, this bit arrange is R,G,B. R,G,B = R,G,B subpixel bit. No bit is Dummy. 1bit mode is monocrome display,high speed refresh mode. a only Green subpixel of bitmap data is transfered.
Revision 1:2b85e7edcc4e, committed 2018-10-24
- Comitter:
- JDI_Mbed_Team
- Date:
- Wed Oct 24 02:23:30 2018 +0000
- Parent:
- 0:b2d46804658c
- Child:
- 2:944f2968c19f
- Commit message:
- for Video;
Changed in this revision
MIP8F_SPI.cpp | Show annotated file Show diff for this revision Revisions of this file |
MIP8F_SPI.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/MIP8F_SPI.cpp Mon Oct 22 04:21:43 2018 +0000 +++ b/MIP8F_SPI.cpp Wed Oct 24 02:23:30 2018 +0000 @@ -84,28 +84,48 @@ char_y = y; } /** -* @brief dispay character by font +* @brief dispay character by font. int mode:: =0 :common font(defualt), =1 : big font +* big font is that "char data" byte size is over 0xff. +* */ -void memLCD8::character(int x, int y, int c) +void memLCD8::character(int x, int y, int c,int mode) { unsigned int hor,vert,offset0,offset1,bpl,j,i,b; // T.Okamoto modified, for big font unsigned char* zeichen; unsigned char z,w; // int index; - if ((c < 31) || (c > 127)) return; // test char range + + if( mode == 0 ){ + //for common font + if ((c < 31) || (c > 127)) return; // test char range + offset0 = font[0]; // bytes / char + hor = font[1]; // get hor size of font + vert = font[2]; // get vert size of font + bpl = font[3]; // bytes per line - offset0 = font[0]; // bytes / char - offset1 = font[1]; // bytes / char - hor = font[2]; // get hor size of font - vert = font[3]; // get vert size of font - bpl = font[4]; // bytes per line + if (char_x + hor > _width) { + char_x = 0; + char_y = char_y + vert; + if (char_y >= _height - font[2]) char_y = 0; // original = font[2] T.Okamoto modified, for big font + } + zeichen = &font[(c -32) * (offset0) + 4]; // start of char bitmap // original = +4 T.Okamoto modified, for big font + }else{ + // for big font + if ((c < 31) || (c > 127)) return; // test char range + offset0 = font[0]; // bytes / char + offset1 = font[1]; // bytes / char + hor = font[2]; // get hor size of font + vert = font[3]; // get vert size of font + bpl = font[4]; // bytes per line - if (char_x + hor > _width) { - char_x = 0; - char_y = char_y + vert; - if (char_y >= _height - font[3]) char_y = 0; // original = font[2] T.Okamoto modified, for big font + if (char_x + hor > _width) { + char_x = 0; + char_y = char_y + vert; + if (char_y >= _height - font[3]) char_y = 0; // original = font[2] T.Okamoto modified, for big font + } + zeichen = &font[(c -32) * (offset0 *256 + offset1) + 5]; // start of char bitmap // original = +4 T.Okamoto modified, for big font } - zeichen = &font[(c -32) * (offset0 *256 + offset1) + 5]; // start of char bitmap // original = +4 T.Okamoto modified, for big font + w = zeichen[0]; // width of actual char for (j=0; j<vert; j++) { // vert line for (i=0; i<hor; i++) { // horz line
--- a/MIP8F_SPI.h Mon Oct 22 04:21:43 2018 +0000 +++ b/MIP8F_SPI.h Wed Oct 24 02:23:30 2018 +0000 @@ -82,7 +82,7 @@ void setmarge(bool ifMarge); void setWH(int width, int height); void SwDisp(bool ONorOFF); - void character(int x, int y, int c); + void character(int x, int y, int c,int mode = 0); // 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);