diff options
author | Brett Weiland <brett_weiland@bpcsapce.com> | 2022-09-27 16:14:28 -0500 |
---|---|---|
committer | Brett Weiland <brett_weiland@bpcsapce.com> | 2022-09-27 16:14:28 -0500 |
commit | 94304b11e7220f060dbc345de5fa1952d0465016 (patch) | |
tree | f16e84c54b27f67e089ded1175fbf8b561896b42 /src/ssd1306_display_driver.c | |
parent | 7b006d6f2032ac46074d693ae59a971bee327ace (diff) |
working on serial syncronization for programming eeprom
Diffstat (limited to 'src/ssd1306_display_driver.c')
-rw-r--r-- | src/ssd1306_display_driver.c | 41 |
1 files changed, 1 insertions, 40 deletions
diff --git a/src/ssd1306_display_driver.c b/src/ssd1306_display_driver.c index 0e7d4cc..0bff3b0 100644 --- a/src/ssd1306_display_driver.c +++ b/src/ssd1306_display_driver.c @@ -20,7 +20,7 @@ void screen_init() { #ifdef DEBUG_BUILD - printf("initlizing SSD1306 display driver\n"); + printf("initlizing SSD1306 display driver\r\n"); #endif //turn on screen while we configure shit, it might look cooler i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xaf); @@ -86,42 +86,3 @@ void screen_update() { } } -#ifdef DEBUG_BUILD -//ugly code below - -void scroll_test() { - //sets scroll area to whole screen - i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 3, (uint8_t[]){0xa3, 0x00, 0x20}); - //set up scroll options - i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 6, (uint8_t[]){0x29, 0x00, 0x00, 0x00, 0x04, 0x00}); - //actually activate scroll - i2c_write_reg_multi(SSD1306_ADDR, SSD1306_CMD_REG, 6, (uint8_t[]){0x2f}); -} - -void screen_testdraw() { - unsigned int on_pix; - unsigned int on_page; - - printf("running screen time tests\n"); - printf("generating test image...\n"); - for(on_pix = 0; on_pix < sizeof(screen_buffer); on_pix++) - screen_buffer[on_pix] = ((uint8_t)0xaa << (on_pix % 8)); - - printf("page mode, individual byte per i2c call...\n"); - for(on_page = 0; on_page < SCREEN_PAGE_CNT; on_page++) { - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xb0 + on_page); - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x00); - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x10); - for(on_pix = 0; on_pix < SCREEN_RES_X; on_pix++) - i2c_write_reg(SSD1306_ADDR, SSD1306_DATA_REG, screen_buffer[(on_page * 8) + on_pix]); - } - printf("page mode, 1 page per i2c call...\n"); - for(on_page = 0; on_page < SCREEN_PAGE_CNT; on_page++) { - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xb0 + on_page); - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x00); - i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0x10); - i2c_write_reg_multi(SSD1306_ADDR, SSD1306_DATA_REG, SCREEN_RES_X, &screen_buffer[on_page * SCREEN_RES_X]); - } -} - -#endif |