Documentation
¶
Index ¶
- Constants
- type Bit
- func (b Bit) Clear()
- func (b Bit) ClearPending()
- func (b Bit) ConnectMux()
- func (b Bit) DirOut() bool
- func (b Bit) IntConf() int
- func (b Bit) IntPending() bool
- func (b Bit) IsValid() bool
- func (b Bit) Load() int
- func (b Bit) LoadOut() int
- func (b Bit) Mask() uint32
- func (b Bit) MuxConnected() bool
- func (b Bit) Num() int
- func (b Bit) Port() *Port
- func (b Bit) Set()
- func (b Bit) SetDirOut(out bool)
- func (b Bit) SetIntConf(cfg int)
- func (b Bit) Store(val int)
- func (b Bit) Toggle()
- type Port
- type Shared
Constants ¶
const ( IntLow = 0 // interrupt is low-level sensitive IntHigh = 1 // interrupt is high-level sensitive IntRising = 2 // interrupt is rising-edge sensitive IntFalling = 3 // interrupt is falling-edge sensitive )
Interrupt configuration constants
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bit ¶
type Bit struct {
// contains filtered or unexported fields
}
Bit represents a single bit in a GPIO port.
func (Bit) Clear ¶
func (b Bit) Clear()
Clear sets the output value of the bit to 0 in one atomic operation.
func (Bit) ClearPending ¶
func (b Bit) ClearPending()
ClearPending clears the pending state of the interrupt coresponding to b.
func (Bit) IntPending ¶
IntPending reports whether the interrupt coresponding to b is pending.
func (Bit) Load ¶
Samples the value of the connected pin (also in output mode if AltFunc.SION is set).
func (Bit) LoadOut ¶
LoadOut returns the bit value. In output mode it is the value stored in DR register. In input mode it works like Load.
func (Bit) MuxConnected ¶
ConnectMux reports wheter the bit is connected to IOMUX.
func (Bit) Set ¶
func (b Bit) Set()
Set sets the output value of the bit to 1 in one atomic operation.
func (Bit) SetIntConf ¶
SetIntConf sets the interrupt configuration for bit.
type Port ¶
type Port struct { DR Shared // Data register. Its bits are reflected on the output pins. DirOut Shared // Sets the connected pins to the output mode. Sample mmio.R32[uint32] // Samples input pins (also output pins if AltFunc.SION set) IntCfg [2]Shared // Interrupt configuration (2 bits for one input) IntEna Shared // Enables connected pins as an interrupt source. Pending Shared // Interrupt pending register. Write to clear. EdgeSel Shared // Configures the edge detector (subset of IntCfg) SetDR mmio.R32[uint32] // Use to set bits in data register. ClearDR mmio.R32[uint32] // Use to clear bits in data register. ToggleDR mmio.R32[uint32] // Use to toggle bits in data register. // contains filtered or unexported fields }
func (*Port) ConnectMux ¶
ConnectMux connects the bits specified in mask to the IOMUX. All bits in port 5 are always connected. In case of the following ports the connection is mutually exclusive: 1 and 6, 2 and 7, 3 and 8, 4 and 9. For example, if the bit 2 in port 3 has been connected to the IOMUX then at the same time the bit 2 in port 8 has been disconnected.
func (*Port) EnableClock ¶
EnableClock enables clock for port p. lp determines whether the clock remains on in low power WAIT mode.
func (*Port) MuxConnected ¶
MuxConnected returns bits connected to IOMUX.