You can not select more than 25 topics
			Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
		
		
		
		
			
				
					22 lines
				
				456 B
			
		
		
			
		
	
	
					22 lines
				
				456 B
			| 
								 
											6 years ago
										 
									 | 
							
								#!/usr/bin/env python3
							 | 
						||
| 
								 | 
							
								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:
							 | 
						||
| 
								 | 
							
								      ret = bus.write_i2c_block_data(0x67, 0xa, [0])
							 | 
						||
| 
								 | 
							
								    else:
							 | 
						||
| 
								 | 
							
								      ret = bus.write_i2c_block_data(0x67, 0xa, [0x20])
							 | 
						||
| 
								 | 
							
								      ret = bus.write_i2c_block_data(0x67, 0x8, [(i-1)<<6])
							 | 
						||
| 
								 | 
							
								    time.sleep(1)
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								  bus.close()
							 | 
						||
| 
								 | 
							
								
							 | 
						||
| 
								 | 
							
								setup_leon_fan()
							 | 
						||
| 
								 | 
							
								
							 |