ssd1306

package
v1.0.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 5, 2022 License: BSD-3-Clause Imports: 2 Imported by: 0

Documentation

Overview

Package ssd1306 provides driver to SSD1306 based displays.

Index

Constants

View Source
const (
	LCSA   = 0x00 // Lower column start address for page addressing mode
	HCSA   = 0x10 // Higher column start address for page addressing mode
	MAM    = 0x20 // Memory addressing mode
	CA     = 0x21 // Column start and end address
	PA     = 0x22 // Page start and end address
	CSR    = 0x26 // Continuous right horizontal scroll
	CSL    = 0x27 // Continuous left horizontal scroll
	CSVR   = 0x29 // Continuous vertical and right horizontal scroll
	CSVL   = 0x2A // Continuous vertical and left horizontal scroll
	CSD    = 0x2E // Deactivate continous scroll
	CSA    = 0x2F // Activate continous scroll
	DSL    = 0x40 // Display start line
	CONTR  = 0x81 // Set contrast control
	CPUMP  = 0x8D // Charge pump settings
	SRM    = 0xA0 // Segment re-map
	VSA    = 0xA3 // Vertical Scroll Area
	DOUT   = 0xA4 // Output follows RAM content
	DWHT   = 0xA5 // Set entire display white
	DNOR   = 0xA6 // Set normal display
	DINV   = 0xA7 // Set inverse display
	MR     = 0xA8 // Multiplex ratio
	SLPIN  = 0xAE // Set sleep mode ON
	SLPOUT = 0xAF // Set sleep mode OFF
	PSA    = 0xB0 // Page start address (0..7) for page addressing mode
	COMSD  = 0xC0 // COM output scan direction
	VOFF   = 0xD3 // Vertical display offset (0..63)
	CLKDIV = 0xD5 // Display clock divide ratio / Oscillator frequency
	PRE    = 0xD9 // Pre-charge period
	COMPHC = 0xDA // COM pins hardware configuration
	VCOMH  = 0xDB // VCOMH deselect level
	NOP    = 0xE3 // No operation
)
View Source
const (
	MaxParallelWriteClock = 3.3e6
	MaxParallelReadClock  = 3.3e6
)

The maximum speed of the 8-bit paraler interface is 3.3 MHz which corresponds to the maximum bandwidth of 26.7 Mb/s.

View Source
const (
	MaxI2CWriteClock = 400e3
)

The maximum I2C clock is 400 kHz (Fast Mode).

View Source
const (
	MaxSPIWriteClock = 10e6
)

The maximum SPI clock is 10 MHz. The performance of a particular SPI bus depends on many factors which can probably be tuned for even higher speeds. The absolute upper limits are those given for the parallel interface.

Variables

View Source
var GFX128x64 = []byte{
	SLPIN,
	CLKDIV, 0x80,
	MR, 64 - 1,
	VOFF, 0,
	DSL | 0,
	CPUMP, 0x14,
	MAM, 0x01,
	SRM | 0x01,
	COMSD | 0x08,
	COMPHC, 0x12,
	CONTR, 0xCF,
	PRE, 0xF1,
	VCOMH, 0x40,
	DOUT,
	DNOR,
	CSD,
	SLPOUT,
}
View Source
var GFX128x64ExtVcc = []byte{
	SLPIN,
	CLKDIV, 0x80,
	MR, 64 - 1,
	VOFF, 0,
	DSL | 0,
	CPUMP, 0x10,
	MAM, 0x01,
	SRM | 0x1,
	COMSD | 0x08,
	COMPHC, 0x12,
	CONTR, 0x9F,
	PRE, 0x22,
	VCOMH, 0x40,
	DOUT,
	DNOR,
	CSD,
	SLPOUT,
}

Functions

This section is empty.

Types

type FrameBuffer

type FrameBuffer struct {
	// contains filtered or unexported fields
}

func New

func New(dci fbdrv.DCI) *FrameBuffer

func (*FrameBuffer) Err

func (fb *FrameBuffer) Err(clear bool) error

func (*FrameBuffer) Flush

func (fb *FrameBuffer) Flush() []byte

func (*FrameBuffer) Init

func (fb *FrameBuffer) Init(cmds []byte)

func (*FrameBuffer) SetDir

func (fb *FrameBuffer) SetDir(dir int) (pix []byte, w, h, s int, shift, mvxy uint8)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL