]> sigrok.org Git - sigrok-firmware-fx2lafw.git/commitdiff
Eliminate EP1, commands should use EP0.
authorUwe Hermann <redacted>
Tue, 21 Feb 2012 00:30:33 +0000 (01:30 +0100)
committerUwe Hermann <redacted>
Tue, 21 Feb 2012 00:30:33 +0000 (01:30 +0100)
The protocol should be implemented using control requests of type
'vendor-specific' (bmRequestType[6:5] = 2).

dscr.a51
fx2lafw.c

index 1337a3952ed22e2545348f010c8c7bacc3ac8c1a..735e55d30ff46649c7cd9e1bd87a32361f917454 100644 (file)
--- a/dscr.a51
+++ b/dscr.a51
@@ -97,21 +97,12 @@ highspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
        .db     0                       ; String index (none)
 
-       ; Endpoint 1 (OUT)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x01                    ; EP number (1), direction (OUT)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x00                    ; Max. packet size, LSB (512 bytes)
-       .db     0x02                    ; Max. packet size, MSB (512 bytes)
-       .db     0x00                    ; Polling interval
-
        ; Endpoint 2 (IN)
        .db     DSCR_ENDPOINT_LEN
        .db     DSCR_ENDPOINT_TYPE
@@ -146,21 +137,12 @@ fullspd_dscr_end:
        .db     DSCR_INTERFACE_TYPE
        .db     0                       ; Interface index
        .db     0                       ; Alternate setting index
-       .db     2                       ; Number of endpoints
+       .db     1                       ; Number of endpoints
        .db     0xff                    ; Class (vendor specific)
        .db     0xff                    ; Subclass (vendor specific)
        .db     0xff                    ; Protocol (vendor specific)
        .db     0                       ; String index (none)
 
-       ; Endpoint 1 (OUT)
-       .db     DSCR_ENDPOINT_LEN
-       .db     DSCR_ENDPOINT_TYPE
-       .db     0x01                    ; EP number (1), direction (OUT)
-       .db     ENDPOINT_TYPE_BULK      ; Endpoint type (bulk)
-       .db     0x40                    ; Max. packet size, LSB (64 bytes)
-       .db     0x00                    ; Max. packet size, MSB (64 bytes)
-       .db     0x00                    ; Polling interval
-
        ; Endpoint 2 (IN)
        .db     DSCR_ENDPOINT_LEN
        .db     DSCR_ENDPOINT_TYPE
index 1b0b90e3d52eecb11c07153de8f22b50df8e5cfe..7972060f81de411c679c7d32b4bd98f75eb7086f 100644 (file)
--- a/fx2lafw.c
+++ b/fx2lafw.c
@@ -243,15 +243,6 @@ static void gpif_init_la(void)
 
 static void setup_endpoints(void)
 {
-       /* Setup EP1 (OUT). */
-       EP1OUTCFG = (1 << 7) |            /* EP is valid/activated */
-                   (0 << 6) |            /* Reserved */
-                   (1 << 5) | (0 << 4) | /* EP Type: bulk */
-                   (0 << 3) |            /* Reserved */
-                   (0 << 2) |            /* Reserved */
-                   (0 << 1) | (0 << 0);  /* Reserved */
-       SYNCDELAY();
-
        /* Setup EP2 (IN). */
        EP2CFG = (1 << 7) |               /* EP is valid/activated */
                 (1 << 6) |               /* EP direction: IN */
@@ -261,7 +252,11 @@ static void setup_endpoints(void)
                 (0 << 1) | (0 << 0);     /* EP buffering: quad buffering */
        SYNCDELAY();
 
-       /* Disable all other EPs (EP4, EP6, and EP8). */
+       /* Disable all other EPs (EP1, EP4, EP6, and EP8). */
+       EP1INCFG &= ~bmVALID;
+       SYNCDELAY();
+       EP1OUTCFG &= ~bmVALID;
+       SYNCDELAY();
        EP4CFG &= ~bmVALID;
        SYNCDELAY();
        EP6CFG &= ~bmVALID;
@@ -269,9 +264,8 @@ static void setup_endpoints(void)
        EP8CFG &= ~bmVALID;
        SYNCDELAY();
 
-       /* Reset the FIFOs of EP1 and EP2. */
+       /* EP2: Reset the FIFOs. */
        /* Note: RESETFIFO() gets the EP number WITHOUT bit 7 set/cleared. */
-       RESETFIFO(0x01)
        RESETFIFO(0x02)
 
        /* EP2: Enable AUTOIN mode. Set FIFO width to 8bits. */
@@ -284,7 +278,7 @@ static void setup_endpoints(void)
        EP2AUTOINLENL = 0x00;
        SYNCDELAY();
 
-       /* Set the GPIF flag for EP2 to 'full'. */
+       /* EP2: Set the GPIF flag to 'full'. */
        EP2GPIFFLGSEL = (1 << 1) | (0 << 1);
        SYNCDELAY();
 }
@@ -292,6 +286,12 @@ static void setup_endpoints(void)
 BOOL handle_vendorcommand(BYTE cmd)
 {
        (void)cmd;
+
+       /*
+        * TODO: Implement the protocol using control requests of type
+        * 'vendor-specific' (bmRequestType[6:5] = 2).
+        */
+
        return FALSE;
 }
 
@@ -317,13 +317,10 @@ BOOL handle_set_interface(BYTE ifc, BYTE alt_ifc)
 
        /* (2) Reset data toggles of the EPs in the interface. */
        /* Note: RESETTOGGLE() gets the EP number WITH bit 7 set/cleared. */
-       RESETTOGGLE(0x01);
        RESETTOGGLE(0x82);
 
        /* (3) Restore EPs to their default conditions. */
        /* Note: RESETFIFO() gets the EP number WITHOUT bit 7 set/cleared. */
-       RESETFIFO(0x01);
-       /* TODO */
        RESETFIFO(0x02);
        /* TODO */