Qudi
Public Member Functions | Public Attributes | Static Public Attributes | List of all members
tsys01_spi.TSYS01SPI Class Reference

Measurement Systems TSYS01 temperature sensor. More...

Inheritance diagram for tsys01_spi.TSYS01SPI:
Inheritance graph
[legend]
Collaboration diagram for tsys01_spi.TSYS01SPI:
Collaboration graph
[legend]

Public Member Functions

def __init__ (self, kwargs)
 
def on_activate (self)
 Activate module.
 
def on_deactivate (self)
 Deactivate module.
 
def diag (self)
 SPI bus diagnostic output.
 
def reset (self)
 Reset the sensor chip.
 
def readRomAddr (self, addr)
 Read a 16bit rom address. More...
 
def readROM (self)
 Read the whole device ROM. More...
 
def startADC (self)
 Start the temperature sensor ADC.
 
def readADC (self)
 Read value from the ADC. More...
 
def temperatureCelsius (self, adcValue)
 Convert ADC value to degrees Celsius. More...
 
def temperatureKelvin (self, adcValue)
 Convert ADC value to Kelvin. More...
 
def getProcessValue (self)
 Read ADC and return emperature in Kelvin. More...
 
def getProcessUnit (self)
 Return Process unit, here Kelvin. More...
 
- Public Member Functions inherited from core.module.BaseMixin
def __init__ (self, manager, name, config=None, callbacks=None, kwargs)
 Initialise Base class object and set up its state machine. More...
 
def log (self)
 Returns a logger object.
 
def is_module_threaded (self)
 Returns whether the module shall be started in a thread.
 
def on_activate (self)
 Method called when module is activated. More...
 
def on_deactivate (self)
 Method called when module is deactivated. More...
 
def getStatusVariables (self)
 Return a dict of variable names and their content representing the module state for saving. More...
 
def setStatusVariables (self, variableDict)
 Give a module a dict of variable names and their content representing the module state. More...
 
def getConfiguration (self)
 Return the configration dictionary for this module. More...
 
def get_connector (self, connector_name)
 Return module connected to the given named connector. More...
 
- Public Member Functions inherited from core.module.ModuleMeta
def __new__ (cls, name, bases, attrs)
 Collect declared Connectors, ConfigOptions and StatusVars into dictionaries. More...
 

Public Attributes

 threadlock
 
 rom
 
 spi
 
- Public Attributes inherited from core.module.BaseMixin
 module_state
 
 connectors
 

Static Public Attributes

 bus = ConfigOption('bus', default=0, missing='warn')
 
 device = ConfigOption('device', default=0, missing='warn')
 
int READ_ADC = 0x00
 
int RESET = 0x1E
 
int START_ADC = 0x48
 
int READ_ROM0 = 0xA0
 

Detailed Description

Measurement Systems TSYS01 temperature sensor.

Example config for copy-paste:

temp_tsys: module 'tsys01_spi.TSYS01SPI' bus 0 device 0

Member Function Documentation

◆ getProcessUnit()

def tsys01_spi.TSYS01SPI.getProcessUnit (   self)

Return Process unit, here Kelvin.

Returns
tuple(str, str): short and text form of process unit

◆ getProcessValue()

def tsys01_spi.TSYS01SPI.getProcessValue (   self)

Read ADC and return emperature in Kelvin.

Returns
float: current temperature in Kelvin

◆ readADC()

def tsys01_spi.TSYS01SPI.readADC (   self)

Read value from the ADC.

Returns
int: raw ADC value

◆ readROM()

def tsys01_spi.TSYS01SPI.readROM (   self)

Read the whole device ROM.

Returns
list(int): contents of all 8 ROM registers

◆ readRomAddr()

def tsys01_spi.TSYS01SPI.readRomAddr (   self,
  addr 
)

Read a 16bit rom address.

Parameters
intaddr: momory address to read
Returns
int: 16bit contents of rom at address

◆ temperatureCelsius()

def tsys01_spi.TSYS01SPI.temperatureCelsius (   self,
  adcValue 
)

Convert ADC value to degrees Celsius.

Parameters
intadcValue: raw ADC value
Returns
float: temperature in degrees Celsius

◆ temperatureKelvin()

def tsys01_spi.TSYS01SPI.temperatureKelvin (   self,
  adcValue 
)

Convert ADC value to Kelvin.

Parameters
intadcValue: raw ADC value
Returns
float: temperature in Kelvin

The documentation for this class was generated from the following file: