SaturnRingLibrary 0.7
SGL wrapper
 
Loading...
Searching...
No Matches
SRL::Input::PeripheralGeneric Struct Reference

Detailed Description

Generic peripheral base.

#include <srl_input.hpp>

Inheritance diagram for SRL::Input::PeripheralGeneric:
SRL::Input::Digital SRL::Input::Gun SRL::Input::Pointer SRL::Input::Analog

Public Member Functions

PeripheralFamily GetFamily ()
 Gets connected peripheral type family.
 
PeripheralType GetType ()
 Gets connected peripheral type.
 
virtual bool IsConnected ()
 Indicates whether peripheral is connected or not.
 

Public Attributes

uint8_t Port = 0
 Port number peripheral is connected to.
 

Protected Member Functions

 PeripheralGeneric (uint8_t port)
 Generic peripheral.
 
PerDigital * GetCurrentFrameState ()
 Get state of the peripheral in the current frame.
 
PerDigital * GetPreviousFrameState ()
 Get state of the peripheral in the previous frame.
 

Constructor & Destructor Documentation

◆ PeripheralGeneric()

SRL::Input::PeripheralGeneric::PeripheralGeneric ( uint8_t port)
inlineprotected

Generic peripheral.

Parameters
portPeripheral port

Member Function Documentation

◆ GetCurrentFrameState()

PerDigital * SRL::Input::PeripheralGeneric::GetCurrentFrameState ( )
inlineprotected

Get state of the peripheral in the current frame.

Returns
PerDigital* Peripheral data

◆ GetFamily()

PeripheralFamily SRL::Input::PeripheralGeneric::GetFamily ( )
inline

Gets connected peripheral type family.

Returns
Peripheral type family

◆ GetPreviousFrameState()

PerDigital * SRL::Input::PeripheralGeneric::GetPreviousFrameState ( )
inlineprotected

Get state of the peripheral in the previous frame.

Returns
PerDigital* Peripheral data

◆ GetType()

PeripheralType SRL::Input::PeripheralGeneric::GetType ( )
inline

Gets connected peripheral type.

Returns
Peripheral type

◆ IsConnected()

virtual bool SRL::Input::PeripheralGeneric::IsConnected ( )
inlinevirtual

Indicates whether peripheral is connected or not.

Returns
true if connected

Reimplemented in SRL::Input::Pointer, SRL::Input::Gun, SRL::Input::Digital, and SRL::Input::Analog.

Member Data Documentation

◆ Port

uint8_t SRL::Input::PeripheralGeneric::Port = 0

Port number peripheral is connected to.

Note
valid number is 0 to 11, see SRL::Input::MaxPeripherals