1 /* main program of Free Software for Calypso Phone */
3 /* (C) 2010 by Harald Welte <laforge@gnumonks.org>
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License as published by
9 * the Free Software Foundation; either version 2 of the License, or
10 * (at your option) any later version.
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
17 * You should have received a copy of the GNU General Public License along
18 * with this program; if not, write to the Free Software Foundation, Inc.,
19 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
33 #include <abb/twl3025.h>
35 #include <rf/trf6151.h>
36 #include <calypso/clock.h>
37 #include <calypso/tpu.h>
38 #include <calypso/tsp.h>
39 #include <calypso/dsp.h>
40 #include <calypso/irq.h>
41 #include <calypso/misc.h>
42 #include <comm/sercomm.h>
43 #include <comm/timer.h>
46 const char *hr = "======================================================================\n";
48 void key_handler(enum key_codes code, enum key_states state);
50 static void console_rx_cb(uint8_t dlci, struct msgb *msg)
52 if (dlci != SC_DLCI_CONSOLE) {
53 printf("Message for unknown DLCI %u\n", dlci);
57 printf("Message on console DLCI: '%s'\n", msg->data);
58 display_puts((char *) msg->data);
62 static void l1a_l23_rx_cb(uint8_t dlci, struct msgb *msg)
65 puts("l1a_l23_rx_cb: ");
66 for (i = 0; i < msg->len; i++)
67 printf("%02x ", msg->data[i]);
75 puts("\n\nOSMOCOM Hello World (revision " GIT_REVISION ")\n");
78 /* Dump device identification */
82 /* Dump clock config before PLL set */
86 keypad_set_handler(&key_handler);
88 /* Dump clock config aftee PLL set */
96 memdump_range((void *)0x00000000, 0x2000);
100 display_set_attr(DISP_ATTR_INVERT);
101 display_puts("Hello World");
103 sercomm_register_rx_cb(SC_DLCI_CONSOLE, console_rx_cb);
104 sercomm_register_rx_cb(SC_DLCI_L1A_L23, l1a_l23_rx_cb);
106 /* beyond this point we only react to interrupts */
107 puts("entering interrupt loop\n");
117 void key_handler(enum key_codes code, enum key_states state)
121 if (state != PRESSED)
135 sprintf(test, "%d", code - KEY_0);
139 sprintf(test, "*", 0);
143 sprintf(test, "#", 0);