rust-embedded-community / ssd1306

SSD1306 OLED driver
Apache License 2.0
286 stars 68 forks source link

Implement switching display power #86

Closed tpwrules closed 5 years ago

tpwrules commented 5 years ago

Implements #84 . Tested using Adafruit OLED Featherwing. Display has no issues accepting commands while switched off so I don't believe there is a need to implement any interlocks or new state.

Closes #84

tpwrules commented 5 years ago

Alright, I changed it. I also added a little note clarifying when it can be used as I myself did not realize that the display could still be communicated with while turned off.

To answer your aside, I feel like it's perfectly fine for the name to start with set_. It's expensive in the sense that it generates bus traffic, and it changes the state of the device. I think its corresponding getter should just be display_on though.

jamwaffles commented 5 years ago

Thanks for the change! I'll sanity check on my cheapo Aliexpress display module tonight and get this PR merged in.