BrainStem Entities¶
How does one describe the capabilities of an embedded system? Essentially this is the question that BrainStem entities answer. BrainStem modules are capable of I/O in the form of digitals, analogs, I2C, serial UARTs and other specialized interfaces. This section details how entities are referenced, and then describes the core Entities that BrainStem modules implement.
Entities¶
If you read the Reflex Language or C++ API sections of the reference, you will quickly see that Entities form the backbone of communication with BrainStem modules. They are the basic control mechanism for interacting with the BrainStem and the hardware to which it is connected. he following subsections describe the core entities that are available on most BrainStem modules. Less common and application specific entities will be described in the module’s datasheet.
Entities usually describe a class of interaction, and usually are formed by a group of individual instances. For example; the digital entity is made up of multiple digital I/Os, which can be manipulated individually. In general the following form applies to an Entity.
Module . EntityClass [ Element Index ] . operation ( parameters )
To further the digital example, the 4th digital output of a module can be set to logic high with the Reflex language via the following syntax.
stem.digital[3].setState(1);
Indices for entities always start with a zero index.
Single individual element entities like the System entity can be addressed in
the Reflex programming language without the []
syntax, however this is just
a convenience and any individual can always be addressed explicitly.
// Explicit reference.
stem.system[0].setLED(1);
// Implicit reference.
stem.system.setLED(1);
Entities are so fundamental that they form one of the elements of the BrainStem communication protocol. The protocol specifics are detailed in the following appendices:
- Analog Entity
- App Entity
- Clock Entity
- Digital Entity
- Equalizer Entity
- I2C Entity
- Mux Entity
- Pointer Entity
- Port Entity
- Port Enable/Disable (Get/Set)
- Power Enable/Disable (Get/Set)
- Data Enable/Disable (Get/Set)
- High Speed (HS) Data Enable/Disable (Get/Set)
- High Speed 1 (HS1) Data Enable/Disable (Get/Set)
- High Speed 2 (HS2) Data Enable/Disable (Get/Set)
- Super Speed (SS) Data Enable/Disable (Get/Set)
- Super Speed 1 (SS1) Data Enable/Disable (Get/Set)
- Super Speed 2 (SS2) Data Enable/Disable (Get/Set)
- Vconn Enable/Disable (Get/Set)
- Vconn 1 Enable/Disable (Get/Set)
- Vconn 2 Enable/Disable (Get/Set)
- CC Enable/Disable (Get/Set)
- CC 1 Enable/Disable (Get/Set)
- CC 2 Enable/Disable (Get/Set)
- Vbus Voltage/Current (Get)
- Vconn Voltage/Current (Get)
- Vbus Accumulated Power (Get/Reset)
- Vconn Accumulated Power (Get/Reset)
- Port Name (Get/Set)
- Downstream Data Speed (Get)
- Power Delivery Entity
- Connection State (Get)
- Power Data Object (Get/Set)
- Number of Power Data Objects (Get)
- Reset Power Data Objects (Set)
- Power Data Object List (Get)
- Power Data Objects Enabled (Get/Set)
- Power Data Object Enabled List (Get)
- Request Data Object (Get/Set)
- Power Role (Get/Set)
- Power Role Preferred (Get/Set)
- Cable Voltage Maximum (Get)
- Cable Current Maximum (Get)
- Cable Speed Maximum (Get)
- Cable Type (Get)
- Cable Orientation (Get)
- Request (Set)
- Request Status (Get)
- Flag Mode (Get/Set)
- Rail Entity
- RCServo Entity
- Relay Entity
- Signal Entity
- Store Entity
- System Entity
- System save
- System reset (Set)
- User LED
- LED Brightness (Get/Set)
- Boot Slot (Get/Set)
- Input Voltage (Get)
- Serial Number (Get)
- BrainStem Model (Get)
- Hardware Version (Get)
- Version (Get)
- Module Address (Get)
- Module Base Address (Get)
- Module Software Offset (Set/Get)
- Module Hardware Offset (Get)
- Router Address (Get/Set)
- HeartBeat Interval (Get/Set)
- System Name (Get/Set)
- Temperature Entity
- Timer Entity
- UART Entity
- USB Entity
- Port Enable/Disable (Set)
- Data Enable/Disable (Set)
- High Speed Data Enable/Disable (Set)
- Super Speed Data Enable/Disable (Set)
- Power Enable/Disable (Set)
- port Voltage/Current (Get)
- Hub Mode (Get/Set)
- Hub State (Get)
- Hub Error Status (Get)
- Clear Port Error Status (Set)
- Upstream Mode (Get/Set)
- Upstream State (Get)
- Enumeration Delay (Get/Set)
- Upstream Boost Mode (Get/Set)
- Down Stream Boost Mode (Get/Set)
- Port Current Limit (Get/Set)
- Port Mode setting (Get/Set)
- Port State (Get)
- Port Error (Get)
- System Temperature (Get)
- Connect Mode setting (Get/Set)
- CC1/CC2 Enable/Disable setting (Get/Set)
- CC1/CC2 Current (Get)
- CC1/CC2 Voltage (Get)
- SBU Enable/Disable setting (Get/Set)
- Cable Flip (Get/Set)
- USB System Entity
- Upstream Connection (Get/Set)
- Upstream Connection HighSpeed (Get/Set)
- Upstream Connection SuperSpeed (Get/Set)
- Enumeration Delay (Get/Set)
- Enabled List (Get/Set)
- Mode List (Get/Set)
- State List (Get)
- Power Behavior (Get/Set)
- Power Behavior Config (Get/Set)
- Data Role Behavior (Get/Set)
- Data Role Behavior Config (Get/Set)
- Data HighSpeed Max Datarate (Get/Set)
- Data SuperSpeed Max Datarate (Get/Set)
- Override (Get/Set)