Automated Code Generation and Validation for Software Components of Microcontrollers