mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-06 07:53:41 +00:00
3ceb688663
Signed-off-by: deadprogram <ron@hybridgroup.com>
29 lines
488 B
Go
29 lines
488 B
Go
//go:build espat
|
|
// +build espat
|
|
|
|
package main
|
|
|
|
import (
|
|
"machine"
|
|
"tinygo.org/x/drivers/espat"
|
|
)
|
|
|
|
// these are the default pins for the Arduino Nano33 IoT.
|
|
// change these to connect to a different UART or pins for the ESP8266/ESP32
|
|
var (
|
|
uart = machine.UART1
|
|
tx = machine.PA22
|
|
rx = machine.PA23
|
|
|
|
adaptor *espat.Device
|
|
)
|
|
|
|
func initAdaptor() *espat.Device {
|
|
uart.Configure(machine.UARTConfig{TX: tx, RX: rx})
|
|
|
|
adaptor = espat.New(uart)
|
|
adaptor.Configure()
|
|
|
|
return adaptor
|
|
}
|