void INT_VDD5V(void) { #ifdef USE_VBUSVALID if(BF_RD(POWER_CTRL, VBUSVALID_IRQ)) { if(BF_RD(POWER_STS, VBUSVALID)) usb_insert_int(); else usb_remove_int(); /* reverse polarity */ BF_WR(POWER_CTRL_TOG, POLARITY_VBUSVALID(1)); /* clear int */ BF_CLR(POWER_CTRL, VBUSVALID_IRQ); } #else if(BF_RD(POWER_CTRL, VDD5V_GT_VDDIO_IRQ)) { if(BF_RD(POWER_STS, VDD5V_GT_VDDIO)) usb_insert_int(); else usb_remove_int(); /* reverse polarity */ BF_WR(POWER_CTRL_TOG, POLARITY_VDD5V_GT_VDDIO(1)); /* clear int */ BF_CLR(POWER_CTRL, VDD5V_GT_VDDIO_IRQ); } #endif }
static void pmu_read_inputs_ooc(void) { unsigned char oocstat = pmu_read(PCF5063X_REG_OOCSTAT); if (oocstat & PCF5063X_OOCSTAT_EXTON2) usb_insert_int(); else usb_remove_int(); #ifdef IPOD_ACCESSORY_PROTOCOL pmu_input_accessory = !(oocstat & PCF5063X_OOCSTAT_EXTON3); #endif }
void INT_VDD5V(void) { if(HW_POWER_CTRL & HW_POWER_CTRL__VBUSVALID_IRQ) { if(HW_POWER_STS & HW_POWER_STS__VBUSVALID) usb_insert_int(); else usb_remove_int(); /* reverse polarity */ __REG_TOG(HW_POWER_CTRL) = HW_POWER_CTRL__POLARITY_VBUSVALID; /* enable int */ __REG_CLR(HW_POWER_CTRL) = HW_POWER_CTRL__VBUSVALID_IRQ; } }