1
0
Fork 0
mirror of https://github.com/kidoman/embd synced 2025-07-03 03:47:33 +02:00

added documentation

This commit is contained in:
Karan Misra 2014-03-23 07:21:22 +05:30
parent 3f88b67361
commit a35692aabb
6 changed files with 57 additions and 0 deletions

View file

@ -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")