mirror of
				https://github.com/KevinMidboe/python-gpiozero.git
				synced 2025-10-29 17:50:37 +00:00 
			
		
		
		
	This PR adds a software SPI implementation. Firstly this removes the absolute necessity for spidev (#140), which also means when it's not present things still work (effectively fixes #185), and also enables any four pins to be used for SPI devices (which don't require the hardware implementation). The software implementation is simplistic but still supports clock polarity and phase, select-high, and variable bits per word. However it doesn't allow precise speeds to be implemented because it just wibbles the clock as fast as it can (which being pure Python isn't actually that fast). Finally, because this PR involves creating a framework for "shared" devices (like SPI devices with multiple channels), it made sense to bung Energenie (#69) in as wells as this is a really simple shared device.
		
			
				
	
	
		
			28 lines
		
	
	
		
			616 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			28 lines
		
	
	
		
			616 B
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| digraph classes {
 | |
|     graph [rankdir=BT];
 | |
|     node [shape=rect, style=filled, fontname=Sans, fontsize=10];
 | |
|     edge [];
 | |
| 
 | |
|     /* Abstract classes */
 | |
|     node [color="#9ec6e0", fontcolor="#000000"]
 | |
|     Device;
 | |
|     SPIDevice;
 | |
|     AnalogInputDevice;
 | |
|     MCP3xxx;
 | |
|     MCP33xx;
 | |
| 
 | |
|     /* Concrete classes */
 | |
|     node [color="#2980b9", fontcolor="#ffffff"];
 | |
|     SPIDevice->Device;
 | |
|     AnalogInputDevice->SPIDevice;
 | |
|     MCP3xxx->AnalogInputDevice;
 | |
|     MCP33xx->MCP3xxx;
 | |
|     MCP3004->MCP3xxx;
 | |
|     MCP3008->MCP3xxx;
 | |
|     MCP3204->MCP3xxx;
 | |
|     MCP3208->MCP3xxx;
 | |
|     MCP3301->MCP33xx;
 | |
|     MCP3302->MCP33xx;
 | |
|     MCP3304->MCP33xx;
 | |
| }
 |