53
53
54
54
55
55
class SSD1306 (displayio .Display ):
56
- """SSD1306 driver"""
56
+ """
57
+ SSD1306 driver
58
+
59
+ :param int width: The width of the display
60
+ :param int height: The height of the display
61
+ :param int rotation: The rotation of the display in degrees. Default is 0. Must be one of
62
+ (0, 90, 180, 270)
63
+ """
57
64
58
65
def __init__ (self , bus , ** kwargs ):
59
66
# Patch the init sequence for 32 pixel high displays.
@@ -74,7 +81,6 @@ def __init__(self, bus, **kwargs):
74
81
set_column_command = 0x21 ,
75
82
set_row_command = 0x22 ,
76
83
data_as_commands = True ,
77
- set_vertical_scroll = 0xD3 ,
78
84
brightness_command = 0x81 ,
79
85
single_byte_bounds = True ,
80
86
)
@@ -85,17 +91,18 @@ def is_awake(self):
85
91
"""
86
92
The power state of the display. (read-only)
87
93
88
- True if the display is active, False if in sleep mode.
94
+ `True` if the display is active, `False` if in sleep mode.
95
+
96
+ :type: bool
89
97
"""
90
98
return self ._is_awake
91
99
92
100
def sleep (self ):
93
101
"""
94
- Put display into sleep mode
102
+ Put display into sleep mode.
95
103
96
- Display uses < 10uA in sleep mode
97
- Display remembers display data and operation mode active prior to sleeping
98
- MP can access (update) the built-in display RAM
104
+ Display uses < 10uA in sleep mode. Display remembers display data and operation mode
105
+ active prior to sleeping. MP can access (update) the built-in display RAM.
99
106
"""
100
107
if self ._is_awake :
101
108
self .bus .send (int (0xAE ), "" ) # 0xAE = display off, sleep mode
0 commit comments