+ while (!(PMC_SR & BV(PMC_SR_MCKRDY)) && --timeout);
+
+ /* Enable clock on PIO for inputs */
+ // TODO: move this in gpio_init() for better power management?
+#if CPU_CM3_SAM3X
+ PMC_PCER = BV(PIOA_ID) | BV(PIOB_ID) | BV(PIOC_ID)
+ | BV(PIOD_ID) | BV(PIOE_ID) | BV(PIOF_ID);
+#else
+ PMC_PCER = BV(PIOA_ID) | BV(PIOB_ID) | BV(PIOC_ID);
+#endif