Documentation
¶
Overview ¶
Package gpio allows to configure and controll General Purpose I/O ports and their pins.
Index ¶
- type Config
- type Pin
- func (p Pin) Clear()
- func (p Pin) Config() Config
- func (p Pin) Index() int
- func (p Pin) IsValid() bool
- func (p Pin) Load() int
- func (p Pin) LoadOut() int
- func (p Pin) Mask() Pins
- func (p Pin) Port() *Port
- func (p Pin) Sel() int8
- func (p Pin) Set()
- func (p Pin) Setup(cfg Config)
- func (p Pin) Store(val int)
- type Pins
- type Port
- func (p *Port) ClearPins(pins Pins)
- func (p *Port) Index() int
- func (p *Port) Load() Pins
- func (p *Port) LoadOut() Pins
- func (p *Port) Pin(n int) Pin
- func (p *Port) PinConfig(n int) Config
- func (p *Port) Pins(pins Pins) Pins
- func (p *Port) PinsOut(pins Pins) Pins
- func (p *Port) SetDirIn(pins Pins)
- func (p *Port) SetDirOut(pins Pins)
- func (p *Port) SetPins(pins Pins)
- func (p *Port) Setup(pins Pins, cfg Config)
- func (p *Port) SetupPin(n int, cfg Config)
- func (p *Port) Store(val Pins)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config uint32
Config is configuration word of GPIO pin.
const ( ModeIn Config = 0 // Input buffer connected, output disabled. ModeInOut Config = 1 // Input buffer connected, output enabled. ModeDiscon Config = 2 // Input buffer disconnected, output disabled. ModeOut Config = 3 // Input buffer disconnected, output enabled. PullNone Config = 0 << 2 // Disable pull-up/down resistance. PullDown Config = 1 << 2 // Enable pull-down resistance. PullUp Config = 3 << 2 // Enable pull-up resistance. DriveS0S1 Config = 0 << 8 // Standard 0, standard 1. DriveH0S1 Config = 1 << 8 // High drive 0, standard 1. DriveS0H1 Config = 2 << 8 // Standard 0, high drive 1. DriveH0H1 Config = 3 << 8 // High drive 0, high drive 1. DriveD0S1 Config = 4 << 8 // Disconnect 0, standard 1. DriveD0H1 Config = 5 << 8 // Disconnect 0, high drive 1. DriveS0D1 Config = 6 << 8 // Standard 0, disconnect 1. DriveH0D1 Config = 7 << 8 // High drive 0, disconnect 1. SenseNone Config = 0 << 16 // Sense disabled. SenseHigh Config = 2 << 16 // Sense for high level. SenseLow Config = 3 << 16 // Sense for low level. )
type Pin ¶
type Pin struct {
// contains filtered or unexported fields
}
Pin represents one phisical pin (specific pin in specific port).
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
Port represents one GPIO port.
Click to show internal directories.
Click to hide internal directories.