Documentation ¶
Overview ¶
Package ssd1351 implements a driver for the SSD1351 OLED color displays.
Datasheet: https://download.mikroe.com/documents/datasheets/ssd1351-revision-1.3.pdf
Index ¶
- Constants
- func RGBATo565(c color.RGBA) uint16
- type Config
- type Device
- func (d *Device) Command(command uint8)
- func (d *Device) Configure(cfg Config)
- func (d *Device) Data(data uint8)
- func (d *Device) Display() error
- func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA)
- func (d *Device) DrawFastVLine(x, y0, y1 int16, c color.RGBA)
- func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error
- func (d *Device) FillRectangleWithBuffer(x, y, width, height int16, buffer []color.RGBA) error
- func (d *Device) FillScreen(c color.RGBA)
- func (d *Device) SetContrast(contrastA, contrastB, contrastC uint8)
- func (d *Device) SetPixel(x int16, y int16, c color.RGBA)
- func (d *Device) Size() (w, h int16)
- func (d *Device) Tx(data []byte, isCommand bool)
Constants ¶
View Source
const ( SET_COLUMN_ADDRESS = 0x15 SET_ROW_ADDRESS = 0x75 WRITE_RAM = 0x5C READ_RAM = 0x5D SET_REMAP_COLORDEPTH = 0xA0 SET_DISPLAY_START_LINE = 0xA1 SET_DISPLAY_OFFSET = 0xA2 SET_DISPLAY_MODE_ALLOFF = 0xA4 SET_DISPLAY_MODE_ALLON = 0xA5 SET_DISPLAY_MODE_RESET = 0xA6 SET_DISPLAY_MODE_INVERT = 0xA7 FUNCTION_SELECTION = 0xAB SLEEP_MODE_DISPLAY_OFF = 0xAE SLEEP_MODE_DISPLAY_ON = 0xAF SET_PHASE_PERIOD = 0xB1 ENHANCED_DRIVING_SCHEME = 0xB2 SET_FRONT_CLOCK_DIV = 0xB3 SET_SEGMENT_LOW_VOLTAGE = 0xB4 SET_GPIO = 0xB5 SET_SECOND_PRECHARGE_PERIOD = 0xB6 GRAY_SCALE_LOOKUP = 0xB8 LINEAR_LUT = 0xB9 SET_PRECHARGE_VOLTAGE = 0xBB SET_VCOMH_VOLTAGE = 0xBE SET_CONTRAST = 0xC1 MASTER_CONTRAST = 0xC7 SET_MUX_RATIO = 0xCA NOP0 = 0xD1 NOP1 = 0xE3 SET_COMMAND_LOCK = 0xFD HORIZONTAL_SCROLL = 0x96 STOP_MOVING = 0x9E START_MOVING = 0x9F )
Commands
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
Device wraps an SPI connection.
func (*Device) Display ¶
Display does nothing, there's no buffer as it might be too big for some boards
func (*Device) DrawFastHLine ¶
DrawFastHLine draws a horizontal line faster than using SetPixel
func (*Device) DrawFastVLine ¶
DrawFastVLine draws a vertical line faster than using SetPixel
func (*Device) FillRectangle ¶
FillRectangle fills a rectangle at given coordinates with a color
func (*Device) FillRectangleWithBuffer ¶
FillRectangleWithBuffer fills a rectangle at given coordinates with a buffer
func (*Device) FillScreen ¶
FillScreen fills the screen with a given color
func (*Device) SetContrast ¶
SetContrast sets the three contrast values (A, B & C)
Click to show internal directories.
Click to hide internal directories.