2 * Copyright (C) 2009 Ubixum, Inc.
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2.1 of the License, or (at your option) any later version.
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
34 BYTE digits[] = { 0xc0, 0xf9, 0xa4, 0xb0, 0x99, 0x92, 0x82, 0xf8, 0x80, 0x98, 0x88, 0x83, 0xc6, 0xa1, 0x86, 0x8e };
38 * This is pretty much the same function that is provided as the dev_io example from Cypress
39 * Except is uses i2c read and write functions not from their library
53 i2c_read ( BTN_ADDR, 1, &buttons );
55 kdeltas = kstates ^ buttons; //
63 if(!((kstates >> key) & 0x01))
66 case KEY_F1: // wakeup?
82 kdeltas = kdeltas >> 1;
87 i2c_write ( LED_ADDR, 1, &digits[num], 0, NULL );