You are currently viewing the documentation for:
The ECUSB_Serial_Init function configures and initializes the serial function level driver.
ECUSB_ErrorCode ECUSB_Serial_Init(
   struct ECUSB_Serial_Function *pSerialFunction,
   struct ECUSB_Serial_Configuration *pConfiguration
A pointer to the struct ECUSB_Serial_Function that will be cleared and initialized by ECF_Serial_Init().
A pointer to a struct ECUSB_Serial_Configuration. This struct needs to be created by the user, cleared and the necessary values needs to be filled in. See description of struct ECUSB_Serial_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 the USB Serial function driver
   struct ECUSB_Serial_Configuration serialConfiguration;
   memset(&serialConfiguration, 0, sizeof(serialConfiguration));
   serialConfiguration.m_pDevice = &myUsbDevice.m_device;
   printf("Calling ECUSB_Serial_Init()...");
   err = ECUSB_Serial_Init(&myUsbDevice.m_serialFunction, &serialConfiguration);
   if(err != ECUSB_SUCCESS) 
      halt("ECUSB_Serial_Init failed", err);