pub enum Command {
Show 27 variants
Contrast(u8),
AllOn(bool),
Invert(bool),
DisplayOn(bool),
HScrollSetup(HScrollDir, Page, Page, NFrames),
VHScrollSetup(VHScrollDir, Page, Page, NFrames, u8),
EnableScroll(bool),
VScrollArea(u8, u8),
LowerColStart(u8),
UpperColStart(u8),
ColStart(u8),
AddressMode(AddrMode),
ColumnAddress(u8, u8),
PageAddress(Page, Page),
PageStart(Page),
StartLine(u8),
SegmentRemap(bool),
Multiplex(u8),
ReverseComDir(bool),
DisplayOffset(u8),
ComPinConfig(bool, bool),
DisplayClockDiv(u8, u8),
PreChargePeriod(u8, u8),
VcomhDeselect(VcomhLevel),
Noop,
ChargePump(bool),
InternalIref(bool, bool),
}
Expand description
SSD1306 Commands Commands
Variants§
Contrast(u8)
Set contrast. Higher number is higher contrast. Default = 0x7F
AllOn(bool)
Turn entire display on. If set, all pixels will be set to on, if not, the value in memory will be used.
Invert(bool)
Invert display.
DisplayOn(bool)
Turn display on or off.
HScrollSetup(HScrollDir, Page, Page, NFrames)
Set up horizontal scrolling. Values are scroll direction, start page, end page, and number of frames per step.
VHScrollSetup(VHScrollDir, Page, Page, NFrames, u8)
Set up horizontal + vertical scrolling. Values are scroll direction, start page, end page, number of frames per step, and vertical scrolling offset. Scrolling offset may be from 0-63
EnableScroll(bool)
Enable scrolling
VScrollArea(u8, u8)
Setup vertical scroll area. Values are number of rows above scroll area (0-63) and number of rows of scrolling. (0-64)
LowerColStart(u8)
Set the lower nibble of the column start address register for Page addressing mode, using the lower 4 bits given. This is only for page addressing mode
UpperColStart(u8)
Set the upper nibble of the column start address register for Page addressing mode, using the lower 4 bits given. This is only for page addressing mode
ColStart(u8)
Set the column start address register for Page addressing mode. Combines LowerColStart and UpperColStart This is only for page addressing mode
AddressMode(AddrMode)
Set addressing mode
ColumnAddress(u8, u8)
Setup column start and end address values range from 0-127 This is only for horizontal or vertical addressing mode
PageAddress(Page, Page)
Setup page start and end address This is only for horizontal or vertical addressing mode
PageStart(Page)
Set GDDRAM page start address for Page addressing mode
StartLine(u8)
Set display start line from 0-63
SegmentRemap(bool)
Reverse columns from 127-0
Multiplex(u8)
Set multiplex ratio from 15-63 (MUX-1)
ReverseComDir(bool)
Scan from COM[n-1] to COM0 (where N is mux ratio)
DisplayOffset(u8)
Set vertical shift
ComPinConfig(bool, bool)
Setup com hardware configuration First value indicates sequential (false) or alternative (true) pin configuration. Second value disables (false) or enables (true) left/right remap.
DisplayClockDiv(u8, u8)
Set up display clock. First value is oscillator frequency, increasing with higher value Second value is divide ratio - 1
PreChargePeriod(u8, u8)
Set up phase 1 and 2 of precharge period. Each value must be in the range 1 - 15.
VcomhDeselect(VcomhLevel)
Set Vcomh Deselect level
Noop
NOOP
ChargePump(bool)
Enable charge pump
InternalIref(bool, bool)
Select external or internal I REF. Only for 72 x 40 display with SSD1306B driver
Implementations§
source§impl Command
impl Command
sourcepub fn send<DI>(self, iface: &mut DI) -> Result<(), DisplayError>where
DI: WriteOnlyDataCommand,
pub fn send<DI>(self, iface: &mut DI) -> Result<(), DisplayError>where
DI: WriteOnlyDataCommand,
Send command to SSD1306