timer

package
v0.7.2 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2025 License: GPL-3.0 Imports: 2 Imported by: 0

Documentation

Overview

Package timer contains implementations of timer peripherals found in the various ARM CPU packages.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type T1

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

T1 implements a simple timer as used in the LPC2000.

An example of a game that uses T1 is Draconian. It uses it to test what spec the console is (NTSC, PAL, etc.)

Another good example is Andrew Davie's ARM powered Boulderdash. it also uses the timer to test for the console spec; and also to time the wipe that starts and ends the level. character movemement is also affected by the timer

func NewT1

func NewT1(mmap architecture.Map) *T1

func (*T1) Read

func (t *T1) Read(addr uint32) (uint32, bool)

Read implementes the Timer interface

func (*T1) Reset

func (t *T1) Reset()

Reset implementes the Timer interface

func (*T1) Step

func (t *T1) Step(cycles float32)

Step implementes the Timer interface

func (*T1) Write

func (t *T1) Write(addr uint32, val uint32) bool

Write implementes the Timer interface

type TIM2

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

TIM2 implements the TIM2 timer found in STM32 processors.

func NewTIM2

func NewTIM2(mmap architecture.Map) *TIM2

func (*TIM2) Read

func (t *TIM2) Read(addr uint32) (uint32, bool)

Read implementes the Timer interface

func (*TIM2) Reset

func (t *TIM2) Reset()

Reset implementes the Timer interface

func (*TIM2) Step

func (t *TIM2) Step(cycles float32)

Step implementes the Timer interface

func (*TIM2) Write

func (t *TIM2) Write(addr uint32, val uint32) bool

Write implementes the Timer interface

type Timer

type Timer interface {
	Reset()
	Step(cycles float32)
	Write(addr uint32, val uint32) bool
	Read(addr uint32) (uint32, bool)
}

Timer is an abstraction of the various types of timer found in the difference ARM CPU pacakages

Jump to

Keyboard shortcuts

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