阅读:1364回复:3
高分!!关于sl811hst
我用的是ALtera 的nios来控制sl811hst,怎么来确定sl811hst有没有正常工作了,我参考了下载的host_811.c和fw.c,想读出sl811hst的pid,但不对,下面是一段程序,大家帮忙看看,我会毫不吝啬的给分,因为这个项目时间太紧了。
typedef volatile struct { int a_control; int a_address; int a_length; int a_status; int a_count; int ctrl1; int int_enable; int a; int b_control; int b_address; int b_length; int b_status; int b_count; int int_status; int revision; int ctrl2; } np_my_usb; np_my_usb *my_usb = ((np_my_usb *) 0x00001800); my_usb->ctrl2=0xAE; // delay 25 millionsecond nr_delay(25); // reset na_usb_reset -> np_piodata = 0x0; nr_delay(10); na_usb_reset -> np_piodata = 0x1; // SET FULL SPEED my_usb->ctrl1=0x48; // SOF generation my_usb->ctrl1=0x00; // no device attach, clear interrupt status my_usb->int_status=0xff; nr_delay(10); i=my_usb->revision; printf("revision %dn",i); btw:这段我参考了811的app_note. [编辑 - 9/2/04 by tmin2004] |
|
沙发#
发布于:2004-09-02 19:30
读写sl811的时序都对了,但怎么确定sl811已正常工作了呢?急!!
|
|
板凳#
发布于:2004-09-02 21:31
一般读写一下SL811HS的缓冲区就可以了吧。
|
|
地板#
发布于:2004-09-03 09:27
读写缓冲区之前要不要初始化什么的,象我上面的程序中那样的初始化正不正确啊?
|
|