C++ API Reference

Welcome to the BrainStem C++ API reference documentation. This documentation covers the c++ Acroname BrainStem library. This reference assumes that you understand the BrainStem system. If you would like to get started using BrainStem, please see the following sections of the Reference documentation.

The Getting started guide is particularly useful for learning how to use the application tools we provide to communicate with your hardware.


group aErrors

Unified list of Error codes for BrainStem module Interation.

aError.h provides a unified list of error codes. These error codes apply accross all API’s. Library functions will return one of these error codes when appropriate.


class AnalogClass : public Acroname::BrainStem::EntityClass

AnalogClass: Interface to analog entities on BrainStem modules. Analog entities may be configured as a input or output depending on hardware capabilities. Some modules are capable of providing actual voltage readings, while other simply return the raw analog-to-digital converter (ADC) output value. The resolution of the voltage or number of useful bits is also hardware dependent.

class AppClass : public Acroname::BrainStem::EntityClass

AppClass: Used to send a cmdAPP packet to the BrainStem network. These commands are used for either host-to-stem or stem-to-stem interactions. BrainStem modules can implement a reflex origin to complete an action when a cmdAPP packet is addressed to the module.

class ClockClass : public Acroname::BrainStem::EntityClass

ClockClass: Provides an interface to a real-time clock entity on a BrainStem module. The clock entity may be used to get and set the real time of the system. The clock entity has a one second resolution.


Clock time must be reset if power to the BrainStem module is lost.

class DigitalClass : public Acroname::BrainStem::EntityClass

DigitalClass: Interface to digital entities on BrainStem modules. Digital entities have the following 5 possibilities: Digital Input, Digital Output, RCServo Input, RCServo Output, and HighZ. Other capabilities may be available and not all pins support all configurations. Please see the product datasheet.

class EntityClass

EntityClass: The EntityClass is the base class for interacting with BrainStem UEI entities. All BrainStem UEI classes inherit from EntityClass. Advanced users may use EntityClass to extend BrainStem functionality specific to their needs.

Subclassed by Acroname::BrainStem::AnalogClass, Acroname::BrainStem::AppClass, Acroname::BrainStem::ClockClass, Acroname::BrainStem::DigitalClass, Acroname::BrainStem::EqualizerClass, Acroname::BrainStem::I2CClass, Acroname::BrainStem::MuxClass, Acroname::BrainStem::PointerClass, Acroname::BrainStem::PortClass, Acroname::BrainStem::PowerDeliveryClass, Acroname::BrainStem::RailClass, Acroname::BrainStem::RCServoClass, Acroname::BrainStem::RelayClass, Acroname::BrainStem::SignalClass, Acroname::BrainStem::StoreClass, Acroname::BrainStem::SystemClass, Acroname::BrainStem::TemperatureClass, Acroname::BrainStem::TimerClass, Acroname::BrainStem::UARTClass, Acroname::BrainStem::USBClass, Acroname::BrainStem::USBSystemClass

class EqualizerClass : public Acroname::BrainStem::EntityClass

EqualizerClass: Provides receiver and transmitter gain/boost/emphasis settings for some of Acroname’s products. Please see product documentation for further details.

class I2CClass : public Acroname::BrainStem::EntityClass

I2CClass: Interface the I2C buses on BrainStem modules. The class provides a way to send read and write commands to I2C devices on the entities bus.

class Link

LinkClass: The Link class provides an interface to a BrainStem link. The link is used to create interfaces to modules on a BrainStem network. The link represents a connection to the BrainStem network from a host computer. The link is always associated with a transport (e.g.: USB, Ethernet, etc.) and a link module, but there are several ways to make this association.

  1. The link can be fully specified with a transport and module serial number

  2. The link can be created by searching a transport and connecting to the first module found.

Calling connect on a link will start a connection to the module based on The link specification. Calling disconnect will disconnect the link from the the current connection.

class Module

ModuleClass: The Module class provides a generic interface to a BrainStem hardware module. The Module class is the parent class for all BrainStem modules. Each module inherits from Module and implements its hardware specific features.

Subclassed by a40PinModule, aMTMDAQ1, aMTMDAQ2, aMTMIOSerial, aMTMLoad1, aMTMPM1, aMTMRelay, aMTMStemModule, aUSBCSwitch, aUSBHub2x4, aUSBHub3c, aUSBHub3p

class MuxClass : public Acroname::BrainStem::EntityClass

MuxClass: A MUX is a multiplexer that takes one or more similar inputs (bus, connection, or signal) and allows switching to one or more outputs. An analogy would be the switchboard of a telephone operator. Calls (inputs) come in and by re-connecting the input to an output, the operator (multiplexer) can direct that input to on or more outputs.

One possible output is to not connect the input to anything which essentially disables that input’s connection to anything.

Not every MUX has multiple inputs. Some may simply be a single input that can be enabled (connected to a single output) or disabled (not connected to anything).

class PointerClass : public Acroname::BrainStem::EntityClass

PointerClass: Allows access to the reflex scratchpad from a host computer.

The Pointers access the pad which is a shared memory area on a BrainStem module. The interface allows the use of the brainstem scratchpad from the host, and provides a mechanism for allowing the host application and brainstem relexes to communicate.

The Pointer allows access to the pad in a similar manner as a file pointer accesses the underlying file. The cursor position can be set via setOffset. A read of a character short or int can be made from that cursor position. In addition the mode of the pointer can be set so that the cursor position automatically increments or set so that it does not this allows for multiple reads of the same pad value, or reads of multi-record values, via and incrementing pointer.

class PortClass : public Acroname::BrainStem::EntityClass

Port Class: The Port Entity provides software control over the most basic items related to a USB Port. This includes everything from the complete enable and disable of the entire port to the individual control of specific pins. Voltage and Current measurements are also included for devices which support the Port Entity.

class PowerDeliveryClass : public Acroname::BrainStem::EntityClass

PowerDeliveryClass: Power Delivery or PD is a power specification which allows more charging options and device behaviors within the USB interface. This Entity will allow you to directly access the vast landscape of PD.

class RailClass : public Acroname::BrainStem::EntityClass

RailClass: Provides power rail functionality on certain modules. This entity is only available on certain modules. The RailClass can be used to control power to downstream devices, I has the ability to take current and voltage measurements, and depending on hardware, may have additional modes and capabilities.

class RCServoClass : public Acroname::BrainStem::EntityClass

RCServoClass: Interface to servo entities on BrainStem modules. Servo entities are built upon the digital input/output pins and therefore can also be inputs or outputs. Please see the product datasheet on the configuration limitations.

class RelayClass : public Acroname::BrainStem::EntityClass

RelayClass: Interface to relay entities on BrainStem modules. Relay entities can be set, and the voltage read. Other capabilities may be available, please see the product datasheet.

class SignalClass : public Acroname::BrainStem::EntityClass

SignalClass: Interface to digital pins configured to produce square wave signals. This class is designed to allow for square waves at various frequencies and duty cycles. Control is defined by specifying the wave period as (T3Time) and the active portion of the cycle as (T2Time). See the entity overview section of the reference for more detail regarding the timing.

class StoreClass : public Acroname::BrainStem::EntityClass

StoreClass: The store provides a flat file system on modules that have storage capacity. Files are referred to as slots and they have simple zero-based numbers for access. Store slots can be used for generalized storage and commonly contain compiled reflex code (files ending in .map) or templates used by the system. Slots simply contain bytes with no expected organization but the code or use of the slot may impose a structure. Stores have fixed indices based on type. Not every module contains a store of each type. Consult the module datasheet for details on which specific stores are implemented, if any, and the capacities of implemented stores.

class SystemClass : public Acroname::BrainStem::EntityClass

SystemClass: The System class provides access to the core settings, configuration and system information of the BrainStem module. The class provides access to the model type, serial number and other static information as well as the ability to set boot reflexes, toggle the user LED, as well as affect module and router addresses etc. The most common brainstem example uses the system entity to blink the User LED.

class TemperatureClass : public Acroname::BrainStem::EntityClass

TemperatureClass: This entity is only available on certain modules, and provides a temperature reading in microcelsius.

class TimerClass : public Acroname::BrainStem::EntityClass

TimerClass: The Timer Class provides access to a simple scheduler. Reflex routines can be written which will be executed upon expiration of the timer entity. The timer can be set to fire only once, or to repeat at a certain interval.

class UARTClass : public Acroname::BrainStem::EntityClass

UART Class: A UART is a “Universal Asynchronous Receiver/Transmitter. Many times referred to as a COM (communication), Serial, or TTY (teletypewriter) port.

The UART Class allows the enabling and disabling of the UART data lines.

class USBClass : public Acroname::BrainStem::EntityClass

USBClass: The USB class provides methods to interact with a USB hub and USB switches. Different USB hub products have varying support; check the datasheet to understand the capabilities of each product.

class USBSystemClass : public Acroname::BrainStem::EntityClass

USBSystem Class: The USBSystem class provides high level control of the lower level Port Class.

Subclassed by aMTMIOSerial::HubClass, aUSBHub2x4::HubClass, aUSBHub3c::HubClass, aUSBHub3p::HubClass