Digital Entity

group DigitalEntity

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.

void digital_getConfiguration(unsigned int *id, struct Result *result, int digitalNum)

Get the digital configuration.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR and the current configuration or a non zero Error code.

  • digitalNum: Index of the Digital Entity.

void digital_setConfiguration(unsigned int *id, struct Result *result, int digitalNum, int configuration)

Set the digital configuration to one of the available 5 states. Note: Some configurations are only supported on specific pins.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR or a non zero Error code.

  • digitalNum: Index of the Digital Entity.

  • configuration: Configuration to be set. Configurations:

    • Digital Input: digitalConfigurationInput = 0

    • Digital Output: digitalConfigurationOutput = 1

    • RCServo Input: digitalConfigurationRCServoInput = 2

    • RCServo Output: digitalConfigurationRCServoOutput = 3

    • Signal Input: TODO

    • Signal Output: TODO

    • High Z State: digitalConfigurationHiZ = 4

    • Digital Input: digitalConfigurationInputPullUp = 0

    • Digital Input: digitalConfigurationInputNoPull = 4

    • Digital Input: digitalConfigurationInputPullDown = 5

void digital_getState(unsigned int *id, struct Result *result, int digitalNum)

Get the state.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR and the current state or a non zero Error code.

  • digitalNum: Index of the Digital Entity.

void digital_setState(unsigned int *id, struct Result *result, int digitalNum, int state)

Set the logical state. Note: Some configurations are only supported on specific pins.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR or a non zero Error code.

  • digitalNum: Index of the Digital Entity.

  • state: State to be set.

void digital_getStateAll(unsigned int *id, struct Result *result)

Gets the logical state of all available digitals in a bit mapped representation. Number of digitals varies across BrainStem modules. Refer to the datasheet for the capabilities of your module.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR and the current state of the entire digital entity or a non zero Error code.

void digital_setStateAll(unsigned int *id, struct Result *result, int state)

Sets the logical state of all available digitals based on the bit mapping. Number of digitals varies across BrainStem modules. Refer to the datasheet for the capabilities of your module.

Parameters
  • id: The id assigned by the create stem vi.

  • result: object, containing NO_ERROR or a non zero Error code.

  • state: State to be set for all Digital Entities