pyupm_ssd1351 module¶
-
class
pyupm_ssd1351.
GFX
(*args, **kwargs)[source]¶ Bases:
object
GFX helper class.
This file is used by the screen.
C++ includes: ili9341_gfx.hpp
-
drawChar
(x, y, data, color, bg, size)[source]¶ void drawChar(int16_t x, int16_t y, uint8_t data, uint16_t color, uint16_t bg, uint8_t size)
x: Axis on the horizontal scale
y: Axis on the vertical scale
data: Character to write
color: Character color
bg: Character background color
size: Size of the font
-
drawCircle
(x, y, r, color)[source]¶ void drawCircle(int16_t x, int16_t y, int16_t r, uint16_t color)
Draws a circle
x: Center of the circle on the horizontal scale
y: Center of the circle on the vertical scale
r: Radius of the circle
color: Color of the circle
-
drawFastVLine
(x, y, h, color)[source]¶ void drawFastVLine(int16_t x, int16_t y, int16_t h, uint16_t color)
Draws a line on the vertical scale
x: Axis on the horizontal scale
y: Axis on the vertical scale
h: Distanse from y
color: Selected color
-
drawLine
(x0, y0, x1, y1, color)[source]¶ void drawLine(int16_t x0, int16_t y0, int16_t x1, int16_t y1, uint16_t color)
Draws a line from coordinate C0 to coordinate C1
x0: First coordinate
y0: First coordinate
x1: Second coordinate
y1: Second coordinate
color: selected color
-
drawPixel
(x, y, color)[source]¶ virtual void drawPixel(int16_t x, int16_t y, uint16_t color)=0
Sends a pixel color (RGB) to the chip. Must be implemented by the inherited class.
x: Axis on the horizontal scale
y: Axis on the vertical scale
color: RGB value
-
drawTriangle
(x0, y0, x1, y1, x2, y2, color)[source]¶ void drawTriangle(int16_t x0, int16_t y0, int16_t x1, int16_t y1, int16_t x2, int16_t y2, uint16_t color)
Draws a triangle
x0: First coordinate
y0: First coordinate
x1: Second coordinate
y1: Second coordinate
x2: Third coordinate
y2: Third coordinate
color: Selected color
-
fillRect
(x, y, w, h, color)[source]¶ void fillRect(int16_t x, int16_t y, int16_t w, int16_t h, uint16_t color)
Fills a rectangle with a selected color
x: Axis on the horizontal scale (top-left corner)
y: Axis on the vertical scale (top-left corner)
w: Distanse from x
h: Distanse from y
color: Selected color
-
fillScreen
(color)[source]¶ void fillScreen(uint16_t color)
Fills the screen with a selected color
color: Selected color
-
setCursor
(x, y)[source]¶ void setCursor(int16_t x, int16_t y)
Sets the cursor for a text message
x: Axis on the horizontal scale
y: Axis on the vertical scale
-
-
class
pyupm_ssd1351.
SSD1351
(oc, dc, rst)[source]¶ Bases:
pyupm_ssd1351.GFX
API for SSD1351 OLED displays.
ID: ssd1351
Name: SPI-based OLED Display
Category: display
Manufacturer: adafruit
Link:http://www.adafruit.com/products/1431
Connection: spi This module defines the interface for the SSD1351 display library. It was tested with the Adafruit 1.5” OLED Display, but should work with any SSD1351 display running in SPI mode.
On the Intel Edison don’t forget to disable SPI Power Management (PM) for this driver to work, you can find more details on this topic here:http://iotdk.intel.com/docs/master/mraa/edison.html
C++ includes: ssd1351.hpp
-
drawPixel
(x, y, color)[source]¶ void drawPixel(int16_t x, int16_t y, uint16_t color)
Sends a pixel color (RGB) to the display buffer or chip
x: Axis on the horizontal scale
y: Axis on the vertical scale
color: RGB (16-bit) color (R[0-4], G[5-10], B[11-15])
-
useMemoryMap
(var)[source]¶ void useMemoryMap(bool var)
Use memory mapped (buffered) writes to the display
var: true for yes (default), false for no
-