]> sigrok.org Git - sigrok-firmware-fx2lafw.git/blob - fx2lib/docs/intro/intro.tex
Import fx2lib into fx2lafw directly.
[sigrok-firmware-fx2lafw.git] / fx2lib / docs / intro / intro.tex
1
2 \documentclass[12pt]{article}
3 \usepackage[pdftex,bookmarks=true,linktocpage=true,pdfborder={0 0 0 0}]{hyperref}
4 \usepackage{amsmath}
5
6 \newcommand{\itwoc}{$\text{I}^{2}\text{C}$ }
7
8
9 \title{Fx2lib Introduction}
10 \begin{document}
11 \maketitle
12 \tableofcontents
13 \section{Introduction}
14 Fx2lib is an open source library for the Cypress EZ-USB Fx2 8051 and variants.
15 It is written in C and can be compiled with \href{http://sdcc.sourceforge.net}{SDCC}.
16 Fx2lib contains libraries for performing common tasks with the Fx2 chip as well as a framework for starting new firmware projects.
17 There are also a number of utilities for performing common firmware development tasks.
18
19 \section{Fx2lib Features}
20
21 Fx2lib provides libaries for the following common firmware tasks:
22
23 \begin{itemize}
24  \item Serial IO.  Ease of setting BAUD rate and reading and writing from serial ports. 
25  \item Vendor Commands.  Handling of required USB vendor commands and ease of implementing your own vendor command handlers. 
26  \item USB interrupts.  Ease of enabling/disabling USB interrupts and adding your own interrupt handlers.
27  \item \itwoc IO.  Ease of reading and writing to \itwoc devices. EEprom functions are also included. 
28  \item GPIF.  Functions for setting up the GPIF as well as performing single and fifo reads/writes.
29  \item Endpoints.  Simplify reading/writing with endpoint 0.
30  \item Other definitions and macros.  All Fx2 SFR, sbit and registers defined as well as other macros for common fx2 tasks.
31 \end{itemize}
32
33 Detailed  documentation for the library API is available online or with your downloaded fx2lib copy. 
34
35 \section{Fx2lib Utilities}
36
37 \begin{itemize}
38  \item gpif2dat.  Takes the output from the Cypress GPIF designer (the .c file) and creates an sdcc compatible c file with only the waveforms and initialization structures needed for use with the Fx2lib GPIF functions.
39  \item ihx2iic.  Creates a compressed iic from your firmware ihx file.  Used for storing your firmware on an eeprom.
40  \item fx2load.  Command line interface and Python bindings for loading firmware onto an Fx2 device and for doing basic device IO. 
41 \end{itemize}
42
43 \section{Getting Started}
44
45 \begin{enumerate}
46 \item Obtain Fx2lib. 
47
48  Fx2lib can be compiled from sources or is available as a pre-compiled library.
49  If you choose to compile Fx2lib from sources, simply make sure sdcc is in your path and run make in the fx2lib root folder.  
50  Whether you have downloaded a pre-compiled version or build your own Fx2lib library, you should have fx2lib/lib/fx2.lib available for the examples and your own firmware.
51 \item Install the drivers.
52
53  Fx2lib uses \href{http://libusb.sourceforge.net}{libusb} to handle low level USB communication with the underlying operating system.
54  Each operating system has different requirements for driver installation.
55  See the Fx2lib driver guide for details on installing USB drivers for your specific operating system.
56  You'll need to install the drivers specifically for the device you plan on doing the Fx2 development with.
57  
58 \item Running Example Firmware. 
59
60  Each firmware example has a Makefile and a load script.
61  Simply run make to create the associated .ihx file and then run make load to load the firmware onto your device.
62  The examples/NOTES contains more details on each examples firmware.
63
64  The default load targets use the Cypress vendor id with the development board product ID.
65  Depending on your hardware, you'll need to change these appropriately.
66 \item Starting your own firmware.
67
68  Fx2lib provides a quick start firmware framework in the fx2lib/fw directory.
69  Simply copy this directory to your own location and begin modifying the files to start your own firmware.
70
71 \end{enumerate}
72
73
74 \section{Where Next}
75
76  \begin{itemize}
77   \item \href{http://fx2lib.sourceforge.net/docs/}{Fx2lib API documentation}
78  \end{itemize}
79
80 \end{document}