Cypress Semiconductor AN6077 Guía de usuario Pagina 65

  • Descarga
  • Añadir a mis manuales
  • Imprimir
  • Pagina
    / 107
  • Tabla de contenidos
  • MARCADORES
  • Valorado. / 5. Basado en revisión del cliente
Vista de pagina 64
CY3687 MoBL-USB FX2LP18 Development Kit User Guide, Doc. # 001-68582 Rev. *B 65
MoBL-USB Development Kit Firmware Examples
8.3 IBN Firmware Example
8.3.1 Description
This example illustrates the configuration of MoBL-USB FX2LP18 to accept bulk data from the host
and loop it back to the host using an IN-BULK-NAK interrupt. Click on ibn.Uv2 project file at
<Installed_directory>\<Version>\Firmware\ibn. In TD_init() function of ibn.c file four endpoints are
configured to handle bulk transfer: two OUT endpoints and two IN endpoints. The four endpoints
defined in the descriptor file have to be configured in this function. This is done by the following
statements:
EP2CFG = 0xA2;
SYNCDELAY;
EP4CFG = 0xA0;
SYNCDELAY;
EP6CFG = 0xE2;
SYNCDELAY;
EP8CFG = 0xE0
The key characteristics of each endpoint are as follows:
Endpoint 2 - OUT, Bulk, double buffered
Endpoint 4 - OUT, Bulk, double buffered
Endpoint 6 - IN, Bulk, double buffered
Endpoint 8 - IN, Bulk, double buffered
Writing to these registers typically takes more than two clock cycles needed for a MOVX instruction.
Therefore, the SYNCDELAY, already defined, is added. The TRM provides the list of registers that
need this delay function when writing to them. The OUT endpoints, after they are configured, need to
be ARMed to accept packets from the host. Because the endpoints are double-buffered, you must
arm the endpoint twice. Arming is essentially freeing up the buffers and making them available to the
host to receive packets.
By writing a 1 to bit7 of the byte count register the endpoint is ARMed.
EP2BCL = 0x80; // arm EP2OUT by writing byte count w/skip.
SYNCDELAY;
EP2BCL = 0x80;
SYNCDELAY;
EP4BCL = 0x80; // arm EP4OUT by writing byte count w/skip.
SYNCDELAY;
EP4BCL = 0x80;
The lines above arm the two OUT endpoints by skipping two packets of data making the buffers
available to receive OUT data:
NAKIRQ = bmBIT0; // clear the global IBN IRQ
NAKIE |= bmBIT0; // enable the global IBN IRQ
IbnFlag = 0x00; // clear our IBN flag
IBNIRQ = 0xFF; // clear any pending IBN IRQ
IBNIE |= bmEP6IBN | bmEP8IBN; // enable the IBN interrupt
for EP6 and EP8
The firmware clears the In-Bulk-NAK flags of all endpoints and any pending In-Bulk-NAK interrupts
and enables the In-Bulk-NAK interrupt for EP6 and EP8.
AUTOPTRSETUP |= 0x01;
This enables the AUTO pointer used for data transfer in the TD_Poll() function. The loopback is
implemented in the TD_Poll function which is called repeatedly when the device is idle. Endpoints 2
Vista de pagina 64
1 2 ... 60 61 62 63 64 65 66 67 68 69 70 ... 106 107

Comentarios a estos manuales

Sin comentarios

GE 106808B manuály

Uživatelské manuály a uživatelské příručky pro Toustovače GE 106808B.
Poskytujeme 1 manuály pdf GE 106808B ke stažení zdarma podle typů dokumentů: Uživatelský manuál






Další produkty a příručky pro Toustovače GE

Modely Typ Dokumentu
681131691154 Uživatelský manuál   GE 681131691154 User Manual, 11 stránky
681131690966 Uživatelský manuál   GE 681131690966 User Manual, 10 stránky
840085000 Uživatelský manuál    GE 840085000 User Manual, 10 stránky
106678 Uživatelský manuál    GE 106678 User Manual, 10 stránky
840115100 Uživatelský manuál    GE 840115100 User Manual, 11 stránky
681131690461 Uživatelský manuál    GE 681131690461 Manuel d'utilisation, 12 stránky
681131691369 Uživatelský manuál   GE 681131691369 User Manual, 10 stránky
169145 Uživatelský manuál    GE 169145 User Manual, 10 stránky
169045 Uživatelský manuál     GE 169045 User Manual, 18 stránky
106686 Uživatelský manuál    GE 106686 User Manual, 24 stránky
840120800 Uživatelský manuál     GE 840120800 User Manual, 15 stránky
168989 Uživatelský manuál     GE 168989 User Manual, 48 stránky
840146000 Uživatelský manuál   GE 840146000 User Manual, 7 stránky
169054 Uživatelský manuál   GE 169054 User Manual [en] [fr] , 10 stránky
169235 Uživatelský manuál   GE 169235 User Manual, 11 stránky
840108400 Uživatelský manuál    GE 840108400 User Manual, 24 stránky
840085100 Uživatelský manuál    GE 840085100 Manuel d'utilisation, 10 stránky
169116 Uživatelský manuál   GE 169116 User Manual, 10 stránky
169104 Uživatelský manuál   GE 169104 User Manual, 9 stránky
106801 Uživatelský manuál   GE 106801 Manual del usuario, 10 stránky