host

package
v2.2.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 30, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Overview

Package host defines the host itself.

The host is the machine where this code is running.

Subpackages contain the drivers that are loaded automatically.

Index

Examples

Constants

This section is empty.

Variables

This section is empty.

Functions

func Init

func Init() (*periph.State, error)

Init calls periph.Init() and returns it as-is.

The only difference is that by calling host.Init(), you are guaranteed to have all the drivers implemented in this library to be implicitly loaded.

Example
package main

import (
	"fmt"
	"log"

	"periph.io/x/periph/host"
)

func main() {
	// Make sure periph is initialized.
	state, err := host.Init()
	if err != nil {
		log.Fatalf("failed to initialize periph: %v", err)
	}

	// Prints the loaded driver.
	fmt.Printf("Using drivers:\n")
	for _, driver := range state.Loaded {
		fmt.Printf("- %s\n", driver)
	}

	// Prints the driver that were skipped as irrelevant on the platform.
	fmt.Printf("Drivers skipped:\n")
	for _, failure := range state.Skipped {
		fmt.Printf("- %s: %s\n", failure.D, failure.Err)
	}

	// Having drivers failing to load may not require process termination. It
	// is possible to continue to run in partial failure mode.
	fmt.Printf("Drivers failed to load:\n")
	for _, failure := range state.Failed {
		fmt.Printf("- %s: %v\n", failure.D, failure.Err)
	}

	// Use pins, buses, devices, etc.
}
Output:

Types

This section is empty.

Directories

Path Synopsis
Package allwinner exposes the GPIO functionality that is common to all AllWinner processors.
Package allwinner exposes the GPIO functionality that is common to all AllWinner processors.
allwinnersmoketest
Package allwinnersmoketest verifies that allwinner specific functionality work.
Package allwinnersmoketest verifies that allwinner specific functionality work.
Package am335x exposes functionality for the Texas Instruments Sitara AM335x processor family.
Package am335x exposes functionality for the Texas Instruments Sitara AM335x processor family.
Package bcm283x exposes the BCM283x GPIO functionality.
Package bcm283x exposes the BCM283x GPIO functionality.
bcm283xsmoketest
Package bcm283xsmoketest verifies that bcm283x specific functionality work.
Package bcm283xsmoketest verifies that bcm283x specific functionality work.
Package beagle regroups subpackages containing BeagleBoard/BeagleBone board family headers definition.
Package beagle regroups subpackages containing BeagleBoard/BeagleBone board family headers definition.
black
Package black implements headers for the BeagleBone Black and BeagleBone Black Wireless micro-computers.
Package black implements headers for the BeagleBone Black and BeagleBone Black Wireless micro-computers.
bone
Package bone implements headers J1, P8 and P9 found on many (but not all) BeagleBone micro-computer.
Package bone implements headers J1, P8 and P9 found on many (but not all) BeagleBone micro-computer.
green
Package green implements headers for the BeagleBone Green and BeagleBone Green Wireless micro-computers.
Package green implements headers for the BeagleBone Green and BeagleBone Green Wireless micro-computers.
Package chip contains header definitions for NextThing Co's C.H.I.P. board.
Package chip contains header definitions for NextThing Co's C.H.I.P. board.
chipsmoketest
Package chipsmoketest is leveraged by periph-smoketest to verify that basic CHIP specific functionality works.
Package chipsmoketest is leveraged by periph-smoketest to verify that basic CHIP specific functionality works.
Package cpu implements functions relating to the host CPU itself.
Package cpu implements functions relating to the host CPU itself.
Package distro implements common functionality to auto-detect features on the host; generally about linux distributions.
Package distro implements common functionality to auto-detect features on the host; generally about linux distributions.
Package fs provides access to the file system on the host.
Package fs provides access to the file system on the host.
Package odroidc1 contains header definitions for Hardkernel's ODROID C0, C1, and C1+ boards.
Package odroidc1 contains header definitions for Hardkernel's ODROID C0, C1, and C1+ boards.
odroidc1smoketest
Package odroidc1smoketest is leveraged by periph-smoketest to verify that basic ODROID-C1 specific functionality works.
Package odroidc1smoketest is leveraged by periph-smoketest to verify that basic ODROID-C1 specific functionality works.
Package pine64 contains Pine64 hardware logic.
Package pine64 contains Pine64 hardware logic.
Package pmem implements handling of physical memory for user space programs.
Package pmem implements handling of physical memory for user space programs.
Package rpi contains Raspberry Pi hardware logic.
Package rpi contains Raspberry Pi hardware logic.
Package sysfs implements a sane library to interact with sysfs provided hardware access.
Package sysfs implements a sane library to interact with sysfs provided hardware access.
sysfssmoketest
Package sysfssmoketest verifies that sysfs specific functionality work.
Package sysfssmoketest verifies that sysfs specific functionality work.
Package videocore interacts with the VideoCore GPU found on bcm283x.
Package videocore interacts with the VideoCore GPU found on bcm283x.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL