Skip to content
rseetham edited this page Jul 12, 2014 · 2 revisions

ADT7310 is a library for PyBBIO to interface with ADT7310 Temperature sensor from the Beaglebone Black's SPI pins.
This library can be used to read 13 bit temperature data, set high, low and critical temperature limits and to generate interrupts for the ADT7310 temperature sensor.
Datasheet is available here


API

ADT7310(spi_bus,cs)

Creates an instance of the ADT7310 class to control the ADT7120 on the given spi_bus and chip select determined by cs.
spi_bus can take values 0 and 1.
cs also takes a value of 0 and 1.
NOTE : SPI1 cannot be used without disabling the HDMI.

ADT7310.close()

Removes alarms if set and closes the SPI connection.

ADT7310.reset()

Resets the sensor to default values.

ADT7310.getTemp()

Returns the 13-bit temperature value in Celsius.

ADT7310.setHighTemp(temp)

Sets the High Temperature above which the Interrupt pin will activate.

ADT7310.setLowTemp(temp)

Sets the Low Temperature, based on temp, below which the Interrupt pin will activate.

ADT7310.setHystTemp(temp)

Sets the Hystersis Temperature, based on temp, below which determines the tolerance.
Must be between 0 and 15 C

ADT7310.setCriticalTemp(temp)

Sets the Critical Temperature above which the CT pin will activate.

ADT7310.setAlarm(alarm_pin , callback, (optional)return_callback)

Sets the alarm_pin to an interrupt pin and calls callback() when interrupt occurs as required.
return_callback is called when the temperature falls back below threshold-hysteresis

ADT7310.setCriticalAlarm(alarm_pin , callback, (optional)return_callback)

Sets the critical_pin to be an interrupt and calls callback() when over-temperature event occurs as required.
return_callback() is optionally called when the temperature falls back below threshold-hysteresis.

ADT7310.read(reg)

Returns the value in the register specified by reg.

ADT7310.removeAlarm()

Removes alarm on interrupt pin.

ADT7310.removeCriticalAlarm()

Removes critical alarm on CT pin.