Crates.io | iowarrior-embedded-hal |
lib.rs | iowarrior-embedded-hal |
version | 0.1.0 |
source | src |
created_at | 2024-07-11 22:08:49.570825 |
updated_at | 2024-07-11 22:08:49.570825 |
description | A Rust library that provides access to the IOWarrior GPIO, I2C, PWM, SPI and ADC peripherals. |
homepage | |
repository | https://github.com/Tederean/iowarrior-embedded-hal |
max_upload_size | |
id | 1300072 |
size | 144,891 |
A Rust library that provides access to the IOWarrior GPIO, I2C, PWM, SPI, and ADC peripherals.
Both embedded-hal v0.2.7 and v1 are supported.
There are three different backends available to interact with the IOWarrior boards. The backends can be selected as a crate feature:
iowkit: This is the default backend, written in C, provided by Code Mercenaries. The iowkit library is dynamically loaded at runtime. You have to 'install' the official IOWarrior-SDK. This backend is supported by Windows and Linux.
usbhid: This is an experimental backend and is only available on Windows. It is a pure Rust implementation and interacts directly with the WIN32 HID API.
ioctrl: This is also an experimental backend and is only available on Linux. It is a pure Rust implementation and interacts directly with the ioctrl kernel interface.
The backends can be selected as a Rust feature. By default, iowkit is selected.
Example for Ubuntu 24.04, other distros may differ:
# Auto load iowarrior kernel module at boot
echo 'iowarrior' | sudo tee /etc/modules-load.d/iowarrior.conf
# Allow dialout user group to access IOWarrior devices
echo 'KERNEL=="iowarrior*", NAME="usb/iowarrior%n", OWNER="root", GROUP="dialout", MODE="0666"' | sudo tee /etc/udev/rules.d/99-iowarrior.rules
# Repeat for every user: Add user X to dialout group
sudo usermod -a -G dialout X
# Reboot to let changes take place
sudo reboot