libstp
Robotics library for Botball
Loading...
Searching...
No Matches
libstp::hal::digital::DigitalSensor Class Reference

#include <Digital.hpp>

Inheritance diagram for libstp::hal::digital::DigitalSensor:
[legend]

Public Member Functions

 DigitalSensor (int port)
 Create a digital input bound to a platform-defined port index.
virtual ~DigitalSensor ()
virtual bool read () const
 Return the current boolean state for the configured input.

Public Attributes

int port

Detailed Description

Digital input wrapper implemented by the active platform bundle.

The wrapper only owns the requested port number and shared safety-check bookkeeping. Platform drivers provide the actual I/O behavior.

read() is virtual so composite inputs (see ButtonGroup) can override the sensing logic while still being usable anywhere a DigitalSensor is.

Definition at line 19 of file Digital.hpp.

Constructor & Destructor Documentation

◆ DigitalSensor()

libstp::hal::digital::DigitalSensor::DigitalSensor ( int port)
explicit

Create a digital input bound to a platform-defined port index.

◆ ~DigitalSensor()

virtual libstp::hal::digital::DigitalSensor::~DigitalSensor ( )
virtual

Member Function Documentation

◆ read()

virtual bool libstp::hal::digital::DigitalSensor::read ( ) const
virtual

Return the current boolean state for the configured input.

Reimplemented in libstp::hal::digital::ButtonGroup.

Member Data Documentation

◆ port

int libstp::hal::digital::DigitalSensor::port

Definition at line 27 of file Digital.hpp.


The documentation for this class was generated from the following file:
  • /home/runner/work/raccoon-lib/raccoon-lib/modules/libstp-hal/include/hal/Digital.hpp