Documentation ¶
Index ¶
- type DisplayMode
- type DisplayOnOff
- type DisplayStatus
- type SSD1331
- func (oled *SSD1331) ActiveScroll(horScrlOffset, startRowAddr, horRowScrl, verScrlOffset byte, ...)
- func (oled *SSD1331) Buffer() *[]byte
- func (oled *SSD1331) Clear()
- func (oled *SSD1331) ClearDisplay()
- func (oled *SSD1331) Close() error
- func (oled *SSD1331) DeactiveScrool()
- func (oled *SSD1331) Display()
- func (oled *SSD1331) DisplayOff()
- func (oled *SSD1331) DisplayOn()
- func (oled *SSD1331) DisplayOnDim()
- func (oled *SSD1331) DrawRect(...)
- func (oled *SSD1331) Fill(r, g, b int)
- func (oled *SSD1331) GetPixel(x, y int) uint16
- func (oled *SSD1331) Init() error
- func (oled *SSD1331) LOCK()
- func (oled *SSD1331) Resolution() (int, int)
- func (oled *SSD1331) SetCircle(cx, cy int, r float64, a, b, c int)
- func (oled *SSD1331) SetDisplayMode(mode DisplayMode)
- func (oled *SSD1331) SetHLine(x, y, w, r, g, b int)
- func (oled *SSD1331) SetImage(img image.Image)
- func (oled *SSD1331) SetLine(x0, y0, x1, y1, r, g, b int)
- func (oled *SSD1331) SetPixel(x, y, r, g, b int)
- func (oled *SSD1331) SetRGBContrast(r, g, b byte)
- func (oled *SSD1331) SetVLine(x, y, h, r, g, b int)
- func (oled *SSD1331) SettingDimMode(r, g, b, preChargeVoltage byte)
- func (oled *SSD1331) UNLOCK()
- type ScrollStep
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DisplayMode ¶
type DisplayMode byte
const ( Nomal DisplayMode = iota + 0xA4 EntireON EntireOFF Inverse )
func (DisplayMode) String ¶ added in v0.3.0
func (m DisplayMode) String() string
type DisplayOnOff ¶ added in v0.3.0
type DisplayOnOff byte
const ( DisplayOnInDim DisplayOnOff = 0xAC DisplayOff DisplayOnOff = 0xAE DisplayON DisplayOnOff = 0xAF )
func (DisplayOnOff) IsTurnOn ¶ added in v0.3.0
func (s DisplayOnOff) IsTurnOn() bool
func (DisplayOnOff) String ¶ added in v0.3.0
func (s DisplayOnOff) String() string
type DisplayStatus ¶ added in v0.3.0
type DisplayStatus struct { Mode DisplayMode Display DisplayOnOff Scroll struct { IsScroll bool Step ScrollStep } LOCKED bool }
type SSD1331 ¶
type SSD1331 struct { Name string Frequency physic.Frequency ResetPin gpio.PinIO DCPin gpio.PinIO Status DisplayStatus // contains filtered or unexported fields }
SSD1331 96*64 pixels, 16bit color OLED.
func (*SSD1331) ActiveScroll ¶
func (oled *SSD1331) ActiveScroll(horScrlOffset, startRowAddr, horRowScrl, verScrlOffset byte, scrlInterval ScrollStep)
ActiveScroll Scrool the display.
horScrlOffset Set number of column as horizontal scroll offset. startRowAddr Define start row address. horRowScrl Set number of rows to be horizontal scrolled. verScrlOffset Set number of row as vertical scroll offset. scrlInterval Set time interval between each scroll step.
func (*SSD1331) ClearDisplay ¶
func (oled *SSD1331) ClearDisplay()
ClearDisplay Clear the buffer then apply display.
func (*SSD1331) DeactiveScrool ¶
func (oled *SSD1331) DeactiveScrool()
DeactiveScrool If Scrool function is Active then stop the scrool.
func (*SSD1331) DisplayOnDim ¶
func (oled *SSD1331) DisplayOnDim()
DisplayOnDim Turn on the OLED in dim mode.
func (*SSD1331) DrawRect ¶
func (oled *SSD1331) DrawRect(x0, y0, x1, y1, lineColorR, lineColorG, lineColorB, fillColorR, fillColorG, fillColorB int, fill bool)
DrawRect Draw a rectangle to the OLED.
func (*SSD1331) LOCK ¶
func (oled *SSD1331) LOCK()
LOCK MCU interface will no longer accept commands.
func (*SSD1331) Resolution ¶
Resolution Returns the resolution of OLED.
func (*SSD1331) SetCircle ¶ added in v0.4.3
DrawCircle Draw the circle.
cx,xy Positions the circle. r Size of circle. a R color b G color c B color
func (*SSD1331) SetDisplayMode ¶
func (oled *SSD1331) SetDisplayMode(mode DisplayMode)
SetDisplayMode Change the display mode.
func (*SSD1331) SetImage ¶ added in v0.4.0
SetImage Set the image pixels to buffer. Support resolutions are display width and height.
func (*SSD1331) SetRGBContrast ¶
SetRGBContrast value <= 128.
func (*SSD1331) SettingDimMode ¶
SettingDimMode Configure dim mode setting r, g, b <= 255, preChargeVoltage <= 31
type ScrollStep ¶
type ScrollStep byte
const ( Frames6 ScrollStep = iota Frames10 Frames100 Frames200 )
func (ScrollStep) String ¶ added in v0.3.0
func (s ScrollStep) String() string