Rail

See the Rail Entity for generic information.

class brainstem.entity.Rail(module, index)[source]

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

clearFaults()[source]

Clears the current fault state of the rail. Refer to the module datasheet for definition of the rail faults.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

getCurrent()[source]

Get the rail current.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The current in micro-amps (1 == 1e-6A).

Return type:

brainstem.result.Result

getCurrentLimit()[source]

Get the rail current limit setting. (Check product datasheet to see if this feature is available)

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The current in micro-amps (1 == 1e-6A).

Return type:

brainstem.result.Result

getCurrentSetpoint()[source]

Get the rail setpoint current. Rail current control capabilities vary between modules. Refer to the module datasheet for definition of the rail current capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The current in micro-amps (1 == 1e-6A) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setCurrent interface. Refer to the module datasheet to to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getEnable()[source]

Get the state of the external rail switch. Not all rails can be switched on and off. Refer to the module datasheet for capability specification of the rails.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuebool

true: enabled: connected to the supply rail voltage; false: disabled: disconnected from the supply rail voltage

Return type:

brainstem.result.Result

getKelvinSensingEnable()[source]

Determine whether kelvin sensing is enabled or disabled. Refer to the module datasheet for definition of the rail kelvin sensing capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuebool

Kelvin sensing is enabled or disabled.

Return type:

brainstem.result.Result

getKelvinSensingState()[source]

Determine whether kelvin sensing has been disabled by the system. Refer to the module datasheet for definition of the rail kelvin sensing capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valuebool

Kelvin sensing is enabled or disabled.

Return type:

brainstem.result.Result

getOperationalMode()[source]

Determine the current operational mode of the system. Refer to the module datasheet for definition of the rail operational mode capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned char

The current operational mode setting.

Return type:

brainstem.result.Result

getOperationalState()[source]

Determine the current operational state of the system. Refer to the module datasheet for definition of the rail operational states.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueunsigned int

The current operational state, hardware configuration, faults, and operating mode.

Return type:

brainstem.result.Result

getPower()[source]

Get the rail supply power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The power in milli-watts (1 == 1e-3W) currently supplied by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setPower interface. Refer to the module datasheet to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getPowerLimit()[source]

Get the rail power maximum limit setting. (Check product datasheet to see if this feature is available)

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The power in milli-watts (mW).

Return type:

brainstem.result.Result

getPowerSetpoint()[source]

Get the rail setpoint power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The power in milli-watts (1 == 1e-3W) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setPower interface. Refer to the module datasheet to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getResistance()[source]

Get the rail load resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The resistance in milli-ohms (1 == 1e-3Ohms) currently drawn by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setResistance interface. Refer to the module datasheet to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getResistanceSetpoint()[source]

Get the rail setpoint resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The resistance in milli-ohms (1 == 1e-3Ohms) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setResistance interface. Refer to the module datasheet to to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getTemperature()[source]

Get the rail temperature.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The measured temperature associated with the rail in micro-Celsius (1 == 1e-6˚C). The temperature may be associated with the module’s internal rail circuitry or an externally connected temperature sensors. Refer to the module datasheet for definition of the temperature measurement location and specific capabilities.

Return type:

brainstem.result.Result

getVoltage()[source]

Get the rail supply voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The voltage in micro-volts (1 == 1e-6V) currently supplied by the rail. On some modules this is a measured value so it may not exactly match what was previously set via the setVoltage interface. Refer to the module datasheet to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

getVoltageMaxLimit()[source]

Get the rail voltage maximum limit setting. (Check product datasheet to see if this feature is available)

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The voltage in micro-volts (1 == 1e-6V).

Return type:

brainstem.result.Result

getVoltageMinLimit()[source]

Get the rail voltage minimum limit setting. (Check product datasheet to see if this feature is available)

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The voltage in micro-volts (1 == 1e-6V).

Return type:

brainstem.result.Result

getVoltageSetpoint()[source]

Get the rail setpoint voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities.

Returns:

Object containing error code and returned value on success.
errorunsigned byte

An error result from the list of defined error codes

valueint

The voltage in micro-volts (1 == 1e-6V) the rail is trying to achieve. On some modules this is a measured value so it may not exactly match what was previously set via the setVoltage interface. Refer to the module datasheet to determine if this is a measured or stored value.

Return type:

brainstem.result.Result

setCurrentLimit(microamps)[source]

Set the rail current limit setting. (Check product datasheet to see if this feature is available)

Parameters:

microamps (int) – The current in micro-amps (1 == 1e-6A).

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setCurrentSetpoint(microamps)[source]

Set the rail supply current. Rail current control capabilities vary between modules. Refer to the module datasheet for definition of the rail current capabilities.

Parameters:

microamps (int) – The current in micro-amps (1 == 1e-6A) to be supply by the rail.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setEnable(enable)[source]

Set the state of the external rail switch. Not all rails can be switched on and off. Refer to the module datasheet for capability specification of the rails.

Parameters:

enable (bool) – true: enable and connect to the supply rail voltage; false: disable and disconnect from the supply rail voltage

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setKelvinSensingEnable(enable)[source]

Enable or Disable kelvin sensing on the module. Refer to the module datasheet for definition of the rail kelvin sensing capabilities.

Parameters:

enable (bool) – enable or disable kelvin sensing.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setOperationalMode(mode)[source]

Set the operational mode of the rail. Refer to the module datasheet for definition of the rail operational capabilities.

Parameters:

mode (unsigned char) – The operational mode to employ.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setPowerLimit(milliwatts)[source]

Set the rail power maximum limit setting. (Check product datasheet to see if this feature is available)

Parameters:

milliwatts (int) – The power in milli-watts (mW).

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setPowerSetpoint(milliwatts)[source]

Set the rail supply power. Rail power control capabilities vary between modules. Refer to the module datasheet for definition of the rail power capabilities.

Parameters:

milliwatts (int) – The power in milli-watts (1 == 1e-3W) to be supplied by the rail.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setResistanceSetpoint(milliohms)[source]

Set the rail load resistance. Rail resistance control capabilities vary between modules. Refer to the module datasheet for definition of the rail resistance capabilities.

Parameters:

milliohms (int) – The resistance in milli-ohms (1 == 1e-3Ohms) to be drawn by the rail.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setVoltageMaxLimit(microvolts)[source]

Set the rail voltage maximum limit setting. (Check product datasheet to see if this feature is available)

Parameters:

microvolts (int) – The voltage in micro-volts (1 == 1e-6V).

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setVoltageMinLimit(microvolts)[source]

Set the rail voltage minimum limit setting. (Check product datasheet to see if this feature is available)

Parameters:

microvolts (int) – The voltage in micro-volts (1 == 1e-6V).

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte

setVoltageSetpoint(microvolts)[source]

Set the rail supply voltage. Rail voltage control capabilities vary between modules. Refer to the module datasheet for definition of the rail voltage capabilities.

Parameters:

microvolts (int) – The voltage in micro-volts (1 == 1e-6V) to be supplied by the rail.

Returns:

An error result from the list of defined error codes in brainstem.result.Result

Return type:

unsigned byte