pyupm_st7735 module

class pyupm_st7735.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

m_cursorX
m_cursorY
m_height
m_map
m_textBGColor
m_textColor
m_textSize
m_width
m_wrap
refresh()[source]

virtual void refresh()=0

Copies the buffer to the chip via the SPI.

setAddrWindow(x0, y0, x1, y1)[source]

virtual void setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1)=0

Sets the window address

x0: First coordinate

y0: First coordinate

x1: Second coordinate

y1: Second coordinate

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

setPixel(x, y, color)[source]

mraa::Result setPixel(int x, int y, uint16_t color)

Prints a message on the screen

x: Axis on the horizontal scale

y: Axis on the vertical scale

color: Pixel color

setTextColor(textColor, textBGColor)[source]

void setTextColor(uint16_t textColor, uint16_t textBGColor)

Sets a text color for a message

textColor: Font color

textBGColor: Background color

setTextSize(size)[source]

void setTextSize(uint8_t size)

Sets the size of the font

size: Font size

setTextWrap(wrap)[source]

void setTextWrap(uint8_t wrap)

Wraps a printed message

wrap: True (0x1) or false (0x0)

class pyupm_st7735.ST7735(csLCD, cSD, rs, rst)[source]

Bases: pyupm_st7735.GFX

API for the ST7735 LCD.

ID: st7735

Name: SPI-based 262K Color Single-Chip TFT-LCD

Category: display

Manufacturer: adafruit

Link:http://www.adafruit.com/product/358

Connection: spi This module defines the interface for the ST7735 display library

C++ includes: st7735.hpp

configModule()[source]

void configModule()

Configures the chip via the SPI

data(value)[source]

void data(uint8_t value)

Sends data to an SPI bus (rs must be HIGH)

value: Command number

drawPixel(x, y, color)[source]

void drawPixel(int16_t x, int16_t y, uint16_t color)

Sends a pixel color (RGB) to the 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])

executeCMDList(addr)[source]

void executeCMDList(const uint8_t *addr)

Executes a set of commands and data

addr: Pointer to the start of the commands/data section

initModule()[source]

void initModule()

Initializes the module GPIOs

lcdCSOff()[source]

mraa::Result lcdCSOff()

LCD chip select is HIGH

lcdCSOn()[source]

mraa::Result lcdCSOn()

LCD chip select is LOW

m_map
name()[source]

std::string name()

Returns the name of the component

refresh()[source]

void refresh()

Copies the buffer to the chip via the SPI.

rsHIGH()[source]

mraa::Result rsHIGH()

Data select is HIGH

rsLOW()[source]

mraa::Result rsLOW()

Data select is LOW

sdCSOff()[source]

mraa::Result sdCSOff()

CD card select is HIGH

sdCSOn()[source]

mraa::Result sdCSOn()

CD card chip select is LOW

setAddrWindow(x0, y0, x1, y1)[source]

void setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1)

Sets the window size inside the screen where pixels data is written.

x0: First coordinate

y0: First coordinate

x1: Second coordinate

y1: Second coordinate

write(value)[source]

void write(uint8_t value)

Sends a command to an SPI bus (rs must be LOW)

value: Command number

class pyupm_st7735.uint8Array(nelements)[source]

Bases: object

cast()[source]
static frompointer()