peripherals

package
v0.30.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2024 License: GPL-3.0 Imports: 3 Imported by: 0

Documentation

Overview

Package peripherals implements the optional modules that can make up the ARM processor. For example: timers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type RNG

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

RNG implements the RNG found in STM32 packages.

The implementation is just a sketch of the real RNG unit but for our purposes it's probably okay. It basically returns a random 32bit number whenever the data register is read

func NewRNG

func NewRNG(mmap architecture.Map) RNG

func (*RNG) Read

func (r *RNG) Read(addr uint32) (uint32, bool)

func (*RNG) Reset

func (r *RNG) Reset()

func (*RNG) Write

func (r *RNG) Write(addr uint32, val uint32) bool

type Timer

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

Timer implements a simple timer as used in the LCP2000.

func NewTimer

func NewTimer(mmap architecture.Map) Timer

func (*Timer) Read

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

func (*Timer) Reset

func (t *Timer) Reset()

func (*Timer) Step

func (t *Timer) Step(cycles uint32)

stepping of timer assumes an APB divider value of one.

func (*Timer) Write

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

type Timer2

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

Timer2 implements the TIM2 timer found in STM32 processors.

func NewTimer2

func NewTimer2(mmap architecture.Map) Timer2

func (*Timer2) Read

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

func (*Timer2) Reset

func (t *Timer2) Reset()

func (*Timer2) ResolveDeferredCycles added in v0.25.0

func (t *Timer2) ResolveDeferredCycles()

ResolveDeferredCycles makes sure that the TIM2 registers are updated. Under normal operation the resolve function is called automatically when the TIM2CNT value is required. But it should also be called when the emulation ends (either naturally or as a result of a breakpoint etc.) so that debugging information is accurate.

func (*Timer2) Step

func (t *Timer2) Step(cycles uint32)

Step ticks TIM2 by the specified number of cycles. In reality the cycles are deferred until ResolveDeferredCycles().

func (*Timer2) Write

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

Jump to

Keyboard shortcuts

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