bm13xx

package module
v0.0.0-...-82adfe1 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2023 License: MIT Imports: 5 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DumpAsicReg

func DumpAsicReg(regAddr RegAddr, regVal uint32, debug bool)

func DumpCoreReg

func DumpCoreReg(regID CoreRegID, regVal uint16, debug bool)

Types

type Asic

type Asic struct {
	Regs     map[RegAddr]uint32
	CoreRegs map[CoreRegID]uint16
}

func (Asic) Addr

func (a Asic) Addr() byte

func (Asic) CoreNum

func (a Asic) CoreNum() byte

func (Asic) PllFreq

func (a Asic) PllFreq(pll int, clki uint32) (uint32, error)

type Chain

type Chain struct {
	Asics []Asic
	// contains filtered or unexported fields
}

func NewChain

func NewChain(port io.ReadWriter, is139x bool, clk uint32) *Chain

func (*Chain) DumpChipRegiters

func (c *Chain) DumpChipRegiters(chipIndex int, debug bool) error

func (*Chain) GetResponse

func (c *Chain) GetResponse() (uint32, byte, byte, error)

func (*Chain) Inactive

func (c *Chain) Inactive() error

func (*Chain) Init

func (c *Chain) Init(increment byte) (int, error)

func (*Chain) ReadAllCoreRegisters

func (c *Chain) ReadAllCoreRegisters(chipAddr byte, coreID uint16) error

func (*Chain) ReadAllRegisters

func (c *Chain) ReadAllRegisters(chipIndex int) error

func (*Chain) ReadCoreRegister

func (c *Chain) ReadCoreRegister(chipAddr byte, coreID uint16, coreRegID CoreRegID) (uint16, error)

func (*Chain) ReadRegister

func (c *Chain) ReadRegister(all bool, chipAddr byte, regAddr RegAddr) error

func (*Chain) ReadUnknownRegisters

func (c *Chain) ReadUnknownRegisters(chipIndex int) error

func (*Chain) SendJob

func (c *Chain) SendJob(jobID byte, startingNonce uint32, nBits uint32, nTime uint32, merkelRoot uint32, midstates []Midstate) error

func (*Chain) SetBaudrate

func (c *Chain) SetBaudrate(baud uint32) error

func (*Chain) SetChipAddr

func (c *Chain) SetChipAddr(chipAddr byte) error

func (*Chain) WriteRegister

func (c *Chain) WriteRegister(all bool, chipAddr byte, regAddr RegAddr, regVal uint32) error

type CoreRegID

type CoreRegID byte
const (
	ClockDelayCtrl     CoreRegID = 0
	ProcessMonitorCtrl CoreRegID = 1
	ProcessMonitorData CoreRegID = 2
	CoreError          CoreRegID = 3
	CoreEnable         CoreRegID = 4
	HashClockCtrl      CoreRegID = 5
	HashClockCounter   CoreRegID = 6
	SweepClockCtrl     CoreRegID = 7
)

type Midstate

type Midstate [32]byte

type Nonce

type Nonce uint32

func (Nonce) Chip

func (n Nonce) Chip() byte

Every nonce returned by chip (except those sent by opencore) encodes address of the chip and core that computed it, because of the way they divide the search space.

func (Nonce) Core

func (n Nonce) Core() byte

type RegAddr

type RegAddr byte
const (
	ChipAddress                   RegAddr = 0x00
	HashRate                      RegAddr = 0x04
	PLL0Parameter                 RegAddr = 0x08
	ChipNonceOffset               RegAddr = 0x0C
	HashCountingNumber            RegAddr = 0x10
	TicketMask                    RegAddr = 0x14
	MiscControl                   RegAddr = 0x18
	I2CControl                    RegAddr = 0x1C
	OrderedClockEnable            RegAddr = 0x20
	FastUARTConfiguration         RegAddr = 0x28
	UARTRelay                     RegAddr = 0x2C
	TicketMask2                   RegAddr = 0x38
	CoreRegisterControl           RegAddr = 0x3C
	CoreRegisterValue             RegAddr = 0x40
	ExternalTemperatureSensorRead RegAddr = 0x44
	ErrorFlag                     RegAddr = 0x48
	NonceErrorCounter             RegAddr = 0x4C
	NonceOverflowCounter          RegAddr = 0x50
	AnalogMuxControl              RegAddr = 0x54
	IoDriverStrenghtConfiguration RegAddr = 0x58
	TimeOut                       RegAddr = 0x5C
	PLL1Parameter                 RegAddr = 0x60
	PLL2Parameter                 RegAddr = 0x64
	PLL3Parameter                 RegAddr = 0x68
	OrderedClockMonitor           RegAddr = 0x6C
	Pll0Divider                   RegAddr = 0x70
	Pll1Divider                   RegAddr = 0x74
	Pll2Divider                   RegAddr = 0x78
	Pll3Divider                   RegAddr = 0x7C
	ClockOrderControl0            RegAddr = 0x80
	ClockOrderControl1            RegAddr = 0x84
	ClockOrderStatus              RegAddr = 0x8C
	FrequencySweepControl1        RegAddr = 0x90
	GoldenNonceForSweepReturn     RegAddr = 0x94
	ReturnedGroupPatternStatus    RegAddr = 0x98
	NonceReturnedTimeout          RegAddr = 0x9C
	ReturnedSinglePatternStatus   RegAddr = 0xA0
)

Directories

Path Synopsis
examples

Jump to

Keyboard shortcuts

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