timer

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2013 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DIV_REGISTER  types.Word = 0xFF04
	TIMA_REGISTER            = 0xFF05
	TMA_REGISTER             = 0xFF06
	TAC_REGISTER             = 0xFF07
)
View Source
const (
	NAME = "TIMER"
)

Variables

View Source
var FrequenciesToCycles map[Frequency]int = map[Frequency]int{
	// contains filtered or unexported fields
}

Functions

This section is empty.

Types

type Counter

type Counter struct {
	Name           string
	ClockFrequency Frequency
	ClockCounter   int
	Value          byte
}

func NewCounter

func NewCounter(name string, initialFreq Frequency) *Counter

func (*Counter) Reset

func (c *Counter) Reset()

func (*Counter) SetFrequency

func (c *Counter) SetFrequency(freq Frequency)

func (*Counter) Step

func (c *Counter) Step(cycles int) bool

returns true when overflowed

func (*Counter) String

func (c *Counter) String() string

type Frequency

type Frequency string

type Timer

type Timer struct {
	// contains filtered or unexported fields
}

func NewTimer

func NewTimer() *Timer

func (*Timer) GetFrequency

func (timer *Timer) GetFrequency(freqId byte) Frequency

func (*Timer) LinkIRQHandler

func (timer *Timer) LinkIRQHandler(m components.IRQHandler)

func (*Timer) Name

func (timer *Timer) Name() string

func (*Timer) Read

func (timer *Timer) Read(Address types.Word) byte

func (*Timer) Reset

func (timer *Timer) Reset()

func (*Timer) Step

func (timer *Timer) Step(cycles int)

func (*Timer) Write

func (timer *Timer) Write(address types.Word, value byte)

Jump to

Keyboard shortcuts

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