eblot / pyspiflash

SPI data flash device drivers (pure Python)
MIT License
39 stars 30 forks source link

Add a cleanup method for SpiController #10

Open aseemjakhar opened 6 years ago

aseemjakhar commented 6 years ago

First of all thank you for publishing pyspiflash. I'm using it for my project https://gitlab.com/expliot_framework/expliot

I was not able to find a cleanup method in serialflash.py for the SpiController. If there is already one, it would help of you can point me to the code. My program will run continuously and needs to close the ftdi interface after each operation. Right now I'm doing it in my code: def close(device): if device: device._spi._controller.terminate() It would be nice to have a clean way to do it instead of using "_members" directly. If you want I can send a merge request with similar code as above in SerialFlashManager or preferably _SpiFlashDevice.