mirror of
https://github.com/tinygo-org/drivers.git
synced 2026-08-05 07:27:49 +00:00
espnet: WIP support for on-chip WiFi on an ESP32C3
Work in progress. Does not work yet.
Some notes:
- This requires some changes to TinyGo, look at the espnet branch.
- The next step is probably defining all the functions in
g_wifi_osi_funcs (see espnet.c). Right now it hangs in
esp_wifi_init_internal, probably a NULL pointer dereference.
- This is only for the ESP32-C3. This will require some work to work
on other chips from Espressif.
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package main
|
||||
|
||||
import "tinygo.org/x/drivers/espnet"
|
||||
|
||||
func main() {
|
||||
err := espnet.WiFi.Configure(espnet.Config{})
|
||||
if err != nil {
|
||||
println("failed to configure:", err.Error())
|
||||
}
|
||||
mac, err := espnet.WiFi.AccessPointMAC()
|
||||
if err != nil {
|
||||
println("failed to read MAC address:", err.Error())
|
||||
return
|
||||
}
|
||||
print("MAC address:")
|
||||
for _, b := range mac {
|
||||
print(" ", b)
|
||||
}
|
||||
println()
|
||||
}
|
||||
Reference in New Issue
Block a user