File tree Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Expand file tree Collapse file tree 2 files changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -10,6 +10,7 @@ import (
1010 "time"
1111
1212 "tinygo.org/x/drivers"
13+ "tinygo.org/x/drivers/internal/legacy"
1314)
1415
1516// Device wraps an SPI connection.
@@ -283,9 +284,10 @@ func (d *Device) Tx(data []byte, isCommand bool) {
283284// tx sends data to the display (I2CBus implementation)
284285func (b * I2CBus ) tx (data []byte , isCommand bool ) {
285286 if isCommand {
287+ legacy .WriteRegister (b .wire , uint8 (b .Address ), 0x00 , data )
286288 b .wire .WriteRegister (uint8 (b .Address ), 0x00 , data )
287289 } else {
288- b . wire . WriteRegister (uint8 (b .Address ), 0x40 , data )
290+ legacy . WriteRegister (b . wire , uint8 (b .Address ), 0x40 , data )
289291 }
290292}
291293
Original file line number Diff line number Diff line change @@ -136,3 +136,4 @@ tinygo build -size short -o ./build/test.hex -target=pico ./examples/ndir/main_n
136136tinygo build -size short -o ./build/test.hex -target=microbit ./examples/ndir/main_ndir.go
137137tinygo build -size short -o ./build/test.hex -target=arduino-nano33 ./examples/ndir/main_ndir.go
138138tinygo build -size short -o ./build/test.uf2 -target=pico ./examples/mpu9150/main.go
139+ tinygo build -size short -o ./build/test.hex -target=macropad-rp2040 ./examples/sh1106/macropad_spi
You can’t perform that action at this time.
0 commit comments