aboutsummaryrefslogtreecommitdiff
path: root/drivers/oled/oled_driver.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/oled/oled_driver.h')
-rw-r--r--drivers/oled/oled_driver.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/drivers/oled/oled_driver.h b/drivers/oled/oled_driver.h
index ec07f1d9b..abbdde57e 100644
--- a/drivers/oled/oled_driver.h
+++ b/drivers/oled/oled_driver.h
@@ -24,17 +24,39 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
24 // Expected user to implement the necessary defines 24 // Expected user to implement the necessary defines
25#elif defined(OLED_DISPLAY_128X64) 25#elif defined(OLED_DISPLAY_128X64)
26 // Double height 128x64 26 // Double height 128x64
27#ifndef OLED_DISPLAY_WIDTH
27 #define OLED_DISPLAY_WIDTH 128 28 #define OLED_DISPLAY_WIDTH 128
29#endif
30#ifndef OLED_DISPLAY_HEIGHT
28 #define OLED_DISPLAY_HEIGHT 64 31 #define OLED_DISPLAY_HEIGHT 64
32#endif
33#ifndef OLED_MATRIX_SIZE
29 #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed) 34 #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 1024 (compile time mathed)
30 #define OLED_BLOCK_TYPE uint32_t 35#endif
36#ifndef OLED_BLOCK_TYPE
37 #define OLED_BLOCK_TYPE uint16_t
38#endif
39#ifndef OLED_BLOCK_COUNT
31 #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed) 40 #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 32 (compile time mathed)
41#endif
42#ifndef OLED_BLOCK_SIZE
32 #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) 43 #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed)
44#endif
45#ifndef OLED_COM_PINS
46 #define OLED_COM_PINS COM_PINS_ALT
47#endif
33 48
34 // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays 49 // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
35 // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode 50 // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
36 #define OLED_SOURCE_MAP { 32, 40, 48, 56 } 51#ifndef OLED_SOURCE_MAP
37 #define OLED_TARGET_MAP { 24, 16, 8, 0 } 52 #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
53#endif
54#ifndef OLED_TARGET_MAP
55 #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 }
56#endif
57 // If OLED_BLOCK_TYPE is uint32_t, these tables would look like:
58 // #define OLED_SOURCE_MAP { 32, 40, 48, 56 }
59 // #define OLED_TARGET_MAP { 24, 16, 8, 0 }
38 // If OLED_BLOCK_TYPE is uint16_t, these tables would look like: 60 // If OLED_BLOCK_TYPE is uint16_t, these tables would look like:
39 // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } 61 // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
40 // #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 } 62 // #define OLED_TARGET_MAP { 56, 48, 40, 32, 24, 16, 8, 0 }
@@ -43,17 +65,36 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
43 // #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 } 65 // #define OLED_TARGET_MAP { 56, 120, 48, 112, 40, 104, 32, 96, 24, 88, 16, 80, 8, 72, 0, 64 }
44#else // defined(OLED_DISPLAY_128X64) 66#else // defined(OLED_DISPLAY_128X64)
45 // Default 128x32 67 // Default 128x32
68#ifndef OLED_DISPLAY_WIDTH
46 #define OLED_DISPLAY_WIDTH 128 69 #define OLED_DISPLAY_WIDTH 128
70#endif
71#ifndef OLED_DISPLAY_HEIGHT
47 #define OLED_DISPLAY_HEIGHT 32 72 #define OLED_DISPLAY_HEIGHT 32
73#endif
74#ifndef OLED_MATRIX_SIZE
48 #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed) 75 #define OLED_MATRIX_SIZE (OLED_DISPLAY_HEIGHT / 8 * OLED_DISPLAY_WIDTH) // 512 (compile time mathed)
76#endif
77#ifndef OLED_BLOCK_TYPE
49 #define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only 78 #define OLED_BLOCK_TYPE uint16_t // Type to use for segmenting the oled display for smart rendering, use unsigned types only
79#endif
80#ifndef OLED_BLOCK_COUNT
50 #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed) 81 #define OLED_BLOCK_COUNT (sizeof(OLED_BLOCK_TYPE) * 8) // 16 (compile time mathed)
82#endif
83#ifndef OLED_BLOCK_SIZE
51 #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed) 84 #define OLED_BLOCK_SIZE (OLED_MATRIX_SIZE / OLED_BLOCK_COUNT) // 32 (compile time mathed)
85#endif
86#ifndef OLED_COM_PINS
87 #define OLED_COM_PINS COM_PINS_SEQ
88#endif
52 89
53 // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays 90 // For 90 degree rotation, we map our internal matrix to oled matrix using fixed arrays
54 // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode 91 // The OLED writes to it's memory horizontally, starting top left, but our memory starts bottom left in this mode
92#ifndef OLED_SOURCE_MAP
55 #define OLED_SOURCE_MAP { 0, 8, 16, 24 } 93 #define OLED_SOURCE_MAP { 0, 8, 16, 24 }
94#endif
95#ifndef OLED_TARGET_MAP
56 #define OLED_TARGET_MAP { 24, 16, 8, 0 } 96 #define OLED_TARGET_MAP { 24, 16, 8, 0 }
97#endif
57 // If OLED_BLOCK_TYPE is uint8_t, these tables would look like: 98 // If OLED_BLOCK_TYPE is uint8_t, these tables would look like:
58 // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 } 99 // #define OLED_SOURCE_MAP { 0, 8, 16, 24, 32, 40, 48, 56 }
59 // #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 } 100 // #define OLED_TARGET_MAP { 48, 32, 16, 0, 56, 40, 24, 8 }