なんとかなるさね

マイコンをネタにブログを始めてみました


RXマイコン基板(RX62N) | USBマルチファンクションファームウェアを作るには? (2) 

今回、V850E2/ML4のアプリケーションノート/ソースコードに倣って、RX62N基板のファームウェアのソース
コードのデバイスディスクリプタやコンフィグレーションディスクリプタ、およびパソコン側のINFファイルを
書き換えてみました。(今回、マスストレージ + 仮想COMポートの組み合わせではなく、仮想COMポート x 2の
組み合わせで、試しました。) 結果、Windowsのデバイスマネージャに、USB Composite Deviceと2つの仮想
COMポートが表示されるようになりました。(もっとも、2つ表示された仮想COMポートの内の1つは、ファーム
ウェア側の処理がありませんので、動作しません。とりあえず、試行錯誤している一段階というところです。)



以下、V850E2/ML4のアプリケーションノート/ソースコードに書かれていない(もしくは書かれていても分かり
難い)ことで、気付いたことです。

* デバイスディスクリプタで bDeviceClass = 0xEF, bDeviceSubClass = 0x02, bDeviceProtocol = 0x01 に
 した場合、USBがマルチファンクション構成であることを示すことになる。
* デバイスディスクリプタでマルチファンクション構成であることを示すと、原則的に、コンフィグレーション
 ディスクリプタで示された1つ1つのインターフェイスを夫々独立したファンクションとしてWindowsが扱う。
 (たぶん、Windowsがそのように扱う、というよりも、USBの仕様がそうなっている、のだと思う。)
* 仮想COMポートでは、1つの仮想COMポートで2つのインターフェイスを使用しているが、この原則によって、
 この2つのインターフェイスを夫々独立した2つのファンクションとしてWindowsが扱ってしまい、仮想COM
 ポートが機能しなくなる。(自分は仮想COMポート x 2のつもりでも、Windowsが仮想COMポート x 4として
 扱ってしまう。)
* この場合にWindowsが正しく扱えるようにするには、コンフィグレーションディスクリプタのデータの中に
 インターフェイスアソシエーションディスクリプタ(IAD)と呼ばれるデータを挿入することで、後続の複数の
 インターフェイスがまとまって1つのファンクションを構成していることを明示しておく必要がある。(逆に、
 1インターフェイス=1ファンクションのものは、IADでまとめる必要が無いようです。)

試したデバイスディスクリプタやコンフィグレーションディスクリプタのデータは、以下の通りです。
 
uint8_t usb_gpcdc_DeviceDescriptor
    [ USB_PCDC_DD_BLENGTH + ( USB_PCDC_DD_BLENGTH % 2 ) ] =
{
    /*  0:bLength */
    USB_PCDC_DD_BLENGTH,
    /*  1:bDescriptorType */
    USB_DT_DEVICE,
    /*  2:bcdUSB_lo */
    (USB_BCDNUM                     & (uint8_t)0xffu),
    /*  3:bcdUSB_hi */
    ((uint8_t)(USB_BCDNUM >> 8)     & (uint8_t)0xffu),
    /*  4:bDeviceClass */
    0xEF,
    /*  5:bDeviceSubClass */
    0x02,
    /*  6:bDeviceProtocol */
    0x01,
    /*  7:bMAXPacketSize(for DCP) */
    (uint8_t)USB_DCPMAXP,
    /*  8:idVendor_lo */
    (USB_VENDORID                   & (uint8_t)0xffu),
    /*  9:idVendor_hi */
    ((uint8_t)(USB_VENDORID >> 8)   & (uint8_t)0xffu),
    /* 10:idProduct_lo */
    ((uint16_t)USB_PRODUCTID        & (uint8_t)0xffu),
    /* 11:idProduct_hi */
    ((uint8_t)(USB_PRODUCTID >> 8)  & (uint8_t)0xffu),
    /* 12:bcdDevice_lo */
    (USB_RELEASE                    & (uint8_t)0xffu),
    /* 13:bcdDevice_hi */
    ((uint8_t)(USB_RELEASE >> 8)    & (uint8_t)0xffu),
    /* 14:iManufacturer */
    1,
    /* 15:iProduct */
    2,
    /* 16:iSerialNumber */
    6,
    /* 17:bNumConfigurations */
    USB_CONFIGNUM
};

#define USB_PCDC_CD1_BLENGTH 141 // 9+(8+(9+5+4+5+5+7+9+7+7))+(8+(9+5+4+5+5+7+9+7+7))=141

uint8_t usb_gpcdc_ConfigrationF1
    [ USB_PCDC_CD1_BLENGTH + ( USB_PCDC_CD1_BLENGTH % 2 ) ] =
{
    9,                                  /*  0:bLength */
    USB_SOFT_CHANGE,                    /*  1:bDescriptorType */
    USB_PCDC_CD1_BLENGTH % 256,         /*  2:wTotalLength(L) */
    USB_PCDC_CD1_BLENGTH / 256,         /*  3:wTotalLength(H) */
    4,                                  /*  4:bNumInterfaces */
    1,                                  /*  5:bConfigurationValue */
    0,                                  /*  6:iConfiguration */
    USB_CF_RESERVED | USB_CF_SELFP,     /*  7:bmAttributes */
    (10 / 2),                           /*  8:MAXPower (2mA unit) */

    /* IAD */
        8,                              /*  0:bLength */
        0x0B,                           /*  1:bDescriptorType*/
        0,                              /*  2:bFirstInterface */
        2,                              /*  3:bInterfaceCount */
        USB_IFCLS_CDCC,                 /*  4:bFunctionClass */
                                        /*  5:bFunctionSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  6:bFunctionProtocol */
        0,                              /*  7:iInterface */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        0,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        1,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCC,                 /*  5:bInterfaceClass */
                                        /*  6:bInterfaceSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_HEADER_FUNC,
            USB_PCDC_BCD_CDC % 256, /*  3:bcdCDC_lo */
            USB_PCDC_BCD_CDC / 256, /*  4:bcdCDC_hi */
        /* Communications Class Functional Descriptorss */
            4,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,          /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_ABSTRACT_CTR_MANAGE_FUNC,
            2,                          /*  3:bmCapabilities */
        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,          /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_UNION_FUNC,
            0,                          /*  3:bMasterInterface */
            1,                          /*  4:bSlaveInterface0 */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_CALL_MANAGE_FUNC,
            /* D1:1-Device can send/receive call management
                    information over a Data Class interface. */
            /* D0:1-Device handles call management itself. */
            3,                          /*  3:bmCapabilities */
            1,                          /*  4:bDataInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN  | USB_EP3,       /*  2:bEndpointAddress */
            USB_EP_INT,                 /*  3:bmAttribute */
            16,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0x10,                       /*  6:bInterval */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        1,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        2,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCD,                 /*  5:bInterfaceClass */
        0,                              /*  6:bInterfaceSubClass */
        0,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN | USB_EP1,        /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            64,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

        /* Endpoint Descriptor 1 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_OUT | USB_EP2,       /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            64,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

    /* IAD */
        8,                              /*  0:bLength */
        0x0B,                           /*  1:bDescriptorType*/
        2,                              /*  2:bFirstInterface */
        2,                              /*  3:bInterfaceCount */
        USB_IFCLS_CDCC,                 /*  4:bFunctionClass */
                                        /*  5:bFunctionSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  6:bFunctionProtocol */
        0,                              /*  7:iInterface */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        2,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        1,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCC,                 /*  5:bInterfaceClass */
                                        /*  6:bInterfaceSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_HEADER_FUNC,
            USB_PCDC_BCD_CDC % 256, /*  3:bcdCDC_lo */
            USB_PCDC_BCD_CDC / 256, /*  4:bcdCDC_hi */
        /* Communications Class Functional Descriptorss */
            4,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,          /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_ABSTRACT_CTR_MANAGE_FUNC,
            2,                          /*  3:bmCapabilities */
        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,          /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_UNION_FUNC,
            2,                          /*  3:bMasterInterface */
            3,                          /*  4:bSlaveInterface0 */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_CALL_MANAGE_FUNC,
            /* D1:1-Device can send/receive call management
                    information over a Data Class interface. */
            /* D0:1-Device handles call management itself. */
            3,                          /*  3:bmCapabilities */
            3,                          /*  4:bDataInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN  | USB_EP6,       /*  2:bEndpointAddress */
            USB_EP_INT,                 /*  3:bmAttribute */
            16,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0x10,                       /*  6:bInterval */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        3,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        2,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCD,                 /*  5:bInterfaceClass */
        0,                              /*  6:bInterfaceSubClass */
        0,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN | USB_EP4,        /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            64,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

        /* Endpoint Descriptor 1 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_OUT | USB_EP5,       /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            64,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */
};

uint8_t usb_gpcdc_ConfigrationH1
    [ USB_PCDC_CD1_BLENGTH + ( USB_PCDC_CD1_BLENGTH % 2 ) ] =
{
    9,                                  /*  0:bLength */
    USB_SOFT_CHANGE,                    /*  1:bDescriptorType */
    USB_PCDC_CD1_BLENGTH % 256,         /*  2:wTotalLength(L) */
    USB_PCDC_CD1_BLENGTH / 256,         /*  3:wTotalLength(H) */
    4,                                  /*  4:bNumInterfaces */
    1,                                  /*  5:bConfigurationValue */
    0,                                  /*  6:iConfiguration */
    USB_CF_RESERVED | USB_CF_SELFP,     /*  7:bmAttributes */
    (10 / 2),                           /*  8:MAXPower (2mA unit) */

    /* IAD */
        8,                              /*  0:bLength */
        0x0B,                           /*  1:bDescriptorType */
        0,                              /*  2:bFirstInterface */
        2,                              /*  3:bInterfaceCount */
        USB_IFCLS_CDCC,                 /*  4:bFunctionClass */
                                        /*  5:bFunctionSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  6:bFunctionProtocol */
        0,                              /*  7:iInterface */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        0,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        1,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCC,                 /*  5:bInterfaceClass */
                                        /*  6:bInterfaceSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_HEADER_FUNC,
            USB_PCDC_BCD_CDC % 256, /*  3:bcdCDC_lo */
            USB_PCDC_BCD_CDC / 256, /*  4:bcdCDC_hi */
        /* Communications Class Functional Descriptorss */
            4,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_ABSTRACT_CTR_MANAGE_FUNC,
            2,                          /*  3:bmCapabilities */
        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_UNION_FUNC,
            0,                          /*  3:bMasterInterface */
            1,                          /*  4:bSlaveInterface0 */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_CALL_MANAGE_FUNC,
            /* D1:1-Device can send/receive call management
                    information over a Data Class interface. */
            /* D0:1-Device handles call management itself. */
            3,                          /*  3:bmCapabilities */
            1,                          /*  4:bDataInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN  | USB_EP3,       /*  2:bEndpointAddress */
            USB_EP_INT,                 /*  3:bmAttribute */
            16,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0x10,                       /*  6:bInterval */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        1,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        2,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCD,                 /*  5:bInterfaceClass */
        0,                              /*  6:bInterfaceSubClass */
        0,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN | USB_EP1,        /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            0,                          /*  4:wMAXPacketSize_lo */
            2,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

        /* Endpoint Descriptor 1 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_OUT | USB_EP2,       /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            0,                          /*  4:wMAXPacketSize_lo */
            2,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

    /* IAD */
        8,                              /*  0:bLength */
        0x0B,                           /*  1:bDescriptorType */
        2,                              /*  2:bFirstInterface */
        2,                              /*  3:bInterfaceCount */
        USB_IFCLS_CDCC,                 /*  4:bFunctionClass */
                                        /*  5:bFunctionSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  6:bFunctionProtocol */
        0,                              /*  7:iInterface */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        2,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        1,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCC,                 /*  5:bInterfaceClass */
                                        /*  6:bInterfaceSubClass */
        USB_PCDC_CLASS_SUBCLASS_CODE_ABS_CTR_MDL,
        1,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_HEADER_FUNC,
            USB_PCDC_BCD_CDC % 256, /*  3:bcdCDC_lo */
            USB_PCDC_BCD_CDC / 256, /*  4:bcdCDC_hi */
        /* Communications Class Functional Descriptorss */
            4,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_ABSTRACT_CTR_MANAGE_FUNC,
            2,                          /*  3:bmCapabilities */
        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_UNION_FUNC,
            2,                          /*  3:bMasterInterface */
            3,                          /*  4:bSlaveInterface0 */

        /* Communications Class Functional Descriptorss */
            5,                          /*  0:bLength */
            USB_PCDC_CS_INTERFACE,      /*  1:bDescriptorType */
                                        /*  2:bDescriptorSubtype */
            USB_PCDC_DT_SUBTYPE_CALL_MANAGE_FUNC,
            /* D1:1-Device can send/receive call management
                    information over a Data Class interface. */
            /* D0:1-Device handles call management itself. */
            3,                          /*  3:bmCapabilities */
            3,                          /*  4:bDataInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN  | USB_EP6,       /*  2:bEndpointAddress */
            USB_EP_INT,                 /*  3:bmAttribute */
            16,                         /*  4:wMAXPacketSize_lo */
            0,                          /*  5:wMAXPacketSize_hi */
            0x10,                       /*  6:bInterval */

    /* Interface Descriptor */
        9,                              /*  0:bLength */
        USB_DT_INTERFACE,               /*  1:bDescriptor */
        3,                              /*  2:bInterfaceNumber */
        0,                              /*  3:bAlternateSetting */
        2,                              /*  4:bNumEndpoints */
        USB_IFCLS_CDCD,                 /*  5:bInterfaceClass */
        0,                              /*  6:bInterfaceSubClass */
        0,                              /*  7:bInterfaceProtocol */
        0,                              /*  8:iInterface */

        /* Endpoint Descriptor 0 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_IN | USB_EP4,        /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            0,                          /*  4:wMAXPacketSize_lo */
            2,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */

        /* Endpoint Descriptor 1 */
            7,                          /*  0:bLength */
            USB_DT_ENDPOINT,            /*  1:bDescriptorType */
            USB_EP_OUT | USB_EP5,       /*  2:bEndpointAddress */
            USB_EP_BULK,                /*  3:bmAttribute */
            0,                          /*  4:wMAXPacketSize_lo */
            2,                          /*  5:wMAXPacketSize_hi */
            0,                          /*  6:bInterval */
};


試したINFファイルのデータ(インターフェイス番号指定箇所)は、以下の通りです。

[DeviceList]
%DESCRIPTION%=DriverInstall, USB\VID_0000&PID_000f&MI_00
%DESCRIPTION%=DriverInstall, USB\VID_0000&PID_000f&MI_02

[DeviceList.NTamd64]
%DESCRIPTION%=DriverInstall, USB\VID_0000&PID_000f&MI_00
%DESCRIPTION%=DriverInstall, USB\VID_0000&PID_000f&MI_02


追記 : メモ

uint16_t usb_gpcdc_EpTbl1[] =
{
    USB_PIPE1,
    USB_BULK | USB_BFREOFF | USB_DBLBON | USB_CNTMDOFF | USB_SHTNAKON
        | USB_DIR_P_IN | USB_EP1,
    (uint16_t)USB_BUF_SIZE(512u) | USB_BUF_NUMB(8u),
    USB_SOFT_CHANGE,
    USB_IFISOFF | USB_IITV_TIME(0u),
    USB_CUSE,

    USB_PIPE2,
    USB_BULK | USB_BFREOFF | USB_DBLBON | USB_CNTMDOFF | USB_SHTNAKON
        | USB_DIR_P_OUT | USB_EP2,
    (uint16_t)USB_BUF_SIZE(512u) | USB_BUF_NUMB(24u),
    USB_SOFT_CHANGE,
    USB_IFISOFF | USB_IITV_TIME(0u),
    USB_CUSE,

    USB_PIPE6,
    USB_INT  | USB_DIR_P_IN | USB_EP3,
    (uint16_t)USB_BUF_SIZE(64u) | USB_BUF_NUMB(4u),
    16u,
    USB_IITV_TIME(0u),
    USB_CUSE,

    USB_PIPE3,
    USB_BULK | USB_BFREOFF | USB_DBLBON | USB_CNTMDOFF | USB_SHTNAKON
        | USB_DIR_P_IN | USB_EP4,
    (uint16_t)USB_BUF_SIZE(512u) | USB_BUF_NUMB(8u),
    USB_SOFT_CHANGE,
    USB_IFISOFF | USB_IITV_TIME(0u),
    USB_CUSE,

    USB_PIPE4,
    USB_BULK | USB_BFREOFF | USB_DBLBON | USB_CNTMDOFF | USB_SHTNAKON
        | USB_DIR_P_OUT | USB_EP5,
    (uint16_t)USB_BUF_SIZE(512u) | USB_BUF_NUMB(24u),
    USB_SOFT_CHANGE,
    USB_IFISOFF | USB_IITV_TIME(0u),
    USB_CUSE,

    USB_PIPE7,
    USB_INT  | USB_DIR_P_IN | USB_EP6,
    (uint16_t)USB_BUF_SIZE(64u) | USB_BUF_NUMB(4u),
    16u,
    USB_IITV_TIME(0u),
    USB_CUSE,

/* Pipe end */
    USB_PDTBLEND,
};


関連記事

2013/07/20   blog-entry-310   category: RX /* 32bit CISC */

go page top