mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-17 21:23:58 +00:00
Adding scroll functionality for ili9341 (#121)
* ili9341: Adding scroll functionality
This commit is contained in:
+20
-2
@@ -7,8 +7,6 @@ import (
|
||||
"time"
|
||||
)
|
||||
|
||||
const _debug = false
|
||||
|
||||
type Config struct {
|
||||
Width int16
|
||||
Height int16
|
||||
@@ -229,6 +227,26 @@ func (d *Device) SetRotation(rotation Rotation) {
|
||||
d.rotation = rotation
|
||||
}
|
||||
|
||||
// SetScrollWindow sets an area to scroll with fixed top and bottom parts of the display
|
||||
func (d *Device) SetScrollArea(topFixedArea, bottomFixedArea int16) {
|
||||
d.sendCommand(VSCRDEF, []uint8{
|
||||
uint8(topFixedArea >> 8), uint8(topFixedArea),
|
||||
uint8(d.height - topFixedArea - bottomFixedArea>>8),
|
||||
uint8(d.height - topFixedArea - bottomFixedArea),
|
||||
uint8(bottomFixedArea >> 8), uint8(bottomFixedArea),
|
||||
})
|
||||
}
|
||||
|
||||
// SetScroll sets the vertical scroll address of the display.
|
||||
func (d *Device) SetScroll(line int16) {
|
||||
d.sendCommand(VSCRSADD, []uint8{uint8(line >> 8), uint8(line)})
|
||||
}
|
||||
|
||||
// SpotScroll returns the display to its normal state
|
||||
func (d *Device) StopScroll() {
|
||||
d.sendCommand(NORON, nil)
|
||||
}
|
||||
|
||||
// setWindow prepares the screen to be modified at a given rectangle
|
||||
func (d *Device) setWindow(x, y, w, h int16) {
|
||||
//x += d.columnOffset
|
||||
|
||||
Reference in New Issue
Block a user