예제 #1
0
void cli_vbus_event(bool b_vbus_high)
{
	if (b_vbus_high == true) {
		udc_attach();
	} else {
		udc_detach();
	}
}
예제 #2
0
파일: usb.c 프로젝트: ryandavid/traqpaq
void main_vbus_action(bool b_high){
	if (b_high) {
		// Attach USB Device
		udc_attach();
	} else {
		// VBUS not present
		udc_detach();
	}
}
예제 #3
0
void stdio_usb_vbus_event(bool b_high)
{
	if (b_high) {
		// Attach USB Device
		udc_attach ();
	} else {
		// VBUS not present
		udc_detach ();
	}
}
예제 #4
0
파일: demo.c 프로젝트: thegeek82000/asf
/**
 * \brief USB VBUS actions.
 */
static void main_vbus_action(bool b_high)
{
	if (b_high) {
		/* Attach USB Device */
		udc_attach();
	} else {
		/* VBUS not present */
		udc_detach();
	}
}
예제 #5
0
// This gets called when the interface is plugged in or out to/from the host.
void naiboard_usb_vbus_action(bool b_high) {
	printf_P(PSTR("naiboard-usb: usb_vbus_action(%d);\n"), b_high);

	if (b_high) {
		// Attach USB Device
		udc_attach();
	} else {
		// VBUS not present
		udc_detach();
	}
}
예제 #6
0
파일: usb.c 프로젝트: EwanLu/chipwhisperer
static void ctrl_sam3ucfg_cb(void)
{
	switch(udd_g_ctrlreq.req.wValue & 0xFF)
	{
		/* Turn on slow clock */
		case 0x01:
			osc_enable(OSC_MAINCK_XTAL);
			osc_wait_ready(OSC_MAINCK_XTAL);
			pmc_switch_mck_to_mainck(CONFIG_SYSCLK_PRES);
			break;
			
		/* Turn off slow clock */
		case 0x02:
			pmc_switch_mck_to_pllack(CONFIG_SYSCLK_PRES);
			break;
		
		/* Jump to ROM-resident bootloader */
		case 0x03:
			/* Turn off connected stuff */
			board_power(0);
		
			/* Clear ROM-mapping bit. */
			efc_perform_command(EFC0, EFC_FCMD_CGPB, 1);	
		
			/* Disconnect USB (will kill connection) */
			udc_detach();
		
			/* With knowledge that I will rise again, I lay down my life. */
			while (RSTC->RSTC_SR & RSTC_SR_SRCMP);			
			RSTC->RSTC_CR |= RSTC_CR_KEY(0xA5) | RSTC_CR_PERRST | RSTC_CR_PROCRST;				
			while(1);
			break;
			
#ifdef PLATFORMCW1180
		/* 0xA0 starts CW1180 Specific Commands */
		case 0xA0:
			enable_lcd();
			redraw_background();
			break;	
			
#endif
		/* Oh well, sucks to be you */
		default:
			break;
	}
}