Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Serial port or USB port using D?

Tags:

usb

d

serial-port

I'm new using the D programming language and I was wondering if D can make use of the Serial port or usb port?

like image 892
Raul Avatar asked Jul 17 '11 22:07

Raul


People also ask

Is serial port same as USB port?

USB allows data to travel on the average of ten times the speed of the normal parallel port. It is also faster than a serial port. The average serial port transfer rate is 150 kbps; the USB port is up to 12 Mbps. USB 2 is forty times faster, with a maximum transfer rate of 480 Mbps.

What port does serial use?

The serial port standard is RS-232. This standard is used for transmitting serial communication between devices, which are usually called data communications equipment (DCE) and data terminal equipment (DTE). The serial port uses a nine-pin (DE-9) connector or a 25-pin (DB-25) connector.

Does USB use serial data transfer?

Universal Serial Bus (USB) is a type of cable and connector commonly used for half-duplex or full-duplex serial data transmission between a computer and attached devices.


2 Answers

That would presumably involve system calls of some kind, which would be in C, but you can call C functions from D, so unless there's a library that will wrap it for you (which I rather doubt), you'll have to figure out what the appropriate C calls are and use them.

like image 150
Jonathan M Davis Avatar answered Sep 17 '22 20:09

Jonathan M Davis


Creating bindings to C libraries is pretty straightforward in D, so you might try libusb for cross-system USB access.

like image 32
Justin W Avatar answered Sep 20 '22 20:09

Justin W