FreeCalypso > hg > tcs211-c139
comparison chipsetsw/drivers/drv_app/r2d/lcds/E_Sample/lcd_if32.c @ 0:509db1a7b7b8
initial import: leo2moko-r1
author | Space Falcon <falcon@ivan.Harhan.ORG> |
---|---|
date | Mon, 01 Jun 2015 03:24:05 +0000 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:509db1a7b7b8 |
---|---|
1 /****************************************************************************** | |
2 * WIRELESS COMMUNICATION SYSTEM DEVELOPMENT | |
3 * | |
4 * (C) 2002 Texas Instruments France. All rights reserved | |
5 * | |
6 * Author : Philippe MARTINEZ | |
7 * | |
8 * | |
9 * Important Note | |
10 * -------------- | |
11 * | |
12 * This S/W is a preliminary version. It contains information on a product | |
13 * under development and is issued for evaluation purposes only. Features | |
14 * characteristics, data and other information are subject to change. | |
15 * | |
16 * The S/W is furnished under Non Disclosure Agreement and may be used or | |
17 * copied only in accordance with the terms of the agreement. It is an offence | |
18 * to copy the software in any way except as specifically set out in the | |
19 * agreement. No part of this document may be reproduced or transmitted in any | |
20 * form or by any means, electronic or mechanical, including photocopying and | |
21 * recording, for any purpose without the express written permission of Texas | |
22 * Instruments Inc. | |
23 * | |
24 ****************************************************************************** | |
25 * | |
26 * FILE NAME: lcd_if32.c | |
27 * | |
28 * | |
29 * PURPOSE: LCD Interface driver compiled in 32-bits mode (ARM mode) | |
30 * | |
31 * | |
32 * FILE REFERENCES: | |
33 * | |
34 * Name IO Description | |
35 * ------------- -- --------------------------------------------- | |
36 * | |
37 * | |
38 * | |
39 * EXTERNAL VARIABLES: | |
40 * | |
41 * Source: | |
42 * | |
43 * Name Type IO Description | |
44 * ------------- --------------- -- ------------------------------ | |
45 * | |
46 * | |
47 * | |
48 * EXTERNAL REFERENCES: | |
49 * | |
50 * Name Description | |
51 * ------------------ ------------------------------------------------------- | |
52 * | |
53 * | |
54 * | |
55 * ABNORMAL TERMINATION CONDITIONS, ERROR AND WARNING MESSAGES: | |
56 * | |
57 * | |
58 * | |
59 * ASSUMPTION, CONSTRAINTS, RESTRICTIONS: | |
60 * | |
61 * | |
62 * | |
63 * NOTES: | |
64 * | |
65 * | |
66 * | |
67 * REQUIREMENTS/FUNCTIONAL SPECIFICATION REFERENCES: | |
68 * | |
69 * | |
70 * | |
71 * | |
72 * DEVELOPMENT HISTORY: | |
73 * | |
74 * Date Name(s) Version Description | |
75 * ----------- -------------- ------- ------------------------------------- | |
76 * 30-Oct-2002 Philippe MARTINEZ 0.0.1 First implementation | |
77 * | |
78 * ALGORITHM: | |
79 * | |
80 * | |
81 *****************************************************************************/ | |
82 | |
83 #include "r2d/lcds/e_sample/lcd_if.h" | |
84 | |
85 /**************************************************************************** | |
86 * GLOBAL VARIABLES REFERENCE | |
87 ***************************************************************************/ | |
88 | |
89 /* internal structure instance */ | |
90 | |
91 extern T_LCD_IF_INTERNAL d_lcd_if_internal; | |
92 | |
93 #if (CHIPSET == 12) | |
94 | |
95 /****************************************************************************** | |
96 * | |
97 * FUNCTION NAME: f_lcd_if_it_handler | |
98 * | |
99 * LCD Interface Interrupt Handler. | |
100 * | |
101 * | |
102 * ARGUMENT LIST: | |
103 * | |
104 * Argument Type IO Description | |
105 * ------------ ------------------- -- --------------------------------- | |
106 * None | |
107 * | |
108 * RETURN VALUE: None | |
109 * | |
110 *****************************************************************************/ | |
111 | |
112 void f_lcd_if_it_handler( void ) | |
113 { | |
114 | |
115 E_LCD_IF_CALLBACK_RET d_status; | |
116 SYS_UWORD32 d_nb_words_in_loop = 0; | |
117 SYS_UWORD8 i = 0; | |
118 | |
119 | |
120 /* check the d_interrupt_state value and the buffer */ | |
121 | |
122 if( (d_lcd_if_internal.d_interrupt_state == C_LCD_IF_IT_BUFF) && | |
123 (d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.d_buffer_size != 0) ) | |
124 { | |
125 /* Copy up to C_LCD_IF_TX_FIFO_SIZE words into the TX FIFO. */ | |
126 | |
127 if( d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.d_buffer_size >= C_LCD_IF_TX_FIFO_SIZE) | |
128 { | |
129 d_nb_words_in_loop = C_LCD_IF_TX_FIFO_SIZE; | |
130 } | |
131 else | |
132 { | |
133 d_nb_words_in_loop = d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.d_buffer_size; | |
134 } // End if | |
135 | |
136 for( i=0; i<d_nb_words_in_loop ;i++ ) | |
137 { | |
138 F_LCD_IF_WRITE_IN_FIFO( d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.p_buffer[i] ); | |
139 } // End for | |
140 | |
141 /* update d_nb_words_to copy and p_buffer */ | |
142 d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.d_buffer_size -= d_nb_words_in_loop; | |
143 d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.p_buffer += d_nb_words_in_loop; | |
144 | |
145 } | |
146 else | |
147 { | |
148 /* Call the callback function */ | |
149 d_status = (*d_lcd_if_internal.d_cs_struct[d_lcd_if_internal.d_current_cs].d_tx.p_callback)(); | |
150 | |
151 /* disable the LCD Interface TX FIFO if needed */ | |
152 if( d_status == C_LCD_IF_CALLBACK_DISABLE_IT) | |
153 { | |
154 F_LCD_IF_DISABLE_TX_FIFO_EMPTY_IT; | |
155 | |
156 /* set internal state to IDLE */ | |
157 d_lcd_if_internal.d_interrupt_state = C_LCD_IF_IDLE; | |
158 } // End if | |
159 | |
160 } // End if | |
161 | |
162 } /* f_lcd_if_it_handler */ | |
163 | |
164 #endif |