Python API
Loading...
Searching...
No Matches
plux.BITalinoDev Class Reference

Base class for PLUX BITalino devices. More...

Inheritance diagram for plux.BITalinoDev:
plux.SignalsDev plux.BaseDev

Classes

class  State
 Current device state returned by BITalinoDev::getState() More...
 

Public Member Functions

 __init__ (self, path)
 Connects to a PLUX device.
 
 __init__ (self, baseDev)
 Promotes a BaseDev instance to BITalinoDev.
 
 setDOut (self, output)
 Assigns the digital outputs states.
 
 setBatThreshold (self, threshold)
 Sets the battery voltage threshold for the low-battery LED.
 
 setPWM (self, value)
 Assigns the analog (PWM) output value (BITalino 2 only).
 
 getState (self)
 Returns current device state (BITalino 2 only) as a State object.
 
- Public Member Functions inherited from plux.SignalsDev
 getSensors (self)
 Returns information about attached sensors and internal sensors.
 
 start (self, baseFreq, sources)
 Starts a real-time acquisition session.
 
 start (self, freq, portMask, nBits)
 Starts a real-time acquisition session.
 
 start (self, freq, ports, nBits)
 Starts a real-time acquisition session.
 
 stop (self)
 Stops a real-time acquisition session.
 
 getNumChannels (self)
 Returns the total number of acquisition channels.
 
 onRawFrame (self, nSeq, data)
 Raw frames callback.
 
- Public Member Functions inherited from plux.BaseDev
 getProperties (self)
 Returns the device properties.
 
 setParameter (self, port, index, data)
 Sets a system or sensor parameter value.
 
 getBattery (self)
 Returns a float number with the remaining battery charge as a percentage of full capacity.
 
 setTimeout (self, timeout=-1)
 Sets the receiving timeout value for loop().
 
 loop (self)
 Runs the device message loop.
 
 interrupt (self, param=None)
 Sends an interrupt signal to loop().
 
 onEvent (self, event)
 Event callback.
 
 onTimeout (self)
 Timeout callback.
 
 onInterrupt (self, param)
 Interrupt signal callback.
 
 close ()
 Disconnects from the device.
 

Additional Inherited Members

- Static Public Member Functions inherited from plux.BaseDev
 findDevices (domain='')
 Finds PLUX devices within the given domain.
 

Detailed Description

Base class for PLUX BITalino devices.

Constructor & Destructor Documentation

◆ __init__() [1/2]

plux.BITalinoDev.__init__ (   self,
  path 
)

Connects to a PLUX device.

Parameters
pathA string with the path to the PLUX device. It has the same meaning as in BaseDev.__init__().

Reimplemented from plux.SignalsDev.

◆ __init__() [2/2]

plux.BITalinoDev.__init__ (   self,
  baseDev 
)

Promotes a BaseDev instance to BITalinoDev.

Parameters
baseDevThe BaseDev instance to be promoted. If promotion is successful, baseDev is no longer valid.

Reimplemented from plux.SignalsDev.

Member Function Documentation

◆ setDOut()

plux.BITalinoDev.setDOut (   self,
  output 
)

Assigns the digital outputs states.

Parameters
outputSequence of booleans to assign to digital outputs, starting at first output (O1). On each sequence element, False sets the output to low level and True sets the output to high level. The sequence must contain exactly 4 elements for original BITalino (4 digital outputs) or exactly 2 elements for BITalino 2 (2 digital outputs).
Remarks
This method must be called only during an acquisition on original BITalino. On BITalino 2 there is no restriction.

Reimplemented from plux.SignalsDev.

◆ setBatThreshold()

plux.BITalinoDev.setBatThreshold (   self,
  threshold 
)

Sets the battery voltage threshold for the low-battery LED.

Parameters
thresholdBattery voltage threshold as an integer.
Parameter value Voltage Threshold
0 3.4 V
... ...
63 3.8 V
Remarks
This method cannot be called during an acquisition.

◆ setPWM()

plux.BITalinoDev.setPWM (   self,
  value 
)

Assigns the analog (PWM) output value (BITalino 2 only).

Parameters
valueAnalog output value to set (0...255) as an integer. The analog output voltage is given by: V (in Volts) = 3.3 * (value+1)/256

◆ getState()

plux.BITalinoDev.getState (   self)

Returns current device state (BITalino 2 only) as a State object.

Remarks
This method cannot be called during an acquisition.