Documentation ¶
Index ¶
- Constants
- func RGBATo565(c color.RGBA) uint16
- type Config
- type Device
- func (d *Device) Configure(config Config)
- func (d *Device) Display() error
- func (d *Device) DrawBitmap(x, y int16, bitmap Image) error
- func (d *Device) DrawFastHLine(x0, x1, y int16, c color.RGBA) error
- func (d *Device) DrawFastVLine(x, y0, y1 int16, c color.RGBA) error
- func (d *Device) DrawRGBBitmap(x, y int16, data []uint16, w, h int16) errordeprecated
- func (d *Device) DrawRGBBitmap8(x, y int16, data []uint8, w, h int16) errordeprecated
- func (d *Device) DrawRectangle(x, y, w, h int16, c color.RGBA) error
- func (d *Device) EnableTEOutput(on bool)
- func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error
- func (d *Device) FillScreen(c color.RGBA)
- func (d *Device) GetRotation() drivers.Rotationdeprecated
- func (d *Device) Rotation() drivers.Rotation
- func (d *Device) SetPixel(x, y int16, c color.RGBA)
- func (d *Device) SetRotation(rotation drivers.Rotation) error
- func (d *Device) SetScroll(line int16)
- func (d *Device) SetScrollArea(topFixedArea, bottomFixedArea int16)
- func (d *Device) Size() (x, y int16)
- func (d *Device) Sleep(sleepEnabled bool) error
- func (d *Device) StopScroll()
- type Image
- type Rotation
Constants ¶
const ( TFTWIDTH = 240 ///< ILI9341 max TFT width TFTHEIGHT = 320 ///< ILI9341 max TFT height NOP = 0x00 ///< No-op register SWRESET = 0x01 ///< Software reset register RDDID = 0x04 ///< Read display identification information RDDST = 0x09 ///< Read Display Status SLPIN = 0x10 ///< Enter Sleep Mode SLPOUT = 0x11 ///< Sleep Out PTLON = 0x12 ///< Partial Mode ON NORON = 0x13 ///< Normal Display Mode ON RDMODE = 0x0A ///< Read Display Power Mode RDMADCTL = 0x0B ///< Read Display MADCTL RDPIXFMT = 0x0C ///< Read Display Pixel Format RDIMGFMT = 0x0D ///< Read Display Image Format RDSELFDIAG = 0x0F ///< Read Display Self-Diagnostic Result INVOFF = 0x20 ///< Display Inversion OFF INVON = 0x21 ///< Display Inversion ON GAMMASET = 0x26 ///< Gamma Set DISPOFF = 0x28 ///< Display OFF DISPON = 0x29 ///< Display ON CASET = 0x2A ///< Column Address Set PASET = 0x2B ///< Page Address Set RAMWR = 0x2C ///< Memory Write RAMRD = 0x2E ///< Memory Read PTLAR = 0x30 ///< Partial Area VSCRDEF = 0x33 ///< Vertical Scrolling Definition TEOFF = 0x34 ///< TEOFF: Tearing Effect Line OFF TEON = 0x35 ///< TEON: Tearing Effect Line ON MADCTL = 0x36 ///< Memory Access Control VSCRSADD = 0x37 ///< Vertical Scrolling Start Address PIXFMT = 0x3A ///< COLMOD: Pixel Format Set FRMCTR1 = 0xB1 ///< Frame Rate Control (In Normal Mode/Full Colors) FRMCTR2 = 0xB2 ///< Frame Rate Control (In Idle Mode/8 colors) FRMCTR3 = 0xB3 ///< Frame Rate control (In Partial Mode/Full Colors) INVCTR = 0xB4 ///< Display Inversion Control DFUNCTR = 0xB6 ///< Display Function Control PWCTR1 = 0xC0 ///< Power Control 1 PWCTR2 = 0xC1 ///< Power Control 2 PWCTR3 = 0xC2 ///< Power Control 3 PWCTR4 = 0xC3 ///< Power Control 4 PWCTR5 = 0xC4 ///< Power Control 5 VMCTR1 = 0xC5 ///< VCOM Control 1 VMCTR2 = 0xC7 ///< VCOM Control 2 RDID1 = 0xDA ///< Read ID 1 RDID2 = 0xDB ///< Read ID 2 RDID3 = 0xDC ///< Read ID 3 RDID4 = 0xDD ///< Read ID 4 GMCTRP1 = 0xE0 ///< Positive Gamma Correction GMCTRN1 = 0xE1 ///< Negative Gamma Correction MADCTL_MY = 0x80 ///< Bottom to top MADCTL_MX = 0x40 ///< Right to left MADCTL_MV = 0x20 ///< Reverse Mode MADCTL_ML = 0x10 ///< LCD refresh Bottom to top MADCTL_RGB = 0x00 ///< Red-Green-Blue pixel order MADCTL_BGR = 0x08 ///< Blue-Green-Red pixel order MADCTL_MH = 0x04 ///< LCD refresh right to left )
const ( Rotation0 = drivers.Rotation0 Rotation90 = drivers.Rotation90 // 90 degrees clock-wise rotation Rotation180 = drivers.Rotation180 Rotation270 = drivers.Rotation270 Rotation0Mirror = drivers.Rotation0Mirror Rotation90Mirror = drivers.Rotation90Mirror Rotation180Mirror = drivers.Rotation180Mirror Rotation270Mirror = drivers.Rotation270Mirror )
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Device ¶
type Device struct {
// contains filtered or unexported fields
}
func (*Device) DrawBitmap ¶
DrawBitmap copies the bitmap to the internal buffer on the screen at the given coordinates. It returns once the image data has been sent completely.
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) DrawRectangle ¶
DrawRectangle draws a rectangle at given coordinates with a color
func (*Device) EnableTEOutput ¶
EnableTEOutput enables the TE ("tearing effect") line. The TE line goes high when the screen is not currently being updated and can be used to start drawing. When used correctly, it can avoid tearing entirely.
func (*Device) FillRectangle ¶
FillRectangle fills a rectangle at given coordinates with a color
func (*Device) FillScreen ¶
FillScreen fills the screen with a given color
func (*Device) GetRotation
deprecated
func (*Device) SetRotation ¶
SetRotation changes the rotation of the device (clock-wise).
func (*Device) SetScrollArea ¶
SetScrollArea sets an area to scroll with fixed top/bottom or left/right parts of the display Rotation affects scroll direction
func (*Device) Sleep ¶
Set the sleep mode for this LCD panel. When sleeping, the panel uses a lot less power. The LCD won't display an image anymore, but the memory contents will be kept.
func (*Device) StopScroll ¶
func (d *Device) StopScroll()
StopScroll returns the display to its normal state