bit

package
v0.0.0-...-60bc869 Latest Latest
Warning

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

Go to latest
Published: May 21, 2023 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Clear

func Clear(b uint8, pos uint8) uint8

Clear clear bit at pos of b.

func Hi

func Hi(n uint16) uint8

Hi returns high 8 bits of uint16

func IsSet

func IsSet(b uint8, pos uint8) bool

IsSet returns boolean if bit = 1 otherwise 0

func Joinu8

func Joinu8(hi uint8, lo uint8) uint16

Joinu8 joins two uint8 into uint16

func Lo

func Lo(n uint16) uint8

Lo returns low 8 bits of uint16

func Read

func Read(b uint8, pos uint8) uint8

Read returns state of bit at pos of b.

func RotateLeft

func RotateLeft(b uint8, pos uint8) uint8

RotateLeft rotates bits to the left by pos.

func RotateRight

func RotateRight(b uint8, pos uint8) uint8

RotateRight rotates bits to the right by pos.

func Set

func Set(b uint8, pos uint8) uint8

Set sets bit at pos of b.

func SwapNibbleU16

func SwapNibbleU16(n uint16) uint16

SwapNibbleU16 swaps low and hi nibbles of uint16.

func SwapNibbleU8

func SwapNibbleU8(b uint8) uint8

SwapNibbleU8 swaps low and hi nibbles of uint8.

func Toggle

func Toggle(b uint8, pos uint8, on bool) uint8

Toggle set or clear bit at pos of b.

Types

This section is empty.

Jump to

Keyboard shortcuts

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