Worked on the docs!

This commit is contained in:
[ Kristjan Komloši HomePC ]
2017-05-04 13:11:36 +02:00
parent 2cdf7fb91c
commit a82b29042f
15 changed files with 795 additions and 534 deletions
+50 -45
View File
@@ -1,59 +1,64 @@
# TinI/O
# TinI/O manual
-----
# 1. Introduction to TinI/O
## 1.1 What is TinI/O?
TinI/O (or tinio) is a Linux program that makes standard PCs with USB GPIO-capable and/or expands the existing capabilities on GPIO-enabled computers. It does that by talking to its hardware counterpart, [the Cypress CY7C65211 USB-Serial chip][1].
is a tool for interfacing the Cypress CY7C65211 USB-Serial Bridge Controller and its GPIO.
## 1.2 What features does TinI/O have?
+ It's written entirely in C and C++, making it platform-independent and fast
+ It's easy on the CPU (nothing runs in the background)
+ It's compatible with almost every Linux system
+ It operates over 1st gen USB 1.1, making it useful with older machines
--------------------------------------------------------------------------------
## 1.3 How does it work?
TinI/O can't provide GPIO by itself. Its capabilites rely on its chip companion ([CY7C65211][chip]), libusb and cyrozap's libcyusbserial library. When TinI/O is ran, it processes its arguments and sends commands to the chip via the before mentioned libraries. The chip then takes care of the rest.
## 1\. How to build it
## 1.4 Under what license can it be used?
TinI/O is licensed under the GNU General Public License, which is publicly available at http://www.gnu.org/licenses/gpl.html and in the COPYING file in the `docs ` directory in the project's root.
To set up TinI/O, you'll need:
- A linux machine (the processor architecture doesn't matter, but Debian or Ubuntu is almost guaranteed to work)
- an USB dongle with the chip
- a C and C++ compiler (GCC is most common)
- GNU Make and CMake
- libusb 1.0
# 2. Installing
## 2.1 What you should know
TinI/O binaries aren't available right now, but that shouldn't be a problem, because TinI/O is easy to build.
Before you proceed, make sure that you have:
+ at least 16 MB of disk space
+ a working C and C++ compiler (**a working C++ is a working C compiler, but not the other way round!**)
+ installed libusb
+ GNU Make and cmake
You can build TinI/O by
## 2.2 Manual build
*This chapter explains how to build TinI/O manually. If you don't feel comfortable or don't want to build it manually, skip this chapter.*
a)`cd`-ing to the `cylib/build` directory and build the needed libraries with:
```
# cmake ..
# make
# sudo make install
```
The TinI/O build process consists of:
1. Building the cyusbserial library and
2. Building TinI/O and the firmware flasher.
Then go to the `../tinio` directory and build and install TinI/O with:
```
# make
# make install
```
### 2.2.1 Building the Library
To communicate with the chip, TinI/O needs [a dedicated library written by cyrozap][cylib] that comes with TinI/O but needs to be built separately. To do that, run `cmake .. && make && sudo make install` inside the `cylib/build` directory in the project root.
or<br>
b) executing the `autobuilder` script in the main directory that will do the above for you.
### 2.2.2 Building everything else
To complete the installation process, run `make && make install` in the `tinio` directory in the project root. That will build and install the flasher utility and TinI/O itself.
**NOTE: Although the autobuilder should be working in most use cases, it's still better to build the tools manually (if you have the needed knowledge, of course)**
### 2.2.3 More about the makefile
TODO explain the makefile's targets etc.
## 2\. Getting started
Before you start using TinI/O, you have to reflash the target chip so it can be recognised by your PC. That is done with the supplied `cy-config` utility.
To reflash a chip, you'll need to navigate to `/usr/share/tinio/flashes` directory. There you'll find files that contain different flash images. (I'll say more about the images later in the chapter TODO)
For a general configuration (5 inputs, 5 outputs), we'll use TODO
You can get a quick summary on TinI/O by executing it.
## 2.1 The `autobuilder`
Because some people don't like manual binary building, TinI/O comes with the `autobuilder` script, which allows non-experienced users to install TinI/O without knowing much about GNU Make, GCC and other tools that are used to build it.
```
# ./tinio
TinI/0 0.1
Usage:
tinio <options>
The supported options are:
-d<device number> - specifies the desired device - integer 0 to 15
-i<interface number - specifies the USB interface number - integer 0 to 255
-s<pin number> - sets the specified pin to the value specified with -v - integer 0 to 11
-r<pin number> - reads the specified pin's value and prints it to the stdout - integer 0 to 11
-v<value> - value for -s option - integer 0 to 1
-e - enables expert mode (enables protected pins)
#
#
```
To build TinI/O with `autobuilder`:
- Just run the autobuilder script in the project root in a terminal!
- The script will then guide you through the installation process.
# 3. After the installation
After the installation of TinI/O, you actually don't need to do anything at all with *it*. The next step is to prepare the actual device you'll be using TinI/O with.
# 4. Flashing the chip(s)
Cypress CY7C65211 can be flashed from Windows or from Linux, but only with a dedicated Cypress utility due to its unique flash file format. Fortunately, the utility is licensed under LGPL and free (as speech *and* beer). The utility is named `cy-config` and is text-based.
There are also 2 premade flash files that come with the utility:
- `5in-5out.cyusbd` - 5 inputs and 5 outputs
- `3in-3out-cs.cyusbd` - 3 inputs and 3 outputs + a capsense button
[chip]: http://www.cypress.com/part/cy7c65211-24ltxi
[cylib]: http://github.com/cyrozap/libcyusbserial