summaryrefslogtreecommitdiff
path: root/src/ssd1306_display_driver.c
diff options
context:
space:
mode:
authorBrett Weiland <brett_weiland@bpcsapce.com>2023-01-24 14:58:52 -0600
committerBrett Weiland <brett_weiland@bpcsapce.com>2023-01-24 14:58:52 -0600
commita5984050eb556741ef40792d6335b7f65fa1eb4f (patch)
treeaaf870b1558d6b40369f481443c4ce768f9b76be /src/ssd1306_display_driver.c
parentb666668d0e6b67e4632e65486cae814ab5abbc39 (diff)
started fixing makefile, created test function
Diffstat (limited to 'src/ssd1306_display_driver.c')
-rw-r--r--src/ssd1306_display_driver.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/ssd1306_display_driver.c b/src/ssd1306_display_driver.c
index 0bff3b0..9155e1e 100644
--- a/src/ssd1306_display_driver.c
+++ b/src/ssd1306_display_driver.c
@@ -73,6 +73,7 @@ void screen_init() {
}
+
void screen_off() { i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xaf); }
void screen_on() { i2c_write_reg(SSD1306_ADDR, SSD1306_CMD_REG, 0xae); }
@@ -86,3 +87,10 @@ void screen_update() {
}
}
+void screen_test() {
+ printf("testing screen\n");
+ for(int on_pix = 0; on_pix < (SCREEN_RES_X * SCREEN_RES_Y) / 8; on_pix++)
+ screen_buffer[on_pix] = 0b10101010;
+ printf("done testing screen\n");
+ screen_update();
+}