tinygo-org / drivers

TinyGo drivers for sensors, displays, wireless adaptors, and other devices that use I2C, SPI, GPIO, ADC, and UART interfaces.
https://tinygo.org
BSD 3-Clause "New" or "Revised" License
587 stars 182 forks source link

Netdev2 #523

Closed scottfeldman closed 1 year ago

scottfeldman commented 1 year ago

This PR adds a network device driver model called netdev. There is a companion PR for TinyGo to update the "net" package here #https://github.com/tinygo-org/tinygo/pull/3452. This PR is for the netdev interface definitions, netdev drivers (wifinina, rtl8720dn, espat) and examples.

See netdev documentation here: netdev/README.md.

Testing results are here.

Espat driver is ported to netdev but untested. I'm waiting on some hardware (on order) to test. I didn't want to hold up the PR for espat; will submit updates when I get the hardware.

Thanks to the TinyGo dev community with all the help and suggestions.

scottfeldman commented 1 year ago

Hmmm...when I run "make test" locally, it passes. When the build runs it, it fails because of this in netdev/netdev.go:

//go:linkname Use net.useNetdev func Use(netdev Netdever)

Not sure how to fix this, or work around it.

scottfeldman commented 1 year ago

Smoke tests are failing because net/netdev is not available in the test version of tinygo.

scottfeldman commented 1 year ago

Build is broken due to dependency with tinygo repo: new constants were added to src/syscall.

scottfeldman commented 1 year ago

I screwed up the git rebase and messed up my repo tree so closing this PR and replacing with https://github.com/tinygo-org/drivers/pull/537.