plugging

package
v0.10.1 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: GPL-3.0, GPL-3.0 Imports: 0 Imported by: 0

Documentation

Overview

Package plugging conceptualises the act of plugging devices into the VCS ports. This includes the panel in addition to the various peripherals that plug into the player ports (ie. controllers, savekey, etc.)

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Monitorable

type Monitorable interface {
	AttachPlugMonitor(m PlugMonitor)
}

Moniterable implementations are capable of having a PlugMonitor attached to it. The VCS Ports themselves are monitorable but we also use this mechanism in the "auto" controller type and in the future, devices like the Quadtari will be implemented similarly.

It is expected that such implementations will call PlugMonitor.Plugged() as required. Note that PlugMonitor.Plugged() should not be called on the event of AttachPlugMonitor except in the special case of the ports.Ports type

Implementations of Monitorable should also test peripherals that are daisy-chained and call AttachPlusMonitor() as appropriate.

if a, ok := periph.daisychain.(pluggin.Monitorable); ok {
	a.AttachPlugMonitor(m)
}

type PlugMonitor

type PlugMonitor interface {
	Plugged(port PortID, description string)
}

PlugMonitor interface implementations will be notified of newly plugged peripherals.

type PortID

type PortID string

PortID differentiates the different ports in the VCS into which peripherals can be plugged.

const (
	Unplugged   PortID = "Unplugged"
	LeftPlayer  PortID = "Left"
	RightPlayer PortID = "Right"
	Panel       PortID = "Panel"
)

List of defined PortIDs.

We could potentially extend this to support a future Quadtari implementation.

Jump to

Keyboard shortcuts

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