⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ui.c

📁 isp1160_isa_evel_codeUSB主机软件
💻 C
📖 第 1 页 / 共 3 页
字号:
//		regster_dump();
		exit ( 1 );
	}
}

#endif // DC_CONBINED


void status_monitor( void )
{
	static unsigned char	vital_sign;

	if ( !g_status_monitor_switch )
		return;

	mprintf( (vital_sign++ & 0x1) ? LIGHTBLUE : YELLOW, CONTINUE, "*" );
	
/*
//	mprintf( LIGHTGRAY, CONTINUE, " uis=0x%04X", read_register16( Com16_HcuPInterrupt ) );
//	mprintf( LIGHTGRAY, CONTINUE, " is=0x%08lX", read_register32( Com32_HcInterruptStatus ) );
//	mprintf( LIGHTGRAY, CONTINUE, " f#=0x%08lX", read_register32( Com32_HcFmNumber ) );
//	mprintf( LIGHTGRAY, CONTINUE, " rs=0x%08lX", read_register32( Com32_HcRhStatus ) );
	mprintf( LIGHTGRAY, CONTINUE, " ev=0x%08lX", g_event_counter );
	mprintf( LIGHTGRAY, CONTINUE, " ev=0x%08lX", dc_unit_event_counter );
	mprintf( LIGHTGRAY, CONTINUE, " p1=0x%08lX", read_register32( Com32_HcRhPortStatus1 ) );
	mprintf( LIGHTGRAY, CONTINUE, " p2=0x%08lX\r", read_register32( Com32_HcRhPortStatus2 ) );
*/

	mprintf( LIGHTGRAY, CONTINUE, " sof=0x%08lX", g_sof_counter );

	mprintf( LIGHTGRAY, CONTINUE, " uis=0x%02X", read_register16( Com16_HcuPInterrupt ) );
	mprintf( LIGHTGRAY, CONTINUE, " is=0x%02X", read_register32( Com32_HcInterruptStatus ) );
//	mprintf( LIGHTGRAY, CONTINUE, " bfs=0x%02X", read_register16( Com16_HcBufferStatus ) );
//	mprintf( LIGHTGRAY, CONTINUE, " f#=0x%08lX", read_register32( Com32_HcFmNumber ) );
//	mprintf( LIGHTGRAY, CONTINUE, " rs=0x%08lX", read_register32( Com32_HcRhStatus ) );
//	mprintf( LIGHTGRAY, CONTINUE, " ev=0x%08lX", g_event_counter );

//	mprintf( LIGHTGRAY, CONTINUE, " dcev=0x%08lX", dc_unit_event_counter );
	mprintf( LIGHTGRAY, CONTINUE, " p1=0x%08lX", read_register32( Com32_HcRhPortStatus1 ) );
	mprintf( LIGHTGRAY, CONTINUE, " p2=0x%08lX", read_register32( Com32_HcRhPortStatus2 ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " t(sec)=%07ld", g_operation_time );
	
	mprintf( LIGHTGRAY, CONTINUE, "\r" );
}


void isr_flag_monitor( void )
{
	unsigned short	flag_mask;	/*  this mask shold be set to */

	flag_mask	= SOFITInt | ATLInt | AllEOTInterrupt;

	if ( !(g_isr_flag & ~flag_mask) )
		return;
	
	mprintf( LIGHTGREEN, CONTINUE, "\r\n" );

	if ( g_isr_flag & SOFITInt )			mprintf( LIGHTGREEN, CONTINUE, "    SOFITInt \r\n" );
	if ( g_isr_flag & ATLInt )				mprintf( LIGHTGREEN, CONTINUE, "    ATLInt \r\n" );
	if ( g_isr_flag & AllEOTInterrupt )		mprintf( LIGHTGREEN, CONTINUE, "    AllEOTInterrupt \r\n" );
	if ( g_isr_flag & HCSuspend )			mprintf( LIGHTGREEN, CONTINUE, "    HCSuspend \r\n" );
	if ( g_isr_flag & ClkReady )			mprintf( LIGHTGREEN, CONTINUE, "    ClkReady \r\n" );
	if ( g_isr_flag & OPR_Reg )				mprintf( LIGHTGREEN, CONTINUE, "    OPR_Reg...\r\n" );
	if ( g_isr_flag & SO )					mprintf( LIGHTGREEN, CONTINUE, "              -> SO \r\n" );
	if ( g_isr_flag & SF )					mprintf( LIGHTGREEN, CONTINUE, "              -> SF \r\n" );
	if ( g_isr_flag & RD )					mprintf( LIGHTGREEN, CONTINUE, "              -> RD \r\n" );
	if ( g_isr_flag & UE )					mprintf( LIGHTGREEN, CONTINUE, "              -> UE \r\n" );
	if ( g_isr_flag & FNO )					mprintf( LIGHTGREEN, CONTINUE, "              -> FNO \r\n" );
	if ( g_isr_flag & RHSC )				mprintf( LIGHTGREEN, CONTINUE, "              -> RHSC \r\n" );
	if ( g_isr_flag & ATD )					mprintf( LIGHTGREEN, CONTINUE, "              -> ATD \r\n" );
	
	mprintf( LIGHTGRAY, CONTINUE, "\r" );
}



void start_message( void )
{
	int		i;

clrscr();

#ifdef DC_CONBINED

	printf( "Kenobi2 Hc+Dc\n" );

	for ( i = 0; i < 30; i++ )
		mprintf( BLUE, CONTINUE,"  \r\n");

	for ( i = 0; i < 30; i++ )
		Dc_printf( GREEN, CONTINUE,"  \r\n");

#endif //DC_CONBINED

#if 0
	mprintf( RED, CONTINUE,"\r\n");
	mprintf( RED, CONTINUE,"\r\n");
	mprintf( RED, CONTINUE,"               *************************************************\r\n");
	mprintf( RED, CONTINUE,"               ****   ISP1161 hardware check/test harness   ****\r\n");
	mprintf( RED, CONTINUE,"               ****       Philips Semiconductors Tokyo      ****\r\n");
	mprintf( RED, CONTINUE,"               *************************************************\r\n");
#endif

	mprintf( LIGHTBLUE, CONTINUE,"\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               *************************************************\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               ****                 ");
	mprintf( WHITE,     CONTINUE,                                    "Kenobi2");
	mprintf( LIGHTBLUE, CONTINUE,                                           "                 ****\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               ****        ");
	mprintf( LIGHTGRAY, CONTINUE,                           "version %s (%s)", VERSION_NUMBER, __DATE__ );
	mprintf( LIGHTBLUE, CONTINUE,                                                     "       ****\r\n");
//	mprintf( LIGHTBLUE, CONTINUE,"               ****                                         ****\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               ****                                         ****\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               ****      ");
	mprintf( LIGHTCYAN, CONTINUE,                         "Philips Semiconductors, Tokyo");
	mprintf( LIGHTBLUE, CONTINUE,                                                      "      ****\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"               *************************************************\r\n");
	mprintf( LIGHTBLUE, CONTINUE,"                         build : %s  %s\r\n", __DATE__, __TIME__ );


	mprintf( LIGHTGRAY, CONTINUE, "                                " );
	
	for ( i = 0; i < 16; i++ )
	{
		mprintf( i, CONTINUE, "%X", i  );
	}
	
	mprintf( LIGHTGRAY, CONTINUE,"\r\n");
	mprintf( LIGHTGRAY, CONTINUE,"\r\n");
}


void regster_dump( void )
{
	mprintf( LIGHTGREEN, CONTINUE, "\r\nHc register dump\r\n" );

	mprintf( LIGHTGREEN, CONTINUE, "  HcRevision         (0x%02X): 0x%08lX",         Com32_HcRevision,               read_register32( Com32_HcRevision              ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcHardwareConfiguration(0x%02X): 0x%04X\r\n", Com16_HcHardwareConfiguration,  read_register16( Com16_HcHardwareConfiguration ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcControl          (0x%02X): 0x%08lX",         Com32_HcControl,                read_register32( Com32_HcControl               ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcDMAConfiguration     (0x%02X): 0x%04X\r\n", Com16_HcDMAConfiguration,       read_register16( Com16_HcDMAConfiguration      ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcCommandStatus    (0x%02X): 0x%08lX",         Com32_HcCommandStatus,          read_register32( Com32_HcCommandStatus         ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcTransferCounter      (0x%02X): 0x%04X\r\n", Com16_HcTransferCounter,        read_register16( Com16_HcTransferCounter       ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcInterruptStatus  (0x%02X): 0x%08lX",         Com32_HcInterruptStatus,        read_register32( Com32_HcInterruptStatus       ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcuPInterrupt          (0x%02X): 0x%04X\r\n", Com16_HcuPInterrupt,            read_register16( Com16_HcuPInterrupt           ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcInterruptEnable  (0x%02X): 0x%08lX",         Com32_HcInterruptEnable,        read_register32( Com32_HcInterruptEnable       ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcuPInterruptEnable    (0x%02X): 0x%04X\r\n", Com16_HcuPInterruptEnable,      read_register16( Com16_HcuPInterruptEnable     ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcInterruptDisable (0x%02X): 0x%08lX",         Com32_HcInterruptDisable,       read_register32( Com32_HcInterruptDisable      ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcChipID               (0x%02X): 0x%04X\r\n", Com16_HcChipID,                 read_register16( Com16_HcChipID                ) );
	
	mprintf( LIGHTGREEN, CONTINUE, "  HcFmInterval       (0x%02X): 0x%08lX",         Com32_HcFmInterval,             read_register32( Com32_HcFmInterval            ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcScratch              (0x%02X): 0x%04X\r\n", Com16_HcScratch,                read_register16( Com16_HcScratch               ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcFmRemaining      (0x%02X): 0x%08lX",         Com32_HcFmRemaining,            read_register32( Com32_HcFmRemaining           ) );

	mprintf( LIGHTGREEN, CONTINUE, "  HcSoftwareReset        (0x%02X): N/A   \r\n", Com16_HcSoftwareReset );

	mprintf( LIGHTGREEN, CONTINUE, "  HcFmNumber         (0x%02X): 0x%08lX",         Com32_HcFmNumber,               read_register32( Com32_HcFmNumber              ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcITLBufferLength      (0x%02X): 0x%04X\r\n", Com16_HcITLBufferLength,        read_register16( Com16_HcITLBufferLength       ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcLSThreshold      (0x%02X): 0x%08lX",         Com32_HcLSThreshold,            read_register32( Com32_HcLSThreshold           ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcATLBufferLength      (0x%02X): 0x%04X\r\n", Com16_HcATLBufferLength,        read_register16( Com16_HcATLBufferLength       ) );
	
	mprintf( LIGHTGREEN, CONTINUE, "  HcRhDescriptorA    (0x%02X): 0x%08lX",         Com32_HcRhDescriptorA,          read_register32( Com32_HcRhDescriptorA         ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcBufferStatus         (0x%02X): 0x%04X\r\n", Com16_HcBufferStatus,           read_register16( Com16_HcBufferStatus          ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcRhDescriptorB    (0x%02X): 0x%08lX",         Com32_HcRhDescriptorB,          read_register32( Com32_HcRhDescriptorB         ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcReadBackITL0Length   (0x%02X): 0x%04X\r\n", Com16_HcReadBackITL0Length,     read_register16( Com16_HcReadBackITL0Length    ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcRhStatus         (0x%02X): 0x%08lX",         Com32_HcRhStatus,               read_register32( Com32_HcRhStatus              ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcReadBackITL1Length   (0x%02X): 0x%04X\r\n", Com16_HcReadBackITL1Length,     read_register16( Com16_HcReadBackITL1Length    ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcRhPortStatus1    (0x%02X): 0x%08lX",         Com32_HcRhPortStatus1,          read_register32( Com32_HcRhPortStatus1         ) );
//	mprintf( LIGHTGREEN, CONTINUE, "  HcITLBufferport        (0x%02X): 0x%04X\r\n", Com16_HcITLBufferPort,          read_register16( Com16_HcITLBufferPort         ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcITLBufferport        (0x%02X): ------\r\n", Com16_HcITLBufferPort                                                            );
	mprintf( LIGHTGREEN, CONTINUE, "  HcRhPortStatus2    (0x%02X): 0x%08lX",         Com32_HcRhPortStatus2,          read_register32( Com32_HcRhPortStatus2         ) );
//	mprintf( LIGHTGREEN, CONTINUE, "  HcATLBufferPort        (0x%02X): 0x%04X\r\n", Com16_HcATLBufferPort,          read_register16( Com16_HcATLBufferPort         ) );
	mprintf( LIGHTGREEN, CONTINUE, "  HcATLBufferPort        (0x%02X): ------\r\n", Com16_HcATLBufferPort                                                            );

	mprintf( LIGHTGREEN, CONTINUE, "\r\n" );
}



/*
void regster_dump( void )
{
	mprintf( LIGHTGRAY, CONTINUE, " HcRevision             (0x%02X): 0x%08lX\r\n", Com32_HcRevision,               read_register32( Com32_HcRevision              ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcControl              (0x%02X): 0x%08lX\r\n", Com32_HcControl,                read_register32( Com32_HcControl               ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcCommandStatus        (0x%02X): 0x%08lX\r\n", Com32_HcCommandStatus,          read_register32( Com32_HcCommandStatus         ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcInterruptStatus      (0x%02X): 0x%08lX\r\n", Com32_HcInterruptStatus,        read_register32( Com32_HcInterruptStatus       ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcInterruptEnable      (0x%02X): 0x%08lX\r\n", Com32_HcInterruptEnable,        read_register32( Com32_HcInterruptEnable       ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcInterruptDisable     (0x%02X): 0x%08lX\r\n", Com32_HcInterruptDisable,       read_register32( Com32_HcInterruptDisable      ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " HcFmInterval           (0x%02X): 0x%08lX\r\n", Com32_HcFmInterval,             read_register32( Com32_HcFmInterval            ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcFmRemaining          (0x%02X): 0x%08lX\r\n", Com32_HcFmRemaining,            read_register32( Com32_HcFmRemaining           ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcFmNumber             (0x%02X): 0x%08lX\r\n", Com32_HcFmNumber,               read_register32( Com32_HcFmNumber              ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcLSThreshold          (0x%02X): 0x%08lX\r\n", Com32_HcLSThreshold,            read_register32( Com32_HcLSThreshold           ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " HcRhDescriptorA        (0x%02X): 0x%08lX\r\n", Com32_HcRhDescriptorA,          read_register32( Com32_HcRhDescriptorA         ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcRhDescriptorB        (0x%02X): 0x%08lX\r\n", Com32_HcRhDescriptorB,          read_register32( Com32_HcRhDescriptorB         ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcRhStatus             (0x%02X): 0x%08lX\r\n", Com32_HcRhStatus,               read_register32( Com32_HcRhStatus              ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcRhPortStatus1        (0x%02X): 0x%08lX\r\n", Com32_HcRhPortStatus1,          read_register32( Com32_HcRhPortStatus1         ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcRhPortStatus2        (0x%02X): 0x%08lX\r\n", Com32_HcRhPortStatus2,          read_register32( Com32_HcRhPortStatus2         ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " HcHardwareConfiguration(0x%02X): 0x%04X\r\n", Com16_HcHardwareConfiguration,  read_register16( Com16_HcHardwareConfiguration ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcDMAConfiguration     (0x%02X): 0x%04X\r\n", Com16_HcDMAConfiguration,       read_register16( Com16_HcDMAConfiguration      ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcTransferCounter      (0x%02X): 0x%04X\r\n", Com16_HcTransferCounter,        read_register16( Com16_HcTransferCounter       ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcuPInterrupt          (0x%02X): 0x%04X\r\n", Com16_HcuPInterrupt,            read_register16( Com16_HcuPInterrupt           ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcuPInterruptEnable    (0x%02X): 0x%04X\r\n", Com16_HcuPInterruptEnable,      read_register16( Com16_HcuPInterruptEnable     ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " HcChipID               (0x%02X): 0x%04X\r\n", Com16_HcChipID,                 read_register16( Com16_HcChipID                ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcScratch              (0x%02X): 0x%04X\r\n", Com16_HcScratch,                read_register16( Com16_HcScratch               ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcSoftwareReset        (0x%02X): N/A   \r\n", Com16_HcSoftwareReset,          read_register16( Com16_HcSoftwareReset         ) );
	
	mprintf( LIGHTGRAY, CONTINUE, " HcITLBufferLength      (0x%02X): 0x%04X\r\n", Com16_HcITLBufferLength,        read_register16( Com16_HcITLBufferLength       ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcATLBufferLength      (0x%02X): 0x%04X\r\n", Com16_HcATLBufferLength,        read_register16( Com16_HcATLBufferLength       ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcBufferStatus         (0x%02X): 0x%04X\r\n", Com16_HcBufferStatus,           read_register16( Com16_HcBufferStatus          ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcReadBackITL0Length   (0x%02X): 0x%04X\r\n", Com16_HcReadBackITL0Length,     read_register16( Com16_HcReadBackITL0Length    ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcReadBackITL1Length   (0x%02X): 0x%04X\r\n", Com16_HcReadBackITL1Length,     read_register16( Com16_HcReadBackITL1Length    ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcITLBufferport        (0x%02X): 0x%04X\r\n", Com16_HcITLBufferPort,          read_register16( Com16_HcITLBufferPort         ) );
	mprintf( LIGHTGRAY, CONTINUE, " HcATLBufferPort        (0x%02X): 0x%04X\r\n", Com16_HcATLBufferPort,          read_register16( Com16_HcATLBufferPort         ) );
}


*/


void print_unicode( unsigned char color, unsigned short *str )
{
	char	buff[ 128 ];
	int		i;
	
	for ( i = 1; i < (((std_string_descriptor *)str)->bLength) >> 1; i++ )
		*(buff + i)		= *(str + i) & 0xFF;
	
	*(buff + i)		= '\0';
	
	mprintf( color, CONTINUE, buff + 1 );
}


void show_device_string_descriptors( device_instance *dp )
{
	mprintf( LIGHTGRAY, CONTINUE, "    - manufacturer : " );

	if ( dp->string_manufacturer != NULL )
		print_unicode( LIGHTGRAY, dp->string_manufacturer );
	else
		mprintf( LIGHTGRAY, CONTINUE, "   ---   (N/A)" );
		
	mprintf( LIGHTGRAY, CONTINUE, "\r\n    - product      : " );

	if ( dp->string_product != NULL )
		print_unicode( LIGHTGRAY, dp->string_product );
	else
		mprintf( LIGHTGRAY, CONTINUE, "   ---   (N/A)" );
		

	mprintf( LIGHTGRAY, CONTINUE, "\r\n    - serial #     : " );

	if ( dp->string_serialNum != NULL )
		print_unicode( LIGHTGRAY, dp->string_serialNum );
	else
		mprintf( LIGHTGRAY, CONTINUE, "   ---   (N/A)" );

	mprintf( LIGHTGRAY, CONTINUE, "\r\n\r\n" );
}


void device_infomation_viewer( device_instance *dp )
{
	int					i;
	endpoint_info		*epp;

	mprintf( LIGHTGREEN, CONTINUE, "device instance pointer %p\r\n", dp );
	mprintf( LIGHTGREEN, CONTINUE, "  address 0x%02X\r\n", dp->address );
	mprintf( LIGHTGREEN, CONTINUE, "  speed   0x%02X\r\n", dp->speed );
	mprintf( LIGHTGREEN, CONTINUE, "  speed   %p\r\n", dp->string_manufacturer );
	mprintf( LIGHTGREEN, CONTINUE, "  speed   %p\r\n", dp->string_product );
	mprintf( LIGHTGREEN, CONTINUE, "  speed   %p\r\n", dp->string_serialNum );
	mprintf( LIGHTGREEN, CONTINUE, "  dev_descriptor pointer %p\r\n", &(dp->dev_descriptor) );
	mprintf( LIGHTGREEN, CONTINUE, "    bLength            0x%02X\r\n", (dp->dev_descriptor).bLength );
	mprintf( LIGHTGREEN, CONTINUE, "    bDescriptorType    0x%02X\r\n", (dp->dev_descriptor).bDescriptorType );
	mprintf( LIGHTGREEN, CONTINUE, "    bcdUSB             0x%04X\r\n", (dp->dev_descriptor).bcdUSB );
	mprintf( LIGHTGREEN, CONTINUE, "    bDeviceClass       0x%02X\r\n", (dp->dev_descriptor).bDeviceClass );
	mprintf( LIGHTGREEN, CONTINUE, "    bDeviceSubClass    0x%02X\r\n", (dp->dev_descriptor).bDeviceSubClass );
	mprintf( LIGHTGREEN, CONTINUE, "    bDeviceProtocol    0x%02X\r\n", (dp->dev_descriptor).bDeviceProtocol );
	mprintf( LIGHTGREEN, CONTINUE, "    bMaxPacketSize0    0x%02X\r\n", (dp->dev_descriptor).bMaxPacketSize0 );
	mprintf( LIGHTGREEN, CONTINUE, "    idVendor           0x%04X\r\n", (dp->dev_descriptor).idVendor );
	mprintf( LIGHTGREEN, CONTINUE, "    idProduct          0x%04X\r\n", (dp->dev_descriptor).idProduct );
	mprintf( LIGHTGREEN, CONTINUE, "    bcdDevice          0x%04X\r\n", (dp->dev_descriptor).bcdDevice );
	mprintf( LIGHTGREEN, CONTINUE, "    iManufacturer      0x%02X\r\n", (dp->dev_descriptor).iManufacturer );
	mprintf( LIGHTGREEN, CONTINUE, "    iProduct           0x%02X\r\n", (dp->dev_descriptor).iProduct );
	mprintf( LIGHTGREEN, CONTINUE, "    iSerialNumber      0x%02X\r\n", (dp->dev_descriptor).iSerialNumber );
	mprintf( LIGHTGREEN, CONTINUE, "    bNumConfigurations 0x%02X\r\n", (dp->dev_descriptor).bNumConfigurations );
		mprintf( LIGHTGREEN, CONTINUE, "press key to see more.\r" );
		key_wait();
		mprintf( LIGHTGREEN, CONTINUE, "p\r" );
		
		
	mprintf( LIGHTGREEN, CONTINUE, "  dev_descriptor (conf) pointer %p\r\n", &(dp->conf_descriptor) );
	mprintf( LIGHTGREEN, CONTINUE, "    bLength            0x%02X\r\n", (dp->conf_descriptor).bLength );
	mprintf( LIGHTGREEN, CONTINUE, "    bDescriptorType    0x%02X\r\n", (dp->conf_descriptor).bDescriptorType );
	mprintf( LIGHTGREEN, CONTINUE, "    wTotalLength       0x%04X\r\n", (dp->conf_descriptor).wTotalLength );
	mprintf( LIGHTGREEN, CONTINUE, "    bNumInterfaces     0x%02X\r\n", (dp->conf_descriptor).bNumInterfaces );
	mprintf( LIGHTGREEN, CONTINUE, "    bConfigurationValue 0x%02X\r\n", (dp->conf_descriptor).bConfigurationValue );
	mprintf( LIGHTGREEN, CONTINUE, "    iConfiguration     0x%02X\r\n", (dp->conf_descriptor).iConfiguration );
	mprintf( LIGHTGREEN, CONTINUE, "    bmAttributes       0x%02X\r\n", (dp->conf_descriptor).bmAttributes );
	mprintf( LIGHTGREEN, CONTINUE, "    bMaxPower          0x%02X\r\n", (dp->conf_descriptor).bMaxPower );
		mprintf( LIGHTGREEN, CONTINUE, "press key to see more.\r" );
		key_wait();
		mprintf( LIGHTGREEN, CONTINUE, "p\r" );
		
		
	mprintf( LIGHTGREEN, CONTINUE, "  interfacef_descriptor pointer %p\r\n", &(dp->interfacef_descriptor) );
	mprintf( LIGHTGREEN, CONTINUE, "    bLength            0x%02X\r\n", (dp->interfacef_descriptor).bLength );
	mprintf( LIGHTGREEN, CONTINUE, "    bDescriptorType    0x%02X\r\n", (dp->interfacef_descriptor).bDescriptorType );
	mprintf( LIGHTGREEN, CONTINUE, "    bInterfaceNumber   0x%02X\r\n", (dp->interfacef_descriptor).bInterfaceNumber );
	mprintf( LIGHTGREEN, CONTINUE, "    bAlternateSetting  0x%02X\r\n", (dp->interfacef_descriptor).bAlternateSetting );
	mprintf( LIGHTGREEN, CONTINUE, "    bNumEndpoints      0x%02X\r\n", (dp->interfacef_descriptor).bNumEndpoints );
	mprintf( LIGHTGREEN, CONTINUE, "    bInterfaceClass    0x%02X\r\n", (dp->interfacef_descriptor).bInterfaceClass );
	mprintf( LIGHTGREEN, CONTINUE, "    bInterfaceSubClass 0x%02X\r\n", (dp->interfacef_descriptor).bInterfaceSubClass );
	mprintf( LIGHTGREEN, CONTINUE, "    bInterfaceProtocol 0x%02X\r\n", (dp->interfacef_descriptor).bInterfaceProtocol );
	mprintf( LIGHTGREEN, CONTINUE, "    iInterface         0x%02X\r\n", (dp->interfacef_descriptor).iInterface );
		mprintf( LIGHTGREEN, CONTINUE, "press key to see more.\r" );
		key_wait();
		mprintf( LIGHTGREEN, CONTINUE, "p\r" );


	for ( i = 0; i < MAX_ENDPOINT_NUM; i++ )
	{
		epp		= dp->epi_ptr[ i ];
		
		mprintf( LIGHTGREEN, CONTINUE, "  endpoint[ %d ] %p\r\n", i, epp );
		
//		if ( epp == NULL )
//			continue;

		if ( epp != NULL )
		{
			mprintf( LIGHTGREEN, CONTINUE, "    max_packet_size      0x%04X\r\n", (epp->max_packet_size) );
			mprintf( LIGHTGREEN, CONTINUE, "    dev_addr             0x%02X\r\n", (epp->dev_addr) );
			mprintf( LIGHTGREEN, CONTINUE, "    ep_num               0x%02X\r\n", (epp->ep_num) );

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -