mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-21 23:19:00 +00:00
move netdev and netlink into their own packages and out of drivers
This moves the netdev/netlink namespace out of drivers and into their own packages. Also, defines netdev and netlink as L3/L4 and L2 OSI layers, respectively. Move some L3 functionality from netlink to netdev (GetIPAddr). For netlink, add ConnectParams for NetConnect to pass in L2 connection parameters (ssid, pass, auth_type, etc). Also adds connection mode (STA, AP, etc). For netlink, add SendEth and RecvEthFunc funcs to handle L2 send/recv of Ethernet pkts.
This commit is contained in:
@@ -0,0 +1,29 @@
|
||||
//go:build wioterminal
|
||||
|
||||
package probe
|
||||
|
||||
import (
|
||||
"machine"
|
||||
|
||||
"tinygo.org/x/drivers/netdev"
|
||||
"tinygo.org/x/drivers/netlink"
|
||||
"tinygo.org/x/drivers/rtl8720dn"
|
||||
)
|
||||
|
||||
func Probe() (netlink.Netlinker, netdev.Netdever) {
|
||||
|
||||
cfg := rtl8720dn.Config{
|
||||
// Device
|
||||
En: machine.RTL8720D_CHIP_PU,
|
||||
// UART
|
||||
Uart: machine.UART3,
|
||||
Tx: machine.PB24,
|
||||
Rx: machine.PC24,
|
||||
Baudrate: 614400,
|
||||
}
|
||||
|
||||
rtl := rtl8720dn.New(&cfg)
|
||||
netdev.UseNetdev(rtl)
|
||||
|
||||
return rtl, rtl
|
||||
}
|
||||
Reference in New Issue
Block a user