Cypress Semiconductor AN6077 Manual do Utilizador Página 82

  • Descarregar
  • Adicionar aos meus manuais
  • Imprimir
  • Página
    / 88
  • Índice
  • MARCADORES
  • Avaliado. / 5. Com base em avaliações de clientes
Vista de página 81
}
break;
case SC_SET_FEATURE: // *** Set Feature
if(DR_SetFeature())
switch(SETUPDAT[0])
{
case FT_DEVICE: // Device
if(SETUPDAT[2] == 1)
Rwuen = TRUE; // Enable Remote Wakeup
else if(SETUPDAT[2] == 2)
// Set Feature Test Mode. The core handles this
request. However, it is
// necessary for the firmware to complete the
handshake phase of the
// control transfer before the chip will enter test
mode. It is also
// necessary for FX2 to be physically
disconnected (D+ and D-)
// from the host before it will enter test mode.
break;
else
EZUSB_STALL_EP0(); // Stall End Point 0
break;
case FT_ENDPOINT: // End Point
*(BYTE xdata *) epcs(SETUPDAT[4]) |=
bmEPSTALL;
break;
default:
EZUSB_STALL_EP0(); // Stall End Point 0
}
break;
default: // *** Invalid Command
if(DR_VendorCmnd())
EZUSB_STALL_EP0(); // Stall End Point 0
}
// Acknowledge handshake phase of device request
EP0CS |= bmHSNAK;
}
// Wake-up interrupt handler
void resume_isr(void) interrupt WKUP_VECT
{
EZUSB_CLEAR_RSMIRQ();
}
//-------------------------------------------------------------------------
// File: Manuel.c
// Contents: Hooks required to implement USB peripheral
function.
//
// $Archive: /USB/Examples/FX2LP/bulkloop/bulkloop.c $
// $Date: 3/23/05 2:55p $
// $Revision: 4 $
//
//
//-------------------------------------------------------------------------
// Copyright 2003, Cypress Semiconductor Corporation
//-------------------------------------------------------------------------
#pragma NOIV // Do not generate interrupt vectors
#include "fx2.h"
#include "fx2regs.h"
#include "syncdly.h" // SYNCDELAY macro
#include "intrins.h" //Manuel
extern BOOL GotSUD; // Received setup data flag
extern BOOL Sleep;
extern BOOL Rwuen;
extern BOOL Selfpwr;
BYTE Configuration; // Current configuration
BYTE AlternateSetting; // Alternate settings
#define VR_NAKALL_ON 0xD0
#define VR_NAKALL_OFF 0xD1
//Vendor commands para el CAD
#define VR_COUNT_EN 0xFF
#define VR_TIMEBASE_1MS 0xFE
#define VR_TIMEBASE_10MS 0xFD
#define VR_TIMEBASE_100MS 0xFC
#define VR_TIMEBASE_1S 0xFB
#define VR_COUNT_DIS 0xFA
//Vendor commands para el CAD
#define VR_CAD_EN 0xF9
#define VR_CAD_DIS 0xF8
//Vendor commands para el CAD
//Vendor commands genericos
#define VR_STOP_ALL 0xF7
//Definiciones CAD
#define StartConversion ~bmBIT0
#define PortB0_OUTEN bmBIT0
72
Vista de página 81
1 2 ... 77 78 79 80 81 82 83 84 85 86 87 88

Comentários a estes Manuais

Sem comentários