Mercurial > flash_v2
comparison packages/hal/arm/edb7xxx/current/misc/panel_test.c @ 76:435cced73e2f ecos-v1_3_1-release
eCos v1.3.1 merged from eCos master repository on 2000-03-27-23:22:51-BST
| author | jlarmour |
|---|---|
| date | Tue, 28 Mar 2000 14:10:45 +0000 |
| parents | |
| children | e0c0827131d1 |
comparison
equal
deleted
inserted
replaced
| 75:41bf073c0c32 | 76:435cced73e2f |
|---|---|
| 1 //========================================================================== | |
| 2 // | |
| 3 // panel_test.c | |
| 4 // | |
| 5 // Cirrus Logic EDB7xxx eval board LCD touch panel test code | |
| 6 // | |
| 7 //========================================================================== | |
| 8 //####COPYRIGHTBEGIN#### | |
| 9 // | |
| 10 // ------------------------------------------- | |
| 11 // The contents of this file are subject to the Red Hat eCos Public License | |
| 12 // Version 1.1 (the "License"); you may not use this file except in | |
| 13 // compliance with the License. You may obtain a copy of the License at | |
| 14 // http://www.redhat.com/ | |
| 15 // | |
| 16 // Software distributed under the License is distributed on an "AS IS" | |
| 17 // basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the | |
| 18 // License for the specific language governing rights and limitations under | |
| 19 // the License. | |
| 20 // | |
| 21 // The Original Code is eCos - Embedded Configurable Operating System, | |
| 22 // released September 30, 1998. | |
| 23 // | |
| 24 // The Initial Developer of the Original Code is Red Hat. | |
| 25 // Portions created by Red Hat are | |
| 26 // Copyright (C) 1998, 1999, 2000 Red Hat, Inc. | |
| 27 // All Rights Reserved. | |
| 28 // ------------------------------------------- | |
| 29 // | |
| 30 //####COPYRIGHTEND#### | |
| 31 //========================================================================== | |
| 32 //#####DESCRIPTIONBEGIN#### | |
| 33 // | |
| 34 // Author(s): gthomas | |
| 35 // Contributors: gthomas | |
| 36 // Date: 1999-09-06 | |
| 37 // Description: Tool used to test LCD touch panel | |
| 38 //####DESCRIPTIONEND#### | |
| 39 | |
| 40 #include <pkgconf/kernel.h> // Configuration header | |
| 41 #include <cyg/kernel/kapi.h> | |
| 42 #include <cyg/infra/diag.h> | |
| 43 | |
| 44 #include <cyg/hal/hal_edb7xxx.h> // Board definitions | |
| 45 | |
| 46 #include <cyg/hal/hal_io.h> // IO macros | |
| 47 #include <cyg/hal/hal_arch.h> // Register state info | |
| 48 #include <cyg/hal/hal_diag.h> | |
| 49 #include <cyg/hal/hal_intr.h> // HAL interrupt macros | |
| 50 #include <cyg/hal/drv_api.h> // HAL ISR support | |
| 51 | |
| 52 #ifndef FALSE | |
| 53 #define FALSE 0 | |
| 54 #define TRUE 1 | |
| 55 #endif | |
| 56 | |
| 57 #define STACK_SIZE 4096 | |
| 58 static char stack[STACK_SIZE]; | |
| 59 static cyg_thread thread_data; | |
| 60 static cyg_handle_t thread_handle; | |
| 61 | |
| 62 #include "lcd_support.c" | |
| 63 #include "lcd_panel_support.c" | |
| 64 | |
| 65 // FUNCTIONS | |
| 66 | |
| 67 static void | |
| 68 cyg_test_exit(void) | |
| 69 { | |
| 70 while (TRUE) ; | |
| 71 } | |
| 72 | |
| 73 static void | |
| 74 panel_exercise(cyg_addrword_t p) | |
| 75 { | |
| 76 int i; | |
| 77 cyg_uint32 val; | |
| 78 | |
| 79 diag_printf("LCD touch panel test here!\n"); | |
| 80 | |
| 81 lcd_panel_init(); | |
| 82 | |
| 83 for (i = 0; i < 50; i++) { | |
| 84 diag_printf("Please touch screen now:\n"); | |
| 85 val = (cyg_uint32)cyg_mbox_get(lcd_panel_events_mbox_handle); | |
| 86 diag_printf("val = %x, X = %d, Y = %d\n", val, (val>>16), val & 0xFFFF); | |
| 87 } | |
| 88 | |
| 89 diag_printf("All done!\n"); | |
| 90 cyg_test_exit(); | |
| 91 } | |
| 92 | |
| 93 externC void | |
| 94 cyg_start( void ) | |
| 95 { | |
| 96 // Create a main thread, so we can run the scheduler and have time 'pass' | |
| 97 cyg_thread_create(10, // Priority - just a number | |
| 98 panel_exercise, // entry | |
| 99 0, // initial parameter | |
| 100 "LCD_panel_thread", // Name | |
| 101 &stack[0], // Stack | |
| 102 STACK_SIZE, // Size | |
| 103 &thread_handle, // Handle | |
| 104 &thread_data // Thread data structure | |
| 105 ); | |
| 106 cyg_thread_resume(thread_handle); // Start it | |
| 107 cyg_scheduler_start(); | |
| 108 } // cyg_package_start() | |
| 109 |
