Define USB protocol for the flash tool
Define basic flash-specific functions
Tidy up syntax
Implement flash functions using SPI lib
Fix minor compilation warnings