mirror of
https://github.com/kidoman/embd
synced 2025-07-03 03:47:33 +02:00
added documentation
This commit is contained in:
parent
3f88b67361
commit
a35692aabb
6 changed files with 57 additions and 0 deletions
|
@ -1,3 +1,5 @@
|
|||
// Host descriptor data structures.
|
||||
|
||||
package embd
|
||||
|
||||
import (
|
||||
|
@ -5,16 +7,20 @@ import (
|
|||
"fmt"
|
||||
)
|
||||
|
||||
// Descriptor represents a host descriptor.
|
||||
type Descriptor struct {
|
||||
GPIODriver func() GPIODriver
|
||||
I2CDriver func() I2CDriver
|
||||
LEDDriver func() LEDDriver
|
||||
}
|
||||
|
||||
// The Describer type is a Descriptor provider.
|
||||
type Describer func(rev int) *Descriptor
|
||||
|
||||
// Describers is a global list of registered host Describers.
|
||||
var Describers = map[Host]Describer{}
|
||||
|
||||
// DescribeHost returns the detected host descriptor.
|
||||
func DescribeHost() (*Descriptor, error) {
|
||||
host, rev, err := DetectHost()
|
||||
if err != nil {
|
||||
|
@ -29,5 +35,10 @@ func DescribeHost() (*Descriptor, error) {
|
|||
return describer(rev), nil
|
||||
}
|
||||
|
||||
// ErrFeatureNotSupported is returned when the host does not support a
|
||||
// particular feature.
|
||||
var ErrFeatureNotSupported = errors.New("embd: requested feature is not supported")
|
||||
|
||||
// ErrFeatureNotImplemented is returned when a particular feature is supported
|
||||
// by the host but not implemented yet.
|
||||
var ErrFeatureNotImplemented = errors.New("embd: requested feature is not implemented")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue