2121
2222**Software and Dependencies:**
2323
24- * Adafruit CircuitPython (version 5 +) firmware for the supported boards:
24+ * Adafruit CircuitPython (version 6 +) firmware for the supported boards:
2525 https://github.com/adafruit/circuitpython/releases
2626
2727"""
3737DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650 = const (0x60 )
3838"""
3939The hardware display offset to use when configuring the SH1107 for the
40- `Adafruit Featherwing 128x64 OLED <https://www.adafruit.com/product/4650>`_
40+ `Adafruit Featherwing 128x64 OLED <https://www.adafruit.com/product/4650>`_.
41+ This is the default if not passed in.
4142
4243.. code-block::
4344
4445 from adafruit_displayio_sh1107 import SH1107, DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650
4546
46- # Simplest constructor, assumes it is an Adafruit FeatherWing 128x64 OLED
47+ # Constructor for the Adafruit FeatherWing 128x64 OLED
4748 display = SH1107(bus, width=128, height=64,
4849 display_offset=DISPLAY_OFFSET_ADAFRUIT_FEATHERWING_OLED_4650)
4950 # Or as it's the default
7475 b"\x81 \x01 \x2f " # contrast setting = 0x2f
7576 b"\x21 \x00 " # vertical (column) addressing mode (POR=0x20)
7677 b"\xa0 \x00 " # segment remap = 1 (POR=0, down rotation)
77- b"\xcf \x00 " # common output scan direction = 15 (0 to n-1 (POR=0) )
78+ b"\xcf \x00 " # common output scan direction = 15 (n-1 to 0) (POR=0)
7879 b"\xa8 \x01 \x7f " # multiplex ratio = 128 (POR)
7980 b"\xd3 \x01 \x60 " # set display offset mode = 0x60
8081 b"\xd5 \x01 \x51 " # divide ratio/oscillator: divide by 2, fOsc (POR)
9192 _INIT_SEQUENCE = (
9293 b"\xae \x00 " # display off, sleep mode
9394 b"\xdc \x01 \x00 " # set display start line 0
94- b"\x81 \x01 \x4f " # contrast setting = 0x2f
95+ b"\x81 \x01 \x4f " # contrast setting = 0x4f
9596 b"\x20 \x00 " # vertical (column) addressing mode (POR=0x20)
9697 b"\xa0 \x00 " # segment remap = 1 (POR=0, down rotation)
97- b"\xc0 \x00 " # common output scan direction = 15 (0 to n-1 (POR=0))
98- b"\xa8 \x01 \x3f " # multiplex ratio = 128 (POR)
98+ b"\xc0 \x00 " # common output scan direction = 0 (0 to n-1 (POR=0))
99+ b"\xa8 \x01 \x3f " # multiplex ratio = 64 (POR=0x7F )
99100 b"\xd3 \x01 \x60 " # set display offset mode = 0x60
100101 # b"\xd5\x01\x51" # divide ratio/oscillator: divide by 2, fOsc (POR)
101102 b"\xd9 \x01 \x22 " # pre-charge/dis-charge period mode: 2 DCLKs/2 DCLKs (POR)
111112
112113class SH1107 (displayio .Display ):
113114 """
114- SSD1107 driver for use with DisplayIO
115+ SH1107 driver for use with DisplayIO
115116
116117 :param bus: The bus that the display is connected to.
117118 :param int width: The width of the display. Maximum of 128
@@ -139,8 +140,7 @@ def __init__(
139140 color_depth = 1 ,
140141 grayscale = True ,
141142 pixels_in_byte_share_row = _PIXELS_IN_ROW , # in vertical (column) mode
142- data_as_commands = True , # every byte will have a command byte preceeding
143- set_vertical_scroll = 0xD3 , # TBD -- not sure about this one!
143+ data_as_commands = True , # every byte will have a command byte preceding
144144 brightness_command = 0x81 ,
145145 single_byte_bounds = True ,
146146 rotation = (rotation + _ROTATION_OFFSET ) % 360 ,
@@ -157,20 +157,22 @@ def is_awake(self):
157157 """
158158 The power state of the display. (read-only)
159159
160- True if the display is active, False if in sleep mode.
160+ `True` if the display is active, `False` if in sleep mode.
161+
162+ :type: bool
161163 """
162164 return self ._is_awake
163165
164166 def sleep (self ):
165167 """
166- Put display into sleep mode
168+ Put display into sleep mode. The display uses < 5uA in sleep mode
167169
168- The display uses < 5uA in sleep mode
169170 Sleep mode does the following:
170- 1) Stops the oscillator and DC-DC circuits
171- 2) Stops the OLED drive
172- 3) Remembers display data and operation mode active prior to sleeping
173- 4) The MP can access (update) the built-in display RAM
171+
172+ 1) Stops the oscillator and DC-DC circuits
173+ 2) Stops the OLED drive
174+ 3) Remembers display data and operation mode active prior to sleeping
175+ 4) The MP can access (update) the built-in display RAM
174176 """
175177 if self ._is_awake :
176178 self .bus .send (int (0xAE ), "" ) # 0xAE = display off, sleep mode
0 commit comments