Skip to content

Commit 008157b

Browse files
deadprogramconejoninja
authored andcommitted
st7789: correct errors on various godoc comments
Signed-off-by: deadprogram <[email protected]>
1 parent 0ed9683 commit 008157b

File tree

1 file changed

+11
-9
lines changed

1 file changed

+11
-9
lines changed

st7789/st7789.go

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,10 @@ import (
1616
"tinygo.org/x/drivers"
1717
)
1818

19+
// Rotation controls the rotation used by the display.
1920
type Rotation uint8
2021

22+
// FrameRate controls the frame rate used by the display.
2123
type FrameRate uint8
2224

2325
// Device wraps an SPI connection.
@@ -278,7 +280,7 @@ func (d *Device) FillRectangle(x, y, width, height int16, c color.RGBA) error {
278280
return nil
279281
}
280282

281-
// FillRectangle fills a rectangle at a given coordinates with a buffer
283+
// FillRectangleWithBuffer fills buffer with a rectangle at a given coordinates.
282284
func (d *Device) FillRectangleWithBuffer(x, y, width, height int16, buffer []color.RGBA) error {
283285
i, j := d.Size()
284286
if x < 0 || y < 0 || width <= 0 || height <= 0 ||
@@ -370,12 +372,12 @@ func (d *Device) SetRotation(rotation Rotation) {
370372
d.Data(madctl)
371373
}
372374

373-
// Command sends a command to the display
375+
// Command sends a command to the display.
374376
func (d *Device) Command(command uint8) {
375377
d.Tx([]byte{command}, true)
376378
}
377379

378-
// Command sends a data to the display
380+
// Data sends data to the display.
379381
func (d *Device) Data(data uint8) {
380382
d.Tx([]byte{data}, false)
381383
}
@@ -393,13 +395,13 @@ func (d *Device) Tx(data []byte, isCommand bool) {
393395
}
394396

395397
// Rx reads data from the display
396-
func (d *Device) Rx(command uint8, read_bytes []byte) {
398+
func (d *Device) Rx(command uint8, data []byte) {
397399
d.dcPin.Low()
398400
d.csPin.Low()
399401
d.bus.Transfer(command)
400402
d.dcPin.High()
401-
for i := range read_bytes {
402-
read_bytes[i], _ = d.bus.Transfer(0xFF)
403+
for i := range data {
404+
data[i], _ = d.bus.Transfer(0xFF)
403405
}
404406
d.csPin.High()
405407
}
@@ -421,7 +423,7 @@ func (d *Device) EnableBacklight(enable bool) {
421423
}
422424
}
423425

424-
// InverColors inverts the colors of the screen
426+
// InvertColors inverts the colors of the screen
425427
func (d *Device) InvertColors(invert bool) {
426428
if invert {
427429
d.Command(INVON)
@@ -435,7 +437,7 @@ func (d *Device) IsBGR(bgr bool) {
435437
d.isBGR = bgr
436438
}
437439

438-
// SetScrollWindow sets an area to scroll with fixed top and bottom parts of the display
440+
// SetScrollArea sets an area to scroll with fixed top and bottom parts of the display.
439441
func (d *Device) SetScrollArea(topFixedArea, bottomFixedArea int16) {
440442
d.Command(VSCRDEF)
441443
d.Tx([]uint8{
@@ -451,7 +453,7 @@ func (d *Device) SetScroll(line int16) {
451453
d.Tx([]uint8{uint8(line >> 8), uint8(line)}, false)
452454
}
453455

454-
// SpotScroll returns the display to its normal state
456+
// StopScroll returns the display to its normal state.
455457
func (d *Device) StopScroll() {
456458
d.Command(NORON)
457459
}

0 commit comments

Comments
 (0)