The InputPortMM Class


The InputPortMM Class

The InputPortMM class is designed to read the state (high or low) of a GPIO pin on the Beaglebone Black via a Memory Mapped access method. The maximum read rate has been observed to be in the range of about 1.8MHz. The InputPortFS class is a similar version of this class which uses SYSFS access.


Source Code

The source code for this class is available online for download and also in browseable form.


Example Code

Example code which demonstrates the use of this class can be found on the Input Port Example page.



public class InputPortMM : PortMM, IDisposable

Provides input port functionality for a BeagleBone Black (Memory Mapped Version).


Public Constructors

public InputPortMM(GpioEnum gpioIDIn) : base(gpioIDIn)


gpioIDIn - The GPIO the port will access.


Public Methods

public override void ClosePort()

Closes the port.


public void Dispose()

Implements IDisposable. Should be called after the class is closed to release resources.


public override PortDirectionEnum PortDirection()

Gets the PortDirection

A PortDirectionEnum value. This value is always PortDirectionEnum.PORTDIR_INPUT.


public bool Read()

Gets the port value (high or low) as a boolean.

true, the GPIO pin is at a high voltage level. false - GPIO pin is at a low voltage level.


Public Properties

public GpioConfig GpioCfgObject { get; }

Gets the objects gpioCfgObject. There is no set accessor. This object is built in the constructor

The working gpioID.


public GpioEnum GpioID { get; }

Gets the objects gpioID. There is no set accessor. This value is set in the constructor

The working gpioID.