peripherals

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2023 License: GPL-3.0, GPL-3.0 Imports: 4 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, string)

func (*RNG) Reset

func (r *RNG) Reset()

func (*RNG) Write

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

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, string)

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, string)

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, string)

func (*Timer2) Reset

func (t *Timer2) Reset()

func (*Timer2) Step

func (t *Timer2) Step(cycles uint32)

func (*Timer2) Write

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

Jump to

Keyboard shortcuts

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