Content originally posted in LPCWare by elmira.n.f on Sun Jul 13 01:32:59 MST 2014
Quote:
Keil don't provide enough information to implement host for "USB Device Class" yet.
There is no working example for this option. It means, they haven't finished this option yet.
I know they haven't finish this option, I try to wrote it by changing the MSC and compatible it for printer class, by reading the printer class document on usb.org and find the information of my printer by USBLyzer.
Quote:
No one has misled you, except for your "sixth sense" ;-)
Isn't it the time when you should learn your "sixth sense" isn't reliable at all?
may be sixth sense is reliable but my think is fact, sixth sense means some thing not fact right now but you feel it. ;-)
because of my research and find some code and some way(!) I don't know which one is true! :~
Quote:
Huh?
I've given enough help. Did you try it?
Yes sure you helped me ,I know and again I'm saying you thank you so much. :)
I wrote two post but I don't know what happened for my second post(it hapend may be because of my internet!!!)
Certainly I try this solution but I gave some problem:
when I run this program on my board it doesn't work and print any paper, I see 2problem:
1- Some times in Host_EnumDev() function, program still in loop:
while (!HOST_RhscIntr);
and it doesn't exit from this while.
2- if exit from this while and continues the program by placing break point I found that EDBulkOut->Control isn't initialize and this value still on 0x00000000
EDBulkOut->Control = 1 | /* USB address */
(2 << 7) | /* Endpoint address */
(1 << 11) | /* direction */
(64 << 16); /* EP MaxPkt Size */
my main program:
int main()
{
int32_t i , j;
unsigned char b;
int32_t rc;
uint32_t numBlks, blkSize;
uint8_t inquiryResult[INQUIRY_LENGTH];
LPC_RTC->CCR = 0x11;
/* SystemClockUpdate() updates the SystemFrequency variable */
SystemClockUpdate();
Host_Init(); /* Initialize the lpc17xx host controller */
rc = Host_EnumDev(); /* Enumerate the device connected */
if (rc == OK)
{
EDBulkOut->Control = 1 | /* USB address */
(2 << 7) | /* Endpoint address */
(1 << 11) | /* direction */
(64 << 16); /* EP MaxPkt Size */
// fill TDBuffer with print data, here
TDBuffer[0] = 0x1B; /*initialize printer*/
TDBuffer[1] = 0x40;
TDBuffer[2] = 0x1B; /*bit image mode*/
TDBuffer[3] = 0x2A;
TDBuffer[4] = 33;
TDBuffer[5] = 10;
for(j = 0; j < 5; j++) /*my printer's data*/
{
TDBuffer[6 + (2*j)] = 0x11;
TDBuffer[6 + (2*j) + 1] = 0x00;
}
TDBuffer[16] = 0x0D ;
TDBuffer[17] = 0x0A ;
// send TDBuffer to the printer
rc = Host_ProcessTD(EDBulkOut, TD_OUT, TDBuffer, 18);
}
}
What should I do?
Thank you