Unified SPI library (without STM SPL), small improvements and fixes