Dzisiejszy wpis w dzienniku:
Od początku naszego małżeństwa z Kingą wydawało mi się, że wszystko układa się idealnie. Pobraliśmy się, gdy oboje mieliśmy już dobrze po trzydziestce, a pierwsze trzy lata naszego wspólnego życia były pełne harmonii – zarówno pod względem uczuć, jak i finansów. Kinga pracowała na prestażowym stanowisku w dużej firmie, zarabiając naprawdę dobrze. Ja nie pozostawałem w tyle, choć moje zarobki były nieco skromniejsze. Nigdy jednak nie było między nami napięć z tego powodu. Kinga nigdy nie podkreślała różnicy w naszych dochodach, a budżet planowaliśmy razem, dzieląc się wszystkimi sprawami po równo.
Wszystko zmieniło się, gdy na świat przyszła nasza córeczka, Zosia. King# icp-das-usb-4718 for linux
Drivers for ICP DAS usb-4718 module for linux.
**Purpose of this repository is to introduce linux drivers for ICP DAS USB-4718 module to community.**
**IPC DAS USB-4718** is a DAQ module with 16 analog inputs, 8 digital outputs, 8 digital inputs, 2 analog outputs and one counter input. Official linux drivers from ICP DAS [are available here](https://www.icpdas.com/en/support/download.php?model=usb-4718) for different version.
## Installation
1. Download Driver Source
2. `cd` into folder
3. run `./configure` for configuration (optional)
4. run `make` to build modules
5. run `sudo make install` to install modules in linux `/lib` folder
6. run `sudo udevadm control –reload-rules && sudo udevadm trigger` to reload `udev` rules
7. run `sudo modprobe usb4718` to load module
8. for permanently loading module add `usb4718` to `/etc/modules`
## Usage
`sudo ./test4718`
This program will run testing cycle on analog in/out, digital in/out and counter.
You can also use in your program generated `/dev/das_usbX` character devices (`X` is the number of the device, typically `0`) in `read`/`write` mode with following commands:
### Read in Linux (C):
“`
#include
#include
#include
#include
#include
int main(int argc, char **argv) {
int fd;
char buf[128];
memset(&buf, 0, 128);
fd = open(“/dev/das_usb0”, O_RDONLY);
read(fd, &buf, 128);
printf(“read: %s\n”, buf);
close(fd);
return 0;
}
“`
### Write in Linux (C):
“`
#include
#include
#include
#include
#include
int main(int argc, char **argv) {
int fd;
char cmd[128] = “AO 0 5\r\n”; // set analog AO0 to 5V
fd = open(“/dev/das_usb0”, O_WRONLY);
write(fd, cmd, strlen(cmd));
close(fd);
return 0;
}
“`
For detailed description of available commands please refer to documentation in `doc` folder or [original documentation](https://www.icpdas.com/en/support/download.php?model=usb-4718).
## TODO
– [X] Basic i2c support for peripheral in `peripherals` section
– [ ] Support for [USB-4716](https://www.icpdas.com/en/support/download.php?model=usb-4716) (USB-4716 uses same driver as USB-4718, probably minor changes needed)
– [ ] Python support (command builder or direct python module)
– [ ] Better documentation
– [ ] CI (probably automated test runner, but needs physical hardware)
## Build variants
Repo contains also variants of driver with additional functionality like i2c support (see `peripherals/i2c/README.md` for more details).
## Disclaimer
This repository contain drivers from [ICP DAS website](https://www.icpdas.com/en/support/download.php?model=usb-4718), introduced to wider community for better visibility and easier access in one place. I (repo owner) am not affiliated with ICP DAS and this repository is not official ICP DAS repository.
## License
Original driver (v1.4.0) from [ICP DAS website](https://www.icpdas.com/en/support/download.php?model=usb-4718) is licensed under ICP-DAS License (see original license text in `doc` folder).
Additional code (e.g. example programs) introduced in this repository are licensed under MIT (see `MIT-LICENSE` file).



