Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
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
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.
Removes alarms if set and closes the SPI connection.
Resets the sensor to default values.
Returns the 13-bit temperature value in Celsius.
Sets the High Temperature above which the Interrupt pin will activate.
Sets the Low Temperature, based on temp, below which the Interrupt pin will activate.
Sets the Hystersis Temperature, based on temp, below which determines the tolerance.
Must be between 0 and 15 C
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.
Returns the value in the register specified by reg.
Removes alarm on interrupt pin.
Removes critical alarm on CT pin.