Cypress Semiconductor AN6077 Instrukcja Użytkownika Strona 78

  • Pobierz
  • Dodaj do moich podręczników
  • Drukuj
  • Strona
    / 88
  • Spis treści
  • BOOKMARKI
  • Oceniono. / 5. Na podstawie oceny klientów
Przeglądanie stron 77
APÉNDICES
Apéndice A: Firmware
//-------------------------------------------------------------------------
// File: fw.c
// Contents: Firmware frameworks task dispatcher and
device request parser
//
// $Archive: /USB/Examples/FX2LP/bulkext/fw.c $
// $Date: 3/23/05 2:53p $
// $Revision: 8 $
//
//
//-------------------------------------------------------------------------
// Copyright 2003, Cypress Semiconductor Corporation
//-------------------------------------------------------------------------
#include "fx2.h"
#include "fx2regs.h"
#include "syncdly.h" // SYNCDELAY macro
//-------------------------------------------------------------------------
// Constants
//-------------------------------------------------------------------------
#define DELAY_COUNT 0x9248*8L // Delay for 8 sec at
24Mhz, 4 sec at 48
#define _IFREQ 48000 // IFCLK constant for
Synchronization Delay
#define _CFREQ 48000 // CLKOUT constant for
Synchronization Delay
//-------------------------------------------------------------------------
// Random Macros
//-------------------------------------------------------------------------
#define min(a,b) (((a)<(b))?(a):(b))
#define max(a,b) (((a)>(b))?(a):(b))
//Definiciones varias
#define PACKETSIZE 64
//END Definiciones varias
//-------------------------------------------------------------------------
// Global Variables
//-------------------------------------------------------------------------
volatile BOOL GotSUD;
BOOL Rwuen;
BOOL Selfpwr;
volatile BOOL Sleep; // Sleep mode enable flag
WORD timebase;
BOOL COUNT_en;
BOOL CAD_en;
WORD pDeviceDscr; // Pointer to Device Descriptor;
Descriptors may be moved
WORD pDeviceQualDscr;
WORD pHighSpeedConfigDscr;
WORD pFullSpeedConfigDscr;
WORD pConfigDscr;
WORD pOtherConfigDscr;
WORD pStringDscr;
//-------------------------------------------------------------------------
// Prototypes
//-------------------------------------------------------------------------
void SetupCommand(void);
void TD_Init(void);
void TD_Poll(void);
BOOL TD_Suspend(void);
BOOL TD_Resume(void);
BOOL DR_GetDescriptor(void);
BOOL DR_SetConfiguration(void);
BOOL DR_GetConfiguration(void);
BOOL DR_SetInterface(void);
BOOL DR_GetInterface(void);
BOOL DR_GetStatus(void);
BOOL DR_ClearFeature(void);
BOOL DR_SetFeature(void);
BOOL DR_VendorCmnd(void);
BOOL Get_Packet(BYTE *); //Manuel
BOOL Contador(WORD timebase, BYTE *Packet); //Manuel
// this table is used by the epcs macro
const char code EPCS_Offset_Lookup_Table[] =
{
0, // EP1OUT
1, // EP1IN
2, // EP2OUT
2, // EP2IN
3, // EP4OUT
3, // EP4IN
68
Przeglądanie stron 77
1 2 ... 73 74 75 76 77 78 79 80 81 82 83 ... 87 88

Komentarze do niniejszej Instrukcji

Brak uwag