Is there a cross-platform β€œport” in the Arduino Serial library?

I want to transfer the Arduino library (namely, the HerkuleX servo controller) from Arduino to a PC (namely, to a Linux-based desktop computer). Since Arduino libraries are written in C ++, this should be pretty easy. However, the HerkuleX library uses the Arduino Serial library, which AFAIK is hardware specific. Does anyone know of a cross-platform sequential library (e.g. Boost.Asio) with the same API as Arduino? I thought for sure that it already exists, but Google could not. If not, I guess I will have to select an existing serial library and create a wrapper around it so that it behaves like an Arduino Serial library. (Thus, if the updated Arduino library is updated, retransmitting it to the PC will not be too complicated.)

+4
source share
1 answer

Unfortunately, the Arduino serial library is not portable. This code is heavily dependent on Arduino hardware and AVR archeochemistry. Here is the source source and header . As you can see in the header file, it includes functions from the AVR library.

0
source

Source: https://habr.com/ru/post/1498779/


All Articles