Documentation ¶
Index ¶
- type BitField
- func (b BitField) ANDMask(m BitField)
- func (b BitField) Bytes() []byte
- func (b BitField) Clear(i uint32)
- func (b BitField) ClearAll()
- func (b BitField) Flip(i uint32)
- func (b BitField) FlipAll()
- func (b BitField) GetX(index int) BitField
- func (b BitField) ORMask(m BitField)
- func (b BitField) Set(i uint32)
- func (b BitField) SetAll()
- func (b BitField) SetX(index int, v int) BitField
- func (b BitField) Size() int
- func (b BitField) Test(i uint32) bool
- func (b BitField) ToUint32() uint32
- func (b BitField) ToUint32Safe() uint32
- func (b BitField) ToUint64() uint64
- func (b BitField) ToUint64Safe() uint64
- func (b BitField) XORMask(m BitField)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BitField ¶
type BitField []byte
func NewFromUint32 ¶
NewFromUint32 returns a new BitField of 4 bytes, with n initial value
func NewFromUint64 ¶
NewFromUint64 returns a new BitField of 8 bytes, with n initial value
func (BitField) ANDMask ¶
ANDMask performs an AND operation between b and m, storing result in b. If b is smaller than m, the extra bits of m are ignored (b isn't enlarged).
func (BitField) FlipAll ¶
func (b BitField) FlipAll()
FlipAll flips all the BitField bits (1's compliment)
func (BitField) ORMask ¶
ORMask performs an OR operation between b and m, storing result in b. If b is smaller than m, the extra bits of m are ignored (b isn't enlarged).
func (BitField) SetX ¶
https://github.com/prysmaticlabs/go-bitfield
struct { USHORT Mode0 : 1; USHORT Mode1 : 1; USHORT Mode2 : 1; USHORT Reserved1 : 5; USHORT Mode0Sel : 1; USHORT Mode1Sel : 1; USHORT Mode2Sel : 1; USHORT Reserved2 : 5; } wMultiWordDMA;
func (BitField) ToUint32 ¶
ToUint32 returns the lowest 4 bytes as an uint32 NO BOUNDS CHECKING, ENSURE BitField is at least 4 bytes long
func (BitField) ToUint32Safe ¶
ToUint32Safe returns the lowest 4 bytes as an uint32
func (BitField) ToUint64 ¶
ToUint64 returns the lowest 8 bytes as an uint64 NO BOUNDS CHECKING, ENSURE BitField is at least 8 bytes long
func (BitField) ToUint64Safe ¶
ToUint64Safe returns the lowest 8 bytes as an uint64