/** * Resets the max3412e. Sets the chip reset bit, SPI configuration is not affected. * @return true iff success. */ boolean max3421e_reset(void) { uint8_t tmp = 0; // Chip reset. This stops the oscillator max3421e_write(MAX_REG_USBCTL, bmCHIPRES); // Remove the reset max3421e_write(MAX_REG_USBCTL, 0x00); avr_delay(10); // Wait until the PLL is stable while (!(max3421e_read(MAX_REG_USBIRQ) & bmOSCOKIRQ)) { // Timeout after 256 attempts. tmp++; if (tmp == 0) return (false); } // Success. return (true); }
/** * @brief Sleep function. */ void MLOSSleep(int mSecs) { avr_delay(mSecs); return; }