Documentation ¶
Overview ¶
Package driverskeleton is an example that can be copy pasted to help write a new driver, either in devices/ or in host/.
You must remove all comments with FIXME. This also proves you read the instructions! :)
FIXME: Include additional information relevant to users, including configuring the device if relevant.
Datasheet ¶
FIXME: Please include a link to a datasheet as per the guideline in doc/drivers/. This helps everyone when the driver needs to be improved.
Example ¶
// FIXME: Make sure to expose a simple use case. if _, err := host.Init(); err != nil { log.Fatalf("failed to initialize periph: %v", err) } bus, err := i2creg.Open("") if err != nil { log.Fatalf("failed to open I²C: %v", err) } defer bus.Close() dev, err := New(bus) if err != nil { log.Fatalf("failed to initialize: %v", err) } fmt.Printf("%s\n", dev.Read())
Output:
Index ¶
Examples ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
Click to show internal directories.
Click to hide internal directories.