You are currently viewing the documentation for:
The ECUSB_Init initializes ECUSB and the low level driver.
ECUSB_ErrorCode ECUSB_Init(
   struct ECUSB_xxx_Configuration *pConfiguration
Configuration parameters to the low-level USB driver. This struct needs to be cleared and its members need do be filled with function pointers to the callback functions the low level driver needs. These typically involves board initialisation, configuration of pull-ups etc. This struct is specific per low level driver. If you want to use the default options, just pass NULL. See description of struct ECUSB_AT91SAM7_Configuration or struct ECUSB_LPC17xx_Configuration for a reference of the fields in this struct.
Return value
Returns one of the ECUSB error codes (ECUSB_SUCCESS on success)
Example Code

   // Initialize ECUSB and the low level driver
   struct ECUSB_AT91SAM7_Configuration driverConfiguration;
   memset(&driverConfiguration, 0, sizeof(driverConfiguration));
   driverConfiguration.m_fnInitBoard     = Board_InitUsbPins;
   driverConfiguration.m_fnIsUsbPowered  = Board_IsUsbPowered;
   driverConfiguration.m_fnEnablePullUp  = Board_EnablePullUp;
   err = ECUSB_Init(&driverConfiguration);
   if(err != ECUSB_SUCCESS)
      halt("ECUSB_Init failed", err);