Reputation: 11
I am trying to interface USB Printer (Brother HL-1111 series printer) using Vincullum -II Host Controller IC . I am able to enumerate the printer via USB port of controller but when I send PCL5 commands or any text to Printer , it is not able to print anything.
The enumeration status is shown in below image.
I send text to printer using below API,
// devCaps1 contains some String
if (vos_dev_write(hPrinter,(unsigned char *)devCaps1 , 10 , NULL) == USBHOSTPRINTER_OK)
{
//Print this status to serial terminal
message("Check Printer Output\r\n");
}
I send commands for Printer using below API,
//Esc(3@ or (27)(40)(51)(64)[Decimal] or <1Bh><28h><33h><40h>[Hex] For selecting default Font
//uint8 vos_dev_write(VOS_HANDLE h,uint8 *buf,uint16 num_to_write,uint16 *num_written);
//h - is for handle
vos_dev_write(hPrinter,(char) 27 , 1 , NULL);
vos_dev_write(hPrinter,(char) 40 , 1 , NULL);
vos_dev_write(hPrinter,(char) 51 , 1 , NULL);
vos_dev_write(hPrinter,(char) 64 , 1 , NULL);
So, Please Guide me to execute commands via USB.
Am i going in correct way or wrong way?
Upvotes: 1
Views: 267