STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #include "u8x8.h" static const uint8_t u8x8_d_uc1604_powersave0_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_DLY(20), U8X8_C(0x0af), /* display on */ U8X8_DLY(20), /* during setup, it seems that the startup is more reliable when sending this cmd twice */ U8X8_C(0x0af), /* display on */ U8X8_DLY(50), /* startup takes some time */ U8X8_END_TRANSFER(), /* disable chip */ U8X8_END() /* end of sequence */ }; static const uint8_t u8x8_d_uc1604_powersave1_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_C(0x0ae), /* display off, enter sleep mode */ U8X8_END_TRANSFER(), /* disable chip */ U8X8_END() /* end of sequence */ };
U8X8_END_TRANSFER(), /* disable chip */ U8X8_END() /* end of sequence */ }; static const uint8_t u8x8_d_ssd1606_to_display_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ //U8X8_CA(0x22, 0xc0), /* display update seq. option: Enable clock and charge pump */ //U8X8_C(0x20), /* execute sequence */ //U8X8_DLY(10), /* strange, splitting 0x0c0 does not work reliable */ U8X8_CA(0x22, 0xc4), /* display update seq. option: clk -> CP -> LUT -> initial display -> pattern display */ U8X8_C(0x20), /* execute sequence */ U8X8_DLY(250), /* the sequence above requires about 970ms */ U8X8_DLY(250), U8X8_DLY(250), U8X8_DLY(230), U8X8_CA(0x22, 0x03), /* disable clock and charge pump */ U8X8_DLY(200), /* this requres about 270ms */ U8X8_DLY(90), //U8X8_CA(0x10, 0x01), /* deep sleep mode */ //U8X8_C(0x20), /* execute sequence */ U8X8_DLY(50), U8X8_END_TRANSFER(), /* disable chip */ U8X8_END() /* end of sequence */ };
/* sck_clock_hz = */ 1000000UL, /* since Arduino 1.6.0, the SPI bus speed in Hz. Should be 1000000000/sck_pulse_width_ns */ /* spi_mode = */ 0, /* i2c_bus_clock_100kHz = */ 4, /* data_setup_time_ns = */ 80, /* write_pulse_width_ns = */ 80, /* tile_width = */ 30, /* tile_hight = */ 16, /* default_x_offset = */ 0, /* flipmode_x_offset = */ 0, /* pixel_width = */ 240, /* pixel_height = */ 128 }; /* 240x128 */ static const uint8_t u8x8_d_t6963_240x128_init_seq[] = { U8X8_DLY(100), U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_DLY(100), U8X8_AAC(0x00,0x00,0x021), /* low, high, set cursor pos */ U8X8_AAC(0x00,0x00,0x022), /* low, high, set offset */ U8X8_AAC(0x00,0x00,0x040), /* low, high, set text home */ U8X8_AAC(240/8,0x00,0x041), /* low, high, set text columns */ U8X8_AAC(0x00,0x00,0x042), /* low, high, graphics home */ U8X8_AAC(240/8,0x00,0x043), /* low, high, graphics columns */ U8X8_DLY(2), /* delay 2ms */ // mode set // 0x080: Internal CG, OR Mode // 0x081: Internal CG, EXOR Mode // 0x083: Internal CG, AND Mode // 0x088: External CG, OR Mode
/* data_setup_time_ns = */ 30, /* uc1608 datasheet, page 39 */ /* write_pulse_width_ns = */ 35, /* uc1608 datasheet, page 39 */ /* tile_width = */ 30, /* width of 30*8=240 pixel */ /* tile_hight = */ 8, /* default_x_offset = */ 0, /* reused as y page offset */ /* flipmode_x_offset = */ 4, /* reused as y page offset */ /* pixel_width = */ 240, /* pixel_height = */ 64 }; static const uint8_t u8x8_d_uc1608_erc24064_init_seq[] = { U8X8_START_TRANSFER(), /* enable chip, delay is part of the transfer start */ U8X8_C(0x0e2), /* soft reset */ U8X8_DLY(200), U8X8_C(0x023), /* Bit 0/1: Temp compenstation, Bit 2: Multiplex Rate 0=96, 1=128 */ //U8X8_C(0x027), /* Bit 0/1: Temp compenstation, Bit 2: Multiplex Rate 0=96, 1=128 */ U8X8_C(0x0c8), /* Map control, Bit 3: MY=1, Bit 2: MX=0, Bit 0: MSF =0 */ U8X8_C(0x0e8), /* LCD bias Bits 0/1: 00=10.7 01=10.3, 10=12.0, 11=12.7 */ U8X8_C(0x02f), /* power on, Bit 2 PC2=1 (internal charge pump), Bits 0/1: cap of panel */ U8X8_DLY(50), U8X8_C(0x040), /* set display start line to 0 */ U8X8_C(0x090), /* no fixed lines */ U8X8_C(0x089), /* RAM access control */ U8X8_CA(0x081, 0x014), /* set contrast, ERC24064-1 default: 0x040 */