Basically i glued Peter Drescher and Simon Ford libs in a GraphicsDisplay class, then derived TFT or LCD class (which inherits Protocols class), then the most derived ones (Inits), which are per-display and are the only part needed to be adapted to diff hw.
Dependents: testUniGraphic_150217 maze_TFT_MMA8451Q TFT_test_frdm-kl25z TFT_test_NUCLEO-F411RE ... more
Diff: Inits/SEPS225.cpp
- Revision:
- 34:c66986d80f72
- Parent:
- 31:ef4225cef157
--- a/Inits/SEPS225.cpp Mon Feb 06 12:29:33 2017 +0000 +++ b/Inits/SEPS225.cpp Tue Jan 25 17:57:55 2022 +0000 @@ -134,8 +134,10 @@ oled->frequency(1000000) ; #endif - reg_write(CMD_REDUCE_CURRENT, 0x01) ; wait(0.01) ; // oled_delay(100000) ; - reg_write(CMD_REDUCE_CURRENT, 0x00) ; wait(0.01) ; // oled_delay(100000) ; + reg_write(CMD_REDUCE_CURRENT, 0x01) ; + thread_sleep_for(100) ; // oled_delay(100000) ; + reg_write(CMD_REDUCE_CURRENT, 0x00) ; + thread_sleep_for(100) ; // oled_delay(100000) ; reg_write(CMD_OSC_CTL, 0x01) ; reg_write(CMD_CLOCK_DIV, 0x30) ; @@ -245,24 +247,24 @@ void SEPS225::rect(int x0, int y0, int x1, int y1, unsigned short color) { - float interval = 0.01 ; + int interval = 10 ; // window(x0, y0, x1-x0+1, y1-y0+1) ; *_cs = 0 ; - wait(interval) ; + thread_sleep_for(interval) ; line(x0, y0, x1, y0, color) ; *_cs = 1 ; - wait(interval) ; + thread_sleep_for(interval) ; *_cs = 0 ; line(x1, y0, x1, y1, color) ; *_cs = 1 ; - wait(interval) ; + thread_sleep_for(interval) ; *_cs = 0 ; line(x0, y0, x0, y1, color) ; *_cs = 1 ; - wait(interval) ; + thread_sleep_for(interval) ; *_cs = 0 ; line(x0, y1, x1, y1, color) ; - wait(interval) ; + thread_sleep_for(interval) ; *_cs = 1 ; // *_cs = 1 ; }