Recent

Author Topic: INPUT - OUTPUT via USB  (Read 7786 times)

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: INPUT - OUTPUT via USB
« Reply #15 on: January 31, 2022, 10:42:51 am »
For pipes, this is as low-level as it gets on windows. But I don't think there's an FPC version.

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: INPUT - OUTPUT via USB
« Reply #16 on: January 31, 2022, 10:45:20 am »
For HID you can try FPC-USB-HID, it has no external dependencies.

Except that that is a substantial external library in itself, and it relies heavily on the operating system i.e. is a long way from direct ports access.

I sympathise with minimising dependencies, but trying to go all the way to the hardware is the sort of dumb thing I'd have tried many years ago. Don't.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

McClane

  • New Member
  • *
  • Posts: 44
Re: INPUT - OUTPUT via USB
« Reply #17 on: January 31, 2022, 02:19:08 pm »
Thank you guys. I appreciate your help.
I understand I cannot handle USB ports by myself, I need to use an external library like libusb or Synaser right?
I wish you all a nice day.

ccrause

  • Hero Member
  • *****
  • Posts: 856
Re: INPUT - OUTPUT via USB
« Reply #18 on: January 31, 2022, 02:56:41 pm »
Hi oproescu, I want to learn to turn my cam on. I have a laptop with a cam on it and I'm a linux user.
To get back to your camera specific question - on Linux you could try 5dpo.  This seems like a Pascal only solution that interfaces with a Linux kernel driver.
« Last Edit: January 31, 2022, 03:05:41 pm by ccrause »

MarkMLl

  • Hero Member
  • *****
  • Posts: 6686
Re: INPUT - OUTPUT via USB
« Reply #19 on: January 31, 2022, 03:00:00 pm »
Thank you guys. I appreciate your help.
I understand I cannot handle USB ports by myself, I need to use an external library like libusb or Synaser right?
I wish you all a nice day.

Synaser is specific to serial ports, serial.pp is a low-level alternative.

If you're talking to something USB-connected that looks like a disc, network device or serial port then assume the OS will present it via the standard APIs. If you're looking at an HID then either use somebody's pre-existing high-level (-ish) library or a kernel API: I've got into deep water in the past trying to get low-level Linux HID access because there were kernel-level libraries which appeared to assume that they were compiled using the same toolset... alignment/padding nasties.

If you're talking to an arbitrary device then libusb is pretty much unavoidable, although be warned that in some cases you might need privileged access so that you can say to the kernel "let me handle this one".

If you really do want to start tinkering at a low level, and I'd stress that there's nothing wrong with that if you've got /lots/ of time and like hardware reference manuals, then get in touch with the Ultibo developers and see where they're at and whether they can use help. Otherwise ReactOS (on a PC) or something like https://github.com/salvois/kernel which has an attractive architecture and would no doubt benefit from enthusiastic assistance.

Finally, I'd stress that I'm not trying to be negative but one has to put some sort of limit on what's doable.

MarkMLl
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

SymbolicFrank

  • Hero Member
  • *****
  • Posts: 1313
Re: INPUT - OUTPUT via USB
« Reply #20 on: February 01, 2022, 10:11:48 am »
Well, I did make one of those low-level piped ones for Windows in Delphi about a decade ago, but I cannot find it anymore. It's a recurring thing, especially because you really need a virtual COM-port in Windows to make most USB devices that aren't HID or block devices usable.

It wasn't even very large or all that hard, but it took a lot of time to figure out.

Btw, low-level access on Linux is just as hard.
« Last Edit: February 01, 2022, 10:18:06 am by SymbolicFrank »

 

TinyPortal © 2005-2018