flash_write and flash_erase functions from SiLabs
Some of the interrupt routines based SiLabs code