1 // Copyright (C) 2009 Ubixum, Inc.
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, see <http://www.gnu.org/licenses/>.
17 * macros for turning lights on the EZ-USB development board on and off.
26 // FX2 Dev board lights
27 #define D2ONH #0x88 // assembly high byte of light addr
35 volatile xdata at 0x8800 BYTE D2ON;
36 volatile xdata at 0x8000 BYTE D2OFF;
37 volatile xdata at 0x9800 BYTE D3ON;
38 volatile xdata at 0x9000 BYTE D3OFF;
39 volatile xdata at 0xA800 BYTE D4ON;
40 volatile xdata at 0xA000 BYTE D4OFF;
41 volatile xdata at 0xB800 BYTE D5ON;
42 volatile xdata at 0xB000 BYTE D5OFF;
44 // FX1 dev board lights
45 #define D2ONH #0x80 // assembly high byte of light addr
53 volatile xdata at 0x8000 BYTE D2ON;
54 volatile xdata at 0x8100 BYTE D2OFF;
55 volatile xdata at 0x9000 BYTE D3ON;
56 volatile xdata at 0x9100 BYTE D3OFF;
57 volatile xdata at 0xA000 BYTE D4ON;
58 volatile xdata at 0xA100 BYTE D4OFF;
59 volatile xdata at 0xB000 BYTE D5ON;
60 volatile xdata at 0xB100 BYTE D5OFF;
64 * Easier to use macros defined below
66 #define activate_light(LIGHT_ADDR) __asm \
67 mov __XPAGE, LIGHT_ADDR \
73 * Easy to make lights blink with these macros:
80 * if (on) d2on(); else d2off();
86 #define d2on() activate_light(D2ONH)
87 #define d2off() activate_light(D2OFFH)
88 #define d3on() activate_light(D3ONH)
89 #define d3off() activate_light(D3OFFH)
90 #define d4on() activate_light(D4ONH)
91 #define d4off() activate_light(D4OFFH)
92 #define d5on() activate_light(D5ONH)
93 #define d5off() activate_light(D5OFFH)