X-Git-Url: http://sigrok.org/gitweb/?a=blobdiff_plain;f=include%2Ffx2lafw.h;h=c6606619e775f84ce21a0c027c41cd6bce57bd8e;hb=8da0cd02228bb6890eb5068e6507bf6ce0d2fdd2;hp=71f181f493b3c09ec7ad633541a8d2cf4a700d61;hpb=e41576ec531630354c5b48ed0caa83caa1a4c14e;p=sigrok-firmware-fx2lafw.git diff --git a/include/fx2lafw.h b/include/fx2lafw.h index 71f181f4..c6606619 100644 --- a/include/fx2lafw.h +++ b/include/fx2lafw.h @@ -1,5 +1,5 @@ /* - * This file is part of the fx2lafw project. + * This file is part of the sigrok-firmware-fx2lafw project. * * Copyright (C) 2012 Joel Holdsworth * @@ -14,21 +14,36 @@ * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + * along with this program; if not, see . */ +#ifndef FX2LAFW_INCLUDE_FX2LAFW_H +#define FX2LAFW_INCLUDE_FX2LAFW_H + #include #define SYNCDELAY() SYNCDELAY4 -/** - * Performs setup common to all fx2lafw devices. +/* + * Major and minor fx2lafw firmware version numbers. + * These can be queried by the host via CMD_GET_FW_VERSION. + * + * The minor version number must be increased every time there are + * backwards-compatible changes (which do not change the API). + * + * The major version number must be increased every time there are API + * changes or functional changes which require adaptations in the host + * (libsigrok) drivers, i.e. changes where old libsigrok versions would no + * longer (properly) work with the new fx2lafw firmware. */ -void fx2lafw_init(void); +#define FX2LAFW_VERSION_MAJOR 1 +#define FX2LAFW_VERSION_MINOR 4 -/** - * Performs a single iteration of the main loop code which is common - * to all fx2lafw devices. - */ -void fx2lafw_run(void); +#define LED_POLARITY 1 /* 1: active-high, 0: active-low */ + +#define LED_INIT() do { PORTACFG = 0; OEA = (1 << 1); } while (0) +#define LED_ON() do { PA1 = LED_POLARITY; } while (0) +#define LED_OFF() do { PA1 = !LED_POLARITY; } while (0) +#define LED_TOGGLE() do { PA1 = !PA1; } while (0) + +#endif