Skip to content

Commit 87f7e81

Browse files
committed
add method to set Vsl int/ext reference
1 parent e7df07c commit 87f7e81

File tree

3 files changed

+33
-5
lines changed

3 files changed

+33
-5
lines changed

core.con.ssd1322.spin

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@
44
Description: SSD1322-specific constants
55
Author: Jesse Burt
66
Started: Jul 17, 2023
7-
Updated: Aug 20, 2024
8-
Copyright (c) 2024 - See end of file for terms of use.
7+
Updated: Feb 14, 2025
8+
Copyright (c) 2025 - See end of file for terms of use.
99
----------------------------------------------------------------------------------------------------
1010
}
1111

@@ -84,6 +84,16 @@ CON
8484
CLK_DIV_CLR = CLK_DIV_BITS ^ CLKDIV_MASK
8585

8686
DISP_ENH_A = $b4
87+
DISP_ENH_A_A_MASK = $a3
88+
VSL_BITS = %11
89+
VSL_MASK = VSL_BITS ^ DISP_ENH_A_A_MASK
90+
VSL_INTERNAL = %10
91+
DISP_ENH_A_B_MASK = $fd
92+
LOWGS = 3
93+
LOWGS_BITS = %11111
94+
LOWGS_MASK = (LOWGS_BITS << LOWGS) ^ DISP_ENH_A_B_MASK
95+
ENH_LOWGS = %11111 << LOWGS
96+
NORM_LOWGS = %10110 << LOWGS
8797

8898
SET_GPIO = $b5
8999
SETGPIO_MASK = $0F
@@ -112,7 +122,7 @@ PUB null()
112122

113123
DAT
114124
{
115-
Copyright 2024 Jesse Burt
125+
Copyright 2025 Jesse Burt
116126
117127
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
118128
associated documentation files (the "Software"), to deal in the Software without restriction,

display.oled.ssd1322.spin

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Description: Driver for SSD1322 OLED displays
55
Author: Jesse Burt
66
Started: Jul 17, 2023
7-
Updated: Feb 11, 2025
7+
Updated: Feb 14, 2025
88
Copyright (c) 2025 - See end of file for terms of use.
99
----------------------------------------------------------------------------------------------------
1010
}
@@ -55,6 +55,7 @@ VAR
5555
byte _remap[2] ' set re-map and dual COM line mode
5656
byte _clkdiv ' clock divider and oscillator freq
5757
byte _gpio_state ' gpio 0, 1 state
58+
byte _disp_enh_a[2] ' ext/int VSL, enhanced low GS disp quality
5859

5960

6061
PUB start(): s
@@ -322,6 +323,14 @@ PUB vdd_regulator(r)
322323
command(core.FUNC_SEL, (r <> 0) & 1, 1)
323324

324325

326+
PUB vsl_reference(r)
327+
' Set Vsl reference
328+
' 0: external
329+
' non-zero values: internal (default)
330+
_disp_enh_a[0] := (_disp_enh_a & core.VSL_MASK) | ( (r <> 0) ? core.VSL_INTERNAL : $00 )
331+
command(core.DISP_ENH_A, _disp_enh_a[0], 1)
332+
333+
325334
PRI command(c, v=0, l=0)
326335
' Issue simple command, no parameters
327336
outa[_DC] := CMD

display.oled.ssd1322.spin2

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
Description: Driver for SSD1322 OLED displays
55
Author: Jesse Burt
66
Started: Jan 15, 2024
7-
Updated: Feb 11, 2025
7+
Updated: Feb 14, 2025
88
Copyright (c) 2025 - See end of file for terms of use.
99
----------------------------------------------------------------------------------------------------
1010
}
@@ -55,6 +55,7 @@ VAR
5555
byte _remap[2] ' set re-map and dual COM line mode
5656
byte _clkdiv ' clock divider and oscillator freq
5757
byte _gpio_state ' gpio 0, 1 state
58+
byte _disp_enh_a[2] ' ext/int VSL, enhanced low GS disp quality
5859

5960

6061
PUB start(): s
@@ -319,6 +320,14 @@ PUB vdd_regulator(r)
319320
command(core.FUNC_SEL, (r <> 0) & 1, 1)
320321

321322

323+
PUB vsl_reference(r)
324+
' Set Vsl reference
325+
' 0: external
326+
' non-zero values: internal (default)
327+
_disp_enh_a[0] := (_disp_enh_a & core.VSL_MASK) | ( (r <> 0) ? core.VSL_INTERNAL : $00 )
328+
command(core.DISP_ENH_A, _disp_enh_a[0], 1)
329+
330+
322331
PRI command(c, v=0, l=0)
323332
' Issue simple command, no parameters
324333
pinw(_DC, CMD)

0 commit comments

Comments
 (0)