コード例 #1
0
int main(void)
{
  int conf, interf;
  UARTInit();
  USBNInit();   
  // setup your usbn device

  USBNDeviceVendorID(0x0400);
  USBNDeviceProductID(0x9876);
  USBNDeviceBCDDevice(0x0201);


  char lang[]={0x09,0x04};
  _USBNAddStringDescriptor(lang); // language descriptor

  
  USBNDeviceManufacture ("vScopeTeam");
  USBNDeviceProduct	("vScopeDevice");
  USBNDeviceSerialNumber("2006-04-05");

  conf = USBNAddConfiguration();

  //USBNConfigurationName(conf,"StandardKonfiguration");
  USBNConfigurationPower(conf,50);

  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,0);

  //USBNInterfaceName(conf,interf,"usbstorage");
  

  USBNAddOutEndpoint(conf,interf,1,0x02,BULK,64,0,&SetGetPort);
  USBNAddInEndpoint(conf,interf,1,0x03,BULK,64,0);

/*
  conf = USBNAddConfiguration();
 
  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,1);
  
  USBNAddInEndpoint(conf,interf,1,0x02,BULK,64);
  USBNAddInEndpoint(conf,interf,2,0x03,BULK,8);
  USBNAddInEndpoint(conf,interf,3,0x04,BULK,64);
*/
  
  MCUCR |=  (1 << ISC01); // fallende flanke

  GICR |= (1 << INT0);
  sei();
  
  USBNInitMC();

  // start usb chip
  USBNStart();

  DDRB=0xff;
  PORTB=0x00;
  while(1);
}
コード例 #2
0
ファイル: main.c プロジェクト: DerGenaue/usbprog
int main(void)
{
  int conf, interf;
  
  //UARTInit();
  
  USBNInit();   
  usbprog.long_running=0;

  DDRA = (1 << PA4); // status led
  DDRA = (1 << PA7); // switch pin


  // setup your usbn device

  USBNDeviceVendorID(0x1786);
  USBNDeviceProductID(0x0c62);
  USBNDeviceBCDDevice(0x0007);


  char lang[]={0x09,0x04};
  _USBNAddStringDescriptor(lang); // language descriptor
  
  USBNDeviceManufacture ("EmbeddedProjects");
  USBNDeviceProduct	("usbprogSkeleton ");

  conf = USBNAddConfiguration();

  USBNConfigurationPower(conf,50);

  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,0);

  USBNAddInEndpoint(conf,interf,1,0x02,BULK,64,0,&CommandAnswerRest);
  USBNAddOutEndpoint(conf,interf,1,0x02,BULK,64,0,&Commands);

  
  USBNInitMC();
  sei();
  USBNStart();

  //LED_on;
  int i;
  for(i=0;i<320;i++)
    answer[i]=i+2;
  
  PORTA &= ~(1<<PA7);
  //CommandAnswer(320);

  while(1){
    //PORTA |= (1<<PA7);
    //PORTA &= ~(1<<PA7);
  }
}
コード例 #3
0
ファイル: main.c プロジェクト: DerGenaue/usbprog
int main(void)
{
  int conf, interf;
  UARTInit();

  USBNInit();   
  
  DDRA = (1 << DDA4);
  //PORTA |= (1<<PA4);	//on
  PORTA &= ~(1<<PA4); //off

  USBNDeviceVendorID(0x1781);	//atmel ids
  USBNDeviceProductID(0x0c62); // atmel ids
  
  USBNDeviceBCDDevice(0x0001);


  char lang[]={0x09,0x04};
  _USBNAddStringDescriptor(lang); // language descriptor

  
  USBNDeviceManufacture ("B.Sauter");
  USBNDeviceProduct	("LEDBLINK");

	//0000A0016461 (aktuelle)
	//0000A0019647
	//0000A0000252

  conf = USBNAddConfiguration();

  USBNConfigurationPower(conf,50);

  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,0);

  USBNAddInEndpoint(conf,interf,1,0x02,BULK,64,0,NULL);
  USBNAddOutEndpoint(conf,interf,1,0x02,BULK,64,0,&USBFlash);
  
  USBNInitMC();
  // start usb chip
  USBNStart();
  sei();
  wait_ms(1000);
  while(1){
		PORTA &= ~(1<<PA4); //off
		wait_ms(100);
		PORTA |= (1<<PA4);  //on
		wait_ms(100);
	}
}
コード例 #4
0
ファイル: main.c プロジェクト: BackupTheBerlios/usbn2mc-svn
int main(void)
{
  int conf, interf;
  UARTInit();
  USBNInit();   
  // setup your usbn device

  USBNDeviceVendorID(0x0400);
  USBNDeviceProductID(0x9876);
  USBNDeviceBCDDevice(0x0201);


  char lang[]={0x09,0x04};
  _USBNAddStringDescriptor(lang); // language descriptor

  
  USBNDeviceManufacture ("B.Sauter");
  USBNDeviceProduct	("usbflash");
  USBNDeviceSerialNumber("2006-04-12");

  conf = USBNAddConfiguration();

  //USBNConfigurationName(conf,"StandardKonfiguration");
  USBNConfigurationPower(conf,50);

  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,0);

  //USBNInterfaceName(conf,interf,"usbstorage");
  

  USBNAddOutEndpoint(conf,interf,1,0x02,BULK,64,0,&USBFlash);
  USBNAddInEndpoint(conf,interf,1,0x03,BULK,64,0,NULL);

  
  MCUCR |=  (1 << ISC01); // fallende flanke

  GICR |= (1 << INT0);
  sei();
  
  USBNInitMC();

  // start usb chip
  USBNStart();

  while(1);
}
コード例 #5
0
ファイル: main.c プロジェクト: BackupTheBerlios/usbn2mc-svn
int main(void)
{
  int conf, interf;
  UARTInit();
  USBNInit();   
  // setup your usbn device

  USBNDeviceVendorID(0x0400);
  USBNDeviceProductID(0x0000);
  USBNDeviceBCDDevice(0x0000);


  char lang[]={0x09,0x04};
  _USBNAddStringDescriptor(lang); // language descriptor

  
  USBNDeviceManufacture ("FH Augsburg");
  USBNDeviceProduct	("vScope");
  USBNDeviceSerialNumber("www.vscope.de");

  conf = USBNAddConfiguration();

  USBNConfigurationPower(conf,50);

  interf = USBNAddInterface(conf,0);
  USBNAlternateSetting(conf,interf,0);


  USBNAddOutEndpoint(conf,interf,1,0x02,BULK,64,0,&ParseCommand);
  USBNAddInEndpoint(conf,interf,1,0x03,BULK,64,0,&TransferISR);

  
  USBNInitMC();

  // start usb chip
  USBNStart();
  //UARTWrite("waiting for enumaration signal...\r\n");

  while(1)
  {
	/* send new messages if some available */
  }
}
コード例 #6
0
int main(void)
{
    int conf, interf;
    
    /* set PE as output and to low, other pins to high-Z */
    JTAG_PORT_INIT = (1 << PE);
    JTAG_PORT_WRITE = 0;

    USBNInit();

    usbprog.datatogl = 0;

    USBNDeviceVendorID(VID);
    USBNDeviceProductID(PID);

    USBNDeviceBCDDevice(0x0200);

    char lang[]={0x09,0x04};
    _USBNAddStringDescriptor(lang); // language descriptor

    USBNDeviceManufacture ("USBprog EmbeddedProjects");
    USBNDeviceProduct("usbprogXSVF Xilinx Programmer");
    //USBNDeviceSerialNumber("GNU/GPL2");

    conf = USBNAddConfiguration();

    USBNConfigurationPower(conf,50);

    interf = USBNAddInterface(conf,0);
    USBNAlternateSetting(conf,interf,0);

    USBNAddInEndpoint(conf,interf,1,0x02,BULK,64,0,NULL);
    USBNAddOutEndpoint(conf,interf,1,0x03,BULK,64,0,&Commands);

    USBNInitMC();

    // start usb chip
    USBNStart();
    sei();
	
    while(1);
}
コード例 #7
0
ファイル: main.c プロジェクト: DerGenaue/usbprog
int main(void)
{
    int conf, interf;

    USBNInit();

    usbprog.datatogl = 0;   // 1MHz

    //DDRA = (1 << PA4);

    USBNDeviceVendorID(0x1781);	//atmel ids
    USBNDeviceProductID(0x0c62); // atmel ids

    USBNDeviceBCDDevice(0x0200);

    char lang[]={0x09,0x04};
    _USBNAddStringDescriptor(lang); // language descriptor

    USBNDeviceManufacture("B.Sauter");
    USBNDeviceProduct("USB JTAG Interface");
    USBNDeviceSerialNumber("GNU/GPL2");

    conf = USBNAddConfiguration();

    USBNConfigurationPower(conf,50);

    interf = USBNAddInterface(conf,0);
    USBNAlternateSetting(conf,interf,0);

    USBNAddInEndpoint(conf,interf,1,0x02,BULK,64,0,NULL);
    USBNAddOutEndpoint(conf,interf,1,0x03,BULK,64,0,&Commands);

    USBNInitMC();
    sei();

    // start usb chip
    USBNStart();
	


    while(1);
}