MCPcopy Create free account
hub / github.com/antirez/freakwan / enable_framebuffer

Method enable_framebuffer

st7789.py:297–308  ·  view source on GitHub ↗
(self,mono=False)

Source from the content-addressed store, hash-verified

295 # display.fb.fill(display.fb_color(100,50,50))
296 # display.show()
297 def enable_framebuffer(self,mono=False):
298 if mono == False:
299 self.fbformat = framebuf.RGB565
300 self.rawbuffer = bytearray(self.width*self.height*2)
301 self.show = self.show_rgb
302 else:
303 self.fbformat = framebuf.MONO_HMSB
304 self.rawbuffer = bytearray((self.width*self.height+7)//8)
305 self.show = self.show_mono
306
307 self.fb = framebuf.FrameBuffer(self.rawbuffer,
308 self.width,self.height,self.fbformat)
309
310 # This function is used to conver an RGB value to the
311 # equivalent color for the framebuffer functions.

Callers 1

__init__Method · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected