// filename: USB_DEFS.H // Author: Dario Greggio (based on Dan Butler's work from Microchip) // Company: ADPM Synthesis sas //#define TRUE 1 //#define FALSE 0 //#define NULL 0 #define NUM_CONFIGURATIONS 1 #define NUM_INTERFACES 1 #define LUNGHEZZA_ENDPOINT_0 8 // qui la DOC USB dice che può essere 8/16/32/64; Microchip dice sempre che il max è 8... (e infatti va SOLO con 8, x 16 non c'è abbastanza RAM) #define BEEP_STD_FREQ 100 #define AUDIO_BOOST_2 // v. SPITXDAC //#define AUDIO_BOOST_4 // il Timer0 conta ogni 83.3nSec*prescaler... (@48MHz CPUCLK => 12MHz) #define TMR0BASE (65536-55000) // ca 40mSec #define TMR0BASE_SUONA (65536-60) // 45uSec //#define DELAY_CORREZ (10) // 22/1/2006, v.anche pelucheUSB.c #define SIZEOF_SPIBUFFER 128 #define CR 0xd #define LF 0xa #define STX 2 #define ETX 3 #define ACK 6 #define NACK 26 #define SERNUM 1000 #define VERNUMH 2 #define VERNUML 10 union LONG_4BYTE { byte b[4]; unsigned long l; }; extern near union LONG_4BYTE SPIAddr,SPIAddr2; extern near byte SPIBufferPtr; extern byte SPIBuffer[SIZEOF_SPIBUFFER]; void SPISTART_B(byte ); void SPISTOP_B(byte ); void SPISTART_C(byte ); void SPISTOP_C(byte ); void SPIBITOUT(char ); char SPIBITIN(void); char SPITXByte(byte ); char SPITXByteFast(byte ); byte SPIRXByte(void); byte SPIRXByteFast(void); void SPITXDAC(byte ); byte SPIReadByte(void); void SPIReadPage24(void); void SPIWritePage24(void); void SPIWritePoll(void); void SPIWriteByte(byte ); void SPIMemoryErasePage(void); void SPIErasePoll(void); void SPIMemoryWriteWREN(void); void SPIMemoryWriteWRDI(void); void fineSuonaBrano(void); #define Delay_S() Delay_S_(10) // circa 1s @ 48MHz !! void Delay_S_(byte); void Delay08(void); #define Delay_1mS() Delay_mS(1) void Delay_mS(byte); void Delay_uS(byte); #define SPI_DELAY() { /*Nop();*/ } // circa 500nSec (1MHz operation) // MANUFACTURER_ID=0x115f (ADPM) = 4447 // PRODUCT_IDs // 0x101=tastiera Mac-Ktronic // 0x102=tastiera/mouse Ktronic // 0x103=mouse Interlink (anche PS/2 autosensing) Ktronic // 0x104=tastiera 6 tasti Ktronic e anche Remote Keyboard ADPM // 0x201=Skynet USB RS485 // 0x202=Skynet USB Onde convogliate // 0x203=Skynet USB Wireless CC900 // 0x204=Skynet USB Wireless Aurel // 0x210=SkyPIC USB per Eprom tradizionali/parallele/PIC // 0x220=USB_RELE scheda I/O USB // 0x230=PELUCHEUSB Giocattolo con MP3/musica // 0x240=Analizzatore logico USB