Skip to content
Uwe Vogt edited this page Jun 21, 2021 · 8 revisions

macOS® User-Space Driver for TouCAN USB Interfaces from Rusoku

Copyright © 2020-2021 Uwe Vogt, UV Software, Berlin ([email protected])
All rights reserved.

Running CAN on Mac®

Rusoku Technologies is an innovative engineering team based in Lithuania, Europe. They offer CAN adapter at a reasonable price. Drivers and utilities for Windows and Linux are available as open-source. A macOS user-space driver for TouCAN USB interfaces from Rusoku is provided by UV Software.

MacCAN-TouCAN Driver

The macOS driver for TouCAN USB Interfaces from Rusoku is based on MacCAN-Core which is an abstraction (or rather a wrapper) of Apple´s IOUsbKit to create USB user-space drivers for CAN interfaces from various vendors under macOS. The GitHub repository contains the source code for the MacCAN-TouCAN driver and several alternatives to build dynamic libraries for macOS, either as a C++ class library (libTouCAN), or as a CAN API V3 wrapper library (libUVCANTOU), as well as some example programs and my beloved CAN utilities can_moni and can_test.

The MacCAN-TouCAN driver comes with an CAN API V3 compatible API. CAN API V3 is a wrapper specification by UV Software to have a uniform CAN Interface API for various CAN interfaces from different vendors running under multiple operating systems. See header file CANAPI.h for the CAN API V3 wrapper specification.

Features

Feature Supported Remarks
CAN 2.0 ✔️ Classical CAN
CAN FD Flexible Data-rate CAN
Bit-rate, CAN 2.0 ✔️ high speed: up to 1 Mbps
Bit-rate, CAN FD nominal: up to 1 Mbps
data phase: up to 8 Mbps
11-bit identifier (STD) ✔️ CAN 2.0 and CAN FD
29-bit identifier (XTD) ✔️ CAN 2.0 and CAN FD
Remote frames (RTR) ✔️ CAN 2.0 only
Error frames (ERR) ✔️ CAN 2.0 and CAN FD
Error indicator (ESI) CAN FD only
Bit-rate switching (BRS) CAN FD only
Listen-only mode (MON) ✔️ CAN 2.0 and CAN FD
Identifier filtering CAN 2.0 and CAN FD
Operation modes:
- Monitor mode enable/disable (MON) ✔️ disabled by default
- Error frames enable/disable (ERR) ✔️ disabled by default
- Remote frames disable/enable (NRTR) not supported
- Extended frames disable/enable (NXTD) not supported
- Shared access enable/disable (SHRD) not supported
- Non-ISO CAN FD enable/disable (NISO) not supported
- Bit-rate switching enable/disable (BRSE) disabled by default
- CAN FD operation enable/disable (FDOE) disabled by default
Bit-rate settings:
- Pre-defined bit-timing indexes ✔️ acc. CiA CANopen specification
- BTR register values ✔️ register fields:
- freq (clock frequency in [Hz])
- brp (bit-rate prescaler)
- tseg1 (time segment 1)
- tseg2 (time segment 2)
- sjw (synchronization jump width)
- sam (number of samples)
Message reception:
- Message queue (FIFO) ✔️ up to 64K CAN messages
- Polling ✔️ return immediately
- Timed out ✔️ wait up to 65'534 milliseconds
- Blocking read ✔️ wait infinitely
Message transmission:
- Acknowledged write not supported
- Buffered write ✔️ buffer size depends on the hardware
Software Development Kit:
- VSCP CANAL API not available
- CAN API V3 ✔️ C API and C++ API by UV Software
- Dynamic library ✔️ libUVCANTOU.dylib, libTouCAN.dylib
- Static library ✔️ libUVCANTOU.a, libTouCAN.a
- Source code ✔️ GPL-3.0-or-later
- Apple silicon not tested
- Swift wrapper ✔️ Swift 5.4 (including SPM)
- Python wrapper ✔️ Python 2.7 and 3.8
- Windows wrapper ✔️ not available
- Utilities ✔️ CLI utilities can_moni and can_test
- Examples ✔️ C, C++, Swift, Python

Supported Devices

Only the following devices from Rusoku Technologies are supported:

  • TouCAN USB (Model F4FS1)

For technical specifications, prices and delivery terms see Rusoku´s website.

Known Bugs and Caveats

For a list of known bugs and caveats see tab Issues in the GitHub repo.

License

MacCAN-TouCAN is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

MacCAN-TouCAN is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with MacCAN-TouCAN. If not, see <http://www.gnu.org/licenses/>.

Trademarks

Mac and macOS are trademarks of Apple Inc., registered in the U.S. and other countries.
Windows is a registered trademark of Microsoft Corporation in the United States and/or other countries.
Linux is a registered trademark of Linus Torvalds.
All other company, product and service names mentioned herein are trademarks, registered trademarks or service marks of their respective owners.

Hazard Note

If you connect your CAN device to a real CAN network when using this library, you might damage your application.

Contact

E-Mail: mailto://[email protected]
Internet: https://www.mac-can.com

Enjoy!
Clone this wiki locally