Commit d468760b authored by Gallacchi Mattia's avatar Gallacchi Mattia
Browse files

Update README

parent a6d37c58
Loading
Loading
Loading
Loading
+0 −2
Original line number Diff line number Diff line
@@ -66,8 +66,6 @@ if (UNIX)
    add_library(libusb-1.0.27 STATIC IMPORTED)
    set_target_properties(libusb PROPERTIES IMPORTED_LOCATION ${LIBUSB_LIB_PATH})
    include_directories(${LIBUSB_INCLUDE_DIR})
    include_directories(${LIBUSB_INCLUDE_DIR})


elseif(WIN32)
    include_directories(${CMAKE_CURRENT_SOURCE_DIR}/MCP2221_DLL/unmanaged/dll)
+19 −12
Original line number Diff line number Diff line
@@ -2,16 +2,20 @@

Support for user space usage of the [MCP2221A][1] IC from Microchip. 


## Linux

To access the USB device you must add the following rule under */etc/udev/rules.d/* (i.e in a file called mcp2221a.rules) :
To access the USB HID device you must add the following rule under */etc/udev/rules.d/* (i.e in a file called 99-mcp2221a.rules) :

```bash
SUBSYSTEM=="usb", ATTRS{idVendor}=="04d8", ATTRS{idProduct}=="00dd", GROUP="plugdev", TAG+="uaccess"
```

You must reboot after this.
Then update *udev* with the following commands:

```bash
sudo udevadm control --reload
sudo udevadm trigger
```

To access the I2C devices loaded by the [*mcp2221*][2] kernel driver you must add your user to the *i2c* group:

@@ -31,23 +35,26 @@ You must login again in order for the changes to take effect.

## Windows 

The device needs a windows driver to be recognized. 

## Dependencies

```bash
sudo apt install -y libi2c-dev
```
Nothing to configure the Microchip *dll* contains all the configuration necessary.

## Build

Standard **CMAKE**:

For Linux:

```bash
cmake --preset default
cmake --preset linux
cmake --build build/
```

For Windows:

```bash
cmake --preset windows
cmake --build build --config Release
```

## Try it out

Run the test software found in the tests folder. Expected result is:
@@ -64,7 +71,7 @@ Testing I2C: Success
## TODO

- [ ] Add python library 
- [ ] Add Windows support
- [X] Add Windows support
- [ ] Add hidapi support

[1]:http://ww1.microchip.com/downloads/en/devicedoc/20005565b.pdf