-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Implement Printer Device Driver #3444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
I apparently made a mistake when copying/renaming this file, file content was that of printer_device.c.
|
Well I apparently made (at least) one major mistake when moving the code from my local project to the repository fork. The content of printer.h and printer_device.c is the same, leading to (part of) the compilation errors. I'll work on that and the other problems raised by the CI pipeline. |
|
Ok, I'm realizing that I developed this locally against version 0.18.0 but tried to merge it in version 0.20.0. This is not the only problem but I am back on track. I'll see what was changed between the two releases and update the device driver accordingly. |
|
In my terminal, compilation and upload of the The last line is automatically typed by the HID device. Only alphanumeric characters are handled by the example program, but other characters could be translated to HID keycodes too. The printer endpoint receives UTF8. CircleCI has caught one remaining |
|
Looking forward to your feedback! I believe I’ve addressed the issues in the sections of code I added. If there’s anything else you'd like me to revisit or any concerns with the implementation, please let me know. I’m happy to make further adjustments. |
Size Difference ReportBecause TinyUSB code size varies by port and configuration, the metrics below represent the averaged totals across all example builds. Note: If there is no change, only one value is shown. Changes >1% in size
Changes <1% in sizeNo entries. No changes
|
|
Hi, thank you for adding printer driver ! I've just tested that it's working on Windows 11 with a manual driver install, I'll leave my reviews below. |
|
Thank you, I am looking forward to feedback. The tests I could perform on Windows indeed reveal that detection of the printer is not 100% automatic, and there is a need to "install" the printer (same on linux) from the configuration menu. At least there is no need to use admin privileges, download or execute dependencies, which is sufficient for my use case. In the interest of TinyUSB as a whole, however, it is interesting to see if that can be improved. I suppose the printer description, which is currently hardcoded here : https://github.com/hathach/tinyusb/pull/3444/files#diff-d649fb44fa8e4a9383e3d84eefb7efd336196be0c8dc66028dd949b45b531437R247 can be adjusted. Switching to a config-defined value is an obvious improvement. I am also trying to understand what the printer device is supposed to respond to the host on the BULK IN endpoint. |
Describe the PR
Implement a printer device driver for USB Printers. The example illustrates receiving data from a host, the device driver as-is is recognized by the generic printer drivers on linux (and I assume, Windows too).
This allows sending binary data to the device, with no specific drivers, using tools like
lp -o raw.Additional context
The example compiles and works on a Pi Pico.
I am not yet sure about integration of the changes in the build toolchain. I have not yet understood if I have to manually edit all the
hw/{bsp,mcu}/file to include the device driver in cmake source lists.