Skip to content

P8X32A/Propeller, P2X8C4M64P/Propeller 2 driver object for SSD130x OLED displays

License

Notifications You must be signed in to change notification settings

avsa242/ssd130x-spin

Repository files navigation

ssd130x-spin


This is a P8X32A/Propeller 1, P2X8C4M64P/Propeller 2 driver object for the Solomon Systech SSD130x OLED display controller.

IMPORTANT: This software is meant to be used with the spin-standard-library (P8X32A) or p2-spin-standard-library (P2X8C4M64P). Please install the applicable library first before attempting to use this code, otherwise you will be missing several files required to build the project.

Salient Features

  • I2C connection at up to approx 400kHz (unenforced) (NOTE: Datasheet specifies max I2C clock of 400kHz. May function at higher bus speeds. YMMV!)
  • SPI connection at fixed 4MHz (P1), up to 10MHz (P2, unenforced) (NOTE: Datasheet specifies max SPI clock of 10MHz. May function at higher bus speeds. YMMV!)
  • Supports 128x32 and 128x64 displays
  • Display mirroring (horizontal and vertical)
  • Display visibility modes: normal, inverted, all pixels on
  • Variable contrast
  • Low-level display control: Logic voltages, oscillator frequency, addressing mode, row/column mapping
  • Supports display modules with or without discrete RESET pin
  • Integration with the generic bitmap graphics library
  • Buffered display or direct-to-display drawing (see 'Limitations' for direct-to-display)
  • Hardware-accelerated scrolling (horizontal L/R, combined vertical and horizontal L/R)

Requirements

P1/SPIN1:

  • spin-standard-library
  • P1/SPIN1: 1 extra core/cog for the PASM I2C or SPI engine, as applicable
  • graphics.common.spinh (provided by spin-standard-library)
  • (WIDTH * HEIGHT) / 8 bytes of RAM for the display, if buffered mode is used (default)

P2/SPIN2:

  • p2-spin-standard-library
  • graphics.common.spin2h (provided by p2-spin-standard-library)
  • (WIDTH * HEIGHT) / 8 bytes of RAM for the display, if buffered mode is used (default)

Compiler Compatibility

Processor Language Compiler Backend Status
P1 SPIN1 FlexSpin (6.8.0) Bytecode OK
P1 SPIN1 FlexSpin (6.8.0) Native/PASM OK
P2 SPIN2 FlexSpin (6.8.0) NuCode OK
P2 SPIN2 FlexSpin (6.8.0) Native/PASM2 OK

(other versions or toolchains not listed are not supported, and may or may not work)

Hardware Compatibility

  • SSD1306 (tested)
  • SSD1309 (tested)

Limitations

  • Doesn't support parallel interface-connected displays (currently unplanned)
  • Unbuffered/Direct-draw operations are limited, due to the nature of serial 1bpp displays. Box(), Line(), Circle and Plot() aren't implemented.