Check refresh speed by transfermode 4bit,3bit,1bit with MIP8F_SPI_Ver50
Dependencies: MIP8F_SPI_Ver50 MIP8f_FRDM_LineBuffer_sample mbed
Dependents: MIP8f_FRDM_Animation_sample
Introduction
this sample 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.
Other information , please refer to https://os.mbed.com/teams/JapanDisplayInc/code/MIP8f_FRDM_sample/
Usage
Copy Setting File and Image to micro SD-CARD. you can NOT use same sample color images of OTHER VERSION SAMPLE.
a) Download the following file corresponding to the target panel, and rename file identifier (.bin -> .zip), and unzip the file on micro SD Card's root directory.
LPM027M128x (400x240) :/media/uploads/JDI_Mbed_Team/400x240_ver30.bin
b) Insert micro SD-CARD to FRDM-K64F. c) Upload binary file to FRDM-K64F.and push Reset Button.
Other information
refer to Usage on https://os.mbed.com/teams/JapanDisplayInc/code/MIP8f_FRDM_sample/
this Sample Code (.bin)
/media/uploads/JDI_Mbed_Team/mip8f_frdm_transfermode_sample.k64f.bin
Diff: Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp
- Revision:
- 0:33fe30a2b785
diff -r 000000000000 -r 33fe30a2b785 Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/Adafruit_LEDBackpack/Adafruit_LEDBackpack.cpp Tue Sep 04 06:44:01 2018 +0000 @@ -0,0 +1,114 @@ +/*************************************************** + This is a library for our I2C LED Backpacks + + Designed specifically to work with the Adafruit LED Matrix backpacks + ----> http://www.adafruit.com/products/ + ----> http://www.adafruit.com/products/ + + These displays use I2C to communicate, 2 pins are required to + interface. There are multiple selectable I2C addresses. For backpacks + with 2 Address Select pins: 0x70, 0x71, 0x72 or 0x73. For backpacks + with 3 Address Select pins: 0x70 thru 0x77 + + Adafruit invests time and resources providing this open source code, + please support Adafruit and open-source hardware by purchasing + products from Adafruit! + + Written by Limor Fried/Ladyada for Adafruit Industries. + BSD license, all text above must be included in any redistribution + ****************************************************/ + + /* + * Modified by Luiz Hespanha (http://www.d3.do) 8/16/2013 for use in LPC1768 + */ + +#include "mbed.h" +#include "Adafruit_LEDBackpack.h" +#include "Adafruit_GFX.h" + +void Adafruit_LEDBackpack::setBrightness(uint8_t b) { + if (b > 15) b = 15; + uint8_t c = 0xE0 | b; + char foo[1]; + foo[0] = c; + _i2c->write(i2c_addr, foo, 1); +} + +void Adafruit_LEDBackpack::blinkRate(uint8_t b) { + if (b > 3) b = 0; // turn off if not sure + uint8_t c = HT16K33_BLINK_CMD | HT16K33_BLINK_DISPLAYON | (b << 1); + char foo[1]; + foo[0] = c; + _i2c->write(i2c_addr, foo, 1); +} + +Adafruit_LEDBackpack::Adafruit_LEDBackpack(I2C *i2c): _i2c(i2c) { +} + +void Adafruit_LEDBackpack::begin(uint8_t _addr = 0x70) { + i2c_addr = _addr << 1; + + char foo[1]; + foo[0] = 0x21; + + _i2c->write(i2c_addr, foo, 1); // turn on oscillator + + blinkRate(HT16K33_BLINK_OFF); + + setBrightness(15); // max brightness +} + +void Adafruit_LEDBackpack::writeDisplay(void) { + char foo[17]; + foo[0] = 0x00; + int j = 0; + for (uint8_t i=1; i<=16; i+=2) { + int x = displaybuffer[j] & 0xFF; + foo[i] = x; + int x2 = displaybuffer[j] >> 8; + foo[i+1] = x2; + j++; + } + _i2c->write(i2c_addr, foo, 17); +} + +void Adafruit_LEDBackpack::clear(void) { + for (uint8_t i=0; i<8; i++) { + displaybuffer[i] = 0; + } +} + +Adafruit_8x8matrix::Adafruit_8x8matrix(I2C *i2c) : Adafruit_LEDBackpack(i2c), Adafruit_GFX(8, 8) { +} + +void Adafruit_8x8matrix::drawPixel(int16_t x, int16_t y, uint16_t color) { + if ((y < 0) || (y >= 8)) return; + if ((x < 0) || (x >= 8)) return; + + // check rotation, move pixel around if necessary + switch (getRotation()) { + case 1: + swap(x, y); + x = 8 - x - 1; + break; + case 2: + x = 8 - x - 1; + y = 8 - y - 1; + break; + case 3: + swap(x, y); + y = 8 - y - 1; + break; + } + + // wrap around the x + x += 7; + x %= 8; + + + if (color) { + displaybuffer[y] |= 1 << x; + } else { + displaybuffer[y] &= ~(1 << x); + } +} \ No newline at end of file