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>
37 #include <comm/sercomm.h>
38 #include <comm/timer.h>
40 #include <calypso/clock.h>
41 #include <calypso/tpu.h>
42 #include <calypso/tsp.h>
43 #include <calypso/irq.h>
44 #include <calypso/misc.h>
46 #include <layer1/sync.h>
47 #include <layer1/tpu_window.h>
49 const char *hr = "======================================================================\n";
51 /* MAIN program **************************************************************/
53 static void key_handler(enum key_codes code, enum key_states state);
59 puts("\n\nOSMOCOM Layer 1 (revision " GIT_REVISION ")\n");
62 /* Dump device identification */
66 keypad_set_handler(&key_handler);
68 /* Dump clock config after PLL set */
72 display_puts("layer1.bin");
76 display_unset_attr(DISP_ATTR_INVERT);
78 tpu_frame_irq_en(1, 1);
90 static int afcout = 0;
92 static void tspact_toggle(uint8_t num)
94 printf("TSPACT%u toggle\n", num);
95 tsp_act_toggle((1 << num));
101 static void key_handler(enum key_codes code, enum key_states state)
103 if (state != PRESSED)
108 tspact_toggle(6); /* TRENA (RFFE) */
111 tspact_toggle(8); /* GSM_TXEN (RFFE) */
114 tspact_toggle(1); /* PAENA (RFFE) */
116 case KEY_7: /* decrement AFC OUT */
120 twl3025_afc_set(afcout);
121 printf("AFC OUT: %u\n", twl3025_afcout_get());
123 case KEY_9: /* increase AFC OUT */
127 twl3025_afc_set(afcout);
128 printf("AFC OUT: %u\n", twl3025_afcout_get());