Documentation ¶
Index ¶
- Constants
- type BaseCanvas
- type Canvas
- func (d *Canvas) Clear()
- func (d *Canvas) DrawImage(img image.Image)
- func (d *Canvas) Flush()
- func (d *Canvas) FlushDirectly(buffer []byte)
- func (d *Canvas) GetColor(x, y int) color.Color
- func (d *Canvas) GetRGB(x, y int) (r uint8, g uint8, b uint8)
- func (d *Canvas) SetColor(x, y int, c color.Color)
- func (d *Canvas) SetRGB(x, y int, r, g, b uint8)
- type ColorMode
- type ILI9488
- func (s *ILI9488) Clear(r, g, b uint8)
- func (s *ILI9488) Command(data byte)
- func (s *ILI9488) ExchangeData(isData bool, data []byte)
- func (s *ILI9488) FlushBitBuffer(x0, y0, x1, y1 int, buffer []byte)
- func (s *ILI9488) GetCanvas(x0, y0, x1, y1 int) *Canvas
- func (s *ILI9488) GetFullScreenCanvas() *Canvas
- func (s *ILI9488) HardReset()
- func (s *ILI9488) LcdDirection(direction uint8)
- func (s *ILI9488) SendData(data ...byte)
- func (s *ILI9488) SetWindow(x0, y0, x1, y1 int)
- func (s *ILI9488) Size() *image.Point
- type PIN
- type SPI
- type ScreenType
Constants ¶
View Source
const ( SPI_CLOCK_HZ = 40000000 // 40 MHz LCD_H = 480 LCD_W = 320 SET_X_CMD = 0x2A SET_Y_CMD = 0x2B WARM_CMD = 0x2C )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BaseCanvas ¶
type Canvas ¶
type Canvas struct { X0 int // X轴画布起始偏移 Y0 int // Y轴画布起始偏移 X1 int // X轴画布结束偏移 Y1 int // Y轴画布结束偏移 Width int // 画布宽度 Height int // 画布高度 Buffer []byte // 缓冲区 // contains filtered or unexported fields }
Canvas @Description: 画布
func (*Canvas) FlushDirectly ¶
FlushDirectly
@Description: 直接将buffer内容绘制到画布所对应的显示区域,该方法不会覆盖画布缓冲区 @receiver d @param buffer
func (*Canvas) GetColor ¶
GetColor
@Description: 获取缓冲区指定坐标RGBA色值(由于该值从RBG565转换而来,故A值始终为1) @receiver d @param x X轴坐标 @param y Y轴坐标 @return color.Color
func (*Canvas) GetRGB ¶
GetRGB
@Description: 获取缓存区指定坐标的RGB565色值 @receiver d @param x X轴坐标 @param y Y轴坐标 @param r R(0 - 255) @param g G(0 - 255) @param b B(0 - 255)
type ILI9488 ¶
type ILI9488 struct {
// contains filtered or unexported fields
}
func NewILI9488 ¶
NewILI9488
@Description: ILI9488显示驱动 @param spi SPI通信端口 @param dc 引脚DC @param rst 引脚RES @param led 引脚BLK @param cs 选片引脚 @return *ILI9488
func (*ILI9488) Clear ¶
Clear
@Description: 清除画布内容 @receiver s @param r R(0 - 255) @param g G(0 - 255) @param b B(0 - 255)
func (*ILI9488) Command ¶
Command
@Description: 写入显示命令(非线程安全,请使用 Tx 包裹执行) @receiver s @param data 数据
func (*ILI9488) ExchangeData ¶
ExchangeData
@Description: 将数据写入SPI,isData为true表示写入的是数据,反之则是命令(非线程安全,请使用 Tx 包裹执行) @receiver s @param data 需要发送的数据 @param isData 是否是数据类型
func (*ILI9488) FlushBitBuffer ¶
FlushBitBuffer
@Description: 将画布上的图像绘制到屏幕上 @receiver s @param X0 区域开始X轴位置(包含) @param Y0 区域开始Y轴位置(包含) @param X1 区域结束X轴位置(包含) @param Y1 区域结束Y轴位置(包含) @param Buffer RGB565图像
func (*ILI9488) GetCanvas ¶
GetCanvas
@Description: 获取画布 @receiver s @param X0 区域X轴起始(包含) @param Y0 区域Y轴起始(包含) @param X1 区域X轴截止(包含) @param Y1 区域X轴截止(包含) @return *Canvas
func (*ILI9488) GetFullScreenCanvas ¶
GetFullScreenCanvas
@Description: 获取全屏画布 @receiver s @return *Canvas 画布
func (*ILI9488) LcdDirection ¶
LcdDirection
@Description: 设置显示旋转 @receiver s @param direction 0-0 degree 1-90 degree 2-180 degree 3-270 degree
func (*ILI9488) SetWindow ¶
SetWindow
@Description: Set the pixel address window for proceeding drawing commands. X0 and X1 should define the minimum and maximum x pixel bounds. Y0 and Y1 should define the minimum and maximum y pixel bound. @receiver s @param X0 区域开始X轴位置(包含) @param Y0 区域开始Y轴位置(包含) @param X1 区域结束X轴位置(包含) @param Y1 区域结束Y轴位置(包含)
type PIN ¶
type PIN interface { // // High // @Description:输出为高电频 // High() // // Low // @Description:设置为低电频 // Low() // // SetOutput // @Description:设置为输出模式 // SetOutput() }
Click to show internal directories.
Click to hide internal directories.