|
|||||||||||
| 技術(shù)交流 | 電路欣賞 | 工控天地 | 數(shù)字廣電 | 通信技術(shù) | 電源技術(shù) | 測(cè)控之家 | EMC技術(shù) | ARM技術(shù) | EDA技術(shù) | PCB技術(shù) | 嵌入式系統(tǒng) 驅(qū)動(dòng)編程 | 集成電路 | 器件替換 | 模擬技術(shù) | 新手園地 | 單 片 機(jī) | DSP技術(shù) | MCU技術(shù) | IC 設(shè)計(jì) | IC 產(chǎn)業(yè) | CAN-bus/DeviceNe |
請(qǐng)問有沒有高手做過關(guān)于sl811的應(yīng)用的? |
| 作者:ican 欄目:ARM技術(shù) |
請(qǐng)問有沒有源代碼可以參考一下呢?謝謝了。qq:1888712 |
| 2樓: | >>參與討論 |
| 作者: nbmbnn 于 2005/1/12 7:30:00 發(fā)布:
CYPRESS網(wǎng)站上有。 #include <reg52.h> #include "h_8051.h" #include <absacc.h> #define SL811H_ADDR XBYTE[0x8000] // A0 = '0'to external MEMORY #define SL811H_DATA XBYTE[0x8100] // A0 = '1'EZ-USB Dev Kit - SW4 ON) sbit SL_RST=P3^5; sbit LED=P3^4; sbit BUSY=P3^3; xdata BYTE DBUF[64]; //xdata BYTE STATUS[64]; //xdata BYTE HubChange[1]; //xdata BYTE DataBufLen; // EZUSB's IN #3 data transfer buffer length //xdata BYTE pNumPort; // NUMBER of downstream PORTs on hub xdata BYTE remainder; // Remaining byte in a USB transfer xdata pUSBDEV uDev[2]; // Multiple USB DEVICEs attributes, Max 5 DEVICEs //xdata pHUBDEV uHub; // Struct for downstream DEVICE on HUB xdata pDevDesc pDev; // DEVICE descriptor struct xdata pCfgDesc pCfg; // figuration descriptor struct xdata pIntfDesc pIfc; // Interface descriptor struct xdata pEPDesc pEnp; // Endpoint descriptor struct xdata pStrDesc pStr; // String descriptor struct //xdata pHidDesc pHid; // HID class descriptor struct //xdata pHubDesc pHub; // HUD class descriptor struct //xdata pPortStatus pStat; // HID PORTs status //WORD outlen=0; xdata BYTE printdata[4530]; signed int savenow; //***************************************************************************************** // Boolean LOGIC Defines //***************************************************************************************** BOOL SLAVE_FOUND; // Slave USB DEVICE found BOOL SLAVE_ENUMERATED; // slave USB DEVICE enumeration done BOOL FULL_SPEED; // Full-Speed = TRUE, Low-Speed = FALSE //BOOL HUB_DEVICE; // HUB DEVICE = TRUE //BOOL BULK_OUT_DONE; // Set when EZUSB's OUT1 hostcmd xfer is done //BOOL DESC_XFER; // Set when there is data for EZUSB's IN1 desc xfer //BOOL DATA_XFER; // Set when there is data for EZUSB's IN3 data xfer //BOOL DATA_XFER_OUT; // Set when there is data for EZUSB's OUT3 data xfer //BOOL CONFIG_DONE; // Set when EZUSB completes its enumeration PROCESS. BOOL TIMEOUT_ERR; // timeout error during data endpoint transfer BOOL DATA_STOP; // DEVICE unplugged during data transfer //BOOL DATA_INPROCESS; // set when we are in a data pipe transfer //BOOL pLS_HUB; // indicate previous command is a LS DEVICE on hub BOOL ALL_DONE; //BOOL dsPoll; // poll downstream PORT conections BOOL bData1; //int retDataRW = FALSE; void Slave_Detach(void); EZUSB_Delay(BYTE dly) { WORD count; BYTE i; for(i=0;i<=dly;i++) { TL0=0x50; TH0=0xfc; TF0=0; TR0=1; while(!TF0); } TR0=0; } BYTE SL811Read(BYTE a) { //BYTE i,tempa,tempb; //tempb=a; //SL811H_ADDR = tempb; //tempa=SL811H_DATA; //return (tempa); SL811H_ADDR = a; return(SL811H_DATA); } void SL811Write(BYTE a, BYTE d) { //BYTE i,tempa,tempb,tempc,tempd; //tempb=a; //SL811H_ADDR = tempb; //tempb=d; //SL811H_DATA = tempb; SL811H_ADDR = a; SL811H_DATA = d; } //***************************************************************************************** // Buffer Read from SL811H // addr = buffer start address // s = return buffer address where data are to be save/read // c = buffer data length //***************************************************************************************** void SL811BufRead(BYTE addr, BYTE *s, BYTE c) { //BYTE i,tempa,tempb,tempc,tempd; //tempb=addr; //SL811H_ADDR = tempb; //while (c--) // { // tempa = SL811H_DATA; // *s++=tempa; // } SL811H_ADDR = addr; while(c--) *s++=SL811H_DATA; |
|
| 3樓: | >>參與討論 |
| 作者: ican 于 2005/1/12 9:16:00 發(fā)布:
請(qǐng)問你的qq?有事可以請(qǐng)教一下,^^ |
|
|
|
| 免費(fèi)注冊(cè)為維庫電子開發(fā)網(wǎng)會(huì)員,參與電子工程師社區(qū)討論,點(diǎn)此進(jìn)入 |
Copyright © 1998-2006 m.58mhw.cn 浙ICP證030469號(hào) |