Imported code from the Smartblock BSP, removed modules that are not required