Platform abstraction layer for microcontrollers