Documentation ¶
Index ¶
- func GillhamToAltitude(d1, d2, d4, a1, a2, a4, b1, b2, b4, c1, c2, c4 bool) (int32, error)
- func Pack16Bits(b15, b14, b13, b12, b11, b10, b9, b8, b7, b6, b5, b4, b3, b2, b1, b0 bool) uint16
- func Pack2Bytes(b1 byte, b0 byte) uint16
- func Pack3Bytes(b2 byte, b1 byte, b0 byte) uint32
- func Pack4Bytes(b3 byte, b2 byte, b1 byte, b0 byte) uint32
- func Pack8Bits(b7, b6, b5, b4, b3, b2, b1, b0 bool) byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GillhamToAltitude ¶ added in v0.6.0
GillhamToAltitude convert an altitude given in Gillham bits to an altitude in feet
func Pack16Bits ¶ added in v0.3.0
Pack16Bits packs 16 bytes in a single uint16.
Params:
- b15: the first bit (MSB)
- bn: ...
- b0: the last bit (LSB)
The bits are packed as b15 b14 ... b1 b0
Return the packed byte
func Pack2Bytes ¶
Pack2Bytes packs 2 bytes in a single uint16.
Params:
- b1: the first bit
- b0: the second bit
The two bytes are packed as b1 b1 ... b1 b1 b0 b0 ... b0 b0
Return the packed byte
func Pack3Bytes ¶
Pack3Bytes packs 3 bytes in a single uint32.
Params:
- b2: the first bit
- b1: the second bit
- b0: the third bit
The two bytes are packed as b2 b2 ... b2 b2 b1 b1 ... b1 b1 b0 b0 ... b0 b0
Return the packed byte
func Pack4Bytes ¶
Pack4Bytes packs 4 bytes in a single uint32.
Params:
- b3: the first bit
- b2: the second bit
- b1: the third bit
- b0: the fourth bit
The two bytes are packed as b3 ... b3 b2 ... b2 b1 ... b1 b0 ... b0
Return the packed byte
Types ¶
This section is empty.