O'Reilly logo
  • Alexander Jaworowski thinks this is interesting:

void main(void){
  IOSetDir(LED_PORT, LED_PIN, OUTPUT);
  while (1) { // spin forever
    IOToggle(LED_PORT, LED_PIN);
    DelayMs(DELAY_TIME);
  }
}

From

Cover of Making Embedded Systems

Note

This is a very simple case. Its great to have vendor independent setup. However, in most cases you need to provide a lot of addresses in order to setup your periferal. Even for a simple output you might need to provide registers for pullups, negative logic, interupts, etc... How do you do that in an effeicient and modular way?