2020-01-17 12:16:14 -07:00
|
|
|
#!/usr/bin/env python3
|
2020-05-27 21:00:14 -06:00
|
|
|
# pylint: skip-file
|
|
|
|
|
2020-01-17 12:16:14 -07:00
|
|
|
import time
|
|
|
|
from smbus2 import SMBus
|
|
|
|
|
|
|
|
def setup_leon_fan():
|
|
|
|
bus = SMBus(7, force=True)
|
|
|
|
|
|
|
|
# http://www.ti.com/lit/ds/symlink/tusb320.pdf
|
|
|
|
for i in [0,1,2,3]:
|
|
|
|
print("FAN SPEED", i)
|
|
|
|
if i == 0:
|
2020-05-27 21:33:05 -06:00
|
|
|
bus.write_i2c_block_data(0x67, 0xa, [0])
|
2020-01-17 12:16:14 -07:00
|
|
|
else:
|
2020-05-27 21:33:05 -06:00
|
|
|
bus.write_i2c_block_data(0x67, 0xa, [0x20])
|
2020-05-30 21:14:58 -06:00
|
|
|
bus.write_i2c_block_data(0x67, 0x8, [(i - 1) << 6])
|
2020-01-17 12:16:14 -07:00
|
|
|
time.sleep(1)
|
|
|
|
|
|
|
|
bus.close()
|
|
|
|
|
|
|
|
setup_leon_fan()
|