ftdi_switch/ftdi_switch_test.go
2023-08-20 08:12:19 +02:00

40 lines
602 B
Go

package ftdi_switch
import (
"testing"
"gotest.tools/v3/assert"
)
const (
ID_VENDOR int = 0x0403
ID_PRODUCT int = 0x6014
)
func TestMain(t *testing.T) {
logger.SetPrefix("ftdi_switch: ")
logger.Println("Starting")
var err error
err = Start(ID_VENDOR, ID_PRODUCT, 0)
assert.NilError(t, err)
err = Write_bit(3, true)
assert.NilError(t, err)
err = Write_bit(5, true)
assert.NilError(t, err)
err = Write_bit(6, true)
assert.NilError(t, err)
err = Write_bit(7, true)
assert.NilError(t, err)
err = Write_byte(0)
assert.NilError(t, err)
err = Stop()
assert.NilError(t, err)
}