doxytest
Macros | Functions | Variables
Ecran.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define TACTIL_X_MAX   450
 
#define TACTIL_Y_MAX   460
 

Functions

void CLA_DROITE_I (void)
 
void CLA_GAUCHE_I (void)
 
void initSPI_ECR (void)
 
void StopSPI_ECR (void)
 
void StartSPI_ECR (void)
 
int Com_texte_ECRAN (unsigned char ordre, unsigned char inverse)
 

Variables

int tactil_x_max
 
int tactil_y_max
 
int tactil_compt
 

Macro Definition Documentation

◆ TACTIL_X_MAX

#define TACTIL_X_MAX   450

◆ TACTIL_Y_MAX

#define TACTIL_Y_MAX   460

Function Documentation

◆ CLA_DROITE_I()

void CLA_DROITE_I ( void  )
27 {
28 unsigned int i=0;
29 for (i=N_CHAR-1;i>0;--i)
30 {
31 message_clavier [i]=message_clavier [i-1];
32 }
33 message_clavier [0]=' ';
34 }

◆ CLA_GAUCHE_I()

void CLA_GAUCHE_I ( void  )
37 {
38 static unsigned int i=0;
39 for (i=0;i<N_CHAR-1;++i)
40 {
41 message_clavier [i]=message_clavier [i+1];
42 }
43 message_clavier [CHAR_AFF-1]=' ';
44 }

◆ Com_texte_ECRAN()

int Com_texte_ECRAN ( unsigned char  ordre,
unsigned char  inverse 
)
121 {
122  static unsigned char i=0;
123  static unsigned char j=0;
124  static unsigned char l=0;
125  static unsigned char n=0;
126  unsigned char cherche_lignes=0;
127  static unsigned char atxt_anc[N_L][N_CHAR]={0};
128  static unsigned char lcd_inverse_anc=0;
129  static unsigned char ordre_anc=0;
130 
131 #if defined ECR_ON
132 
133  if (lcd_end==0||SPI2_ecr==0)//on fait que si ecran fini ou ordre d'initialisation
134  {
135 
136  for(i=0;i<N_L;++i) {Ligne[i]=0;}
137  l=0;
138  cherche_lignes=0;
139 
140  clr_ecr=0;
141  lcd_init=0;
142  lcd_txt=1;
143  huite_txt=0;
144  lcd_img=0;
145  lcd_txt_sur_img=0;
146  switch (ordre)
147  {
148  case 0:
149  clr_ecr=1;
150  lcd_init=2;
151  cherche_lignes=0;
152  break;
153  case 1:
154  lcd_init=3;//�vite reinitialiser et effacer
155  lcd_txt=1;
156  huite_txt=0;
157  lcd_img=0;
158  lcd_txt_sur_img=0;
159  cherche_lignes=4;
160  if (ordre_anc!=ordre)
161  {
162  lcd_init=2;
163  cherche_lignes=0;
164  for(i=0;i<4;++i){Ligne[i]=1;}
165  l=1;
166  }
167  break;
168  case 2:
169  lcd_init=3;//�vite reinitialiser et effacer
170  lcd_txt=1;
171  huite_txt=1;
172  lcd_img=0;
173  lcd_txt_sur_img=0;
174  cherche_lignes=8;
175  if (ordre_anc!=ordre)
176  {
177  cherche_lignes=0;
178  for(i=0;i<N_L;++i){ Ligne[i]=1;}
179  l=1;
180  }
181  break;
182  case 3:
183  /*
184  lcd_init=3;//�vite reinitialiser et effacer
185  lcd_txt=1;
186  huite_txt=0;
187  lcd_img=1;
188  lcd_txt_sur_img=1;
189  cherche_lignes=8;
190 
191  lcd_x=128;
192  lcd_y=8;
193  */
194  /*Change*/
195  lcd_init=3;//�vite reinitialiser et effacer
196  lcd_txt=0;
197  //lcd_txt=0;
198  huite_txt=0;
199  lcd_img=1;
200  lcd_txt_sur_img=1;
201  l=1;
202  lcd_x=128;
203  lcd_y=8;
204  break;
205  case 4:
206  lcd_init=3;//�vite reinitialiser et effacer
207  lcd_txt=0;
208  huite_txt=0;
209  lcd_img=1;
210  lcd_txt_sur_img=0;
211  //if (ordre_anc!=ordre){l=1;}
212  /*Change*/l=1;
213  lcd_x=128;
214  lcd_y=8;
215  break;
216  case 5:
217  lcd_init=3;//�vite reinitialiser et effacer
218  lcd_txt=1;
219  huite_txt=0;
220  lcd_img=1;
221  lcd_txt_sur_img=0;
222 
223  lcd_x=64;
224  lcd_y=8;
225  cherche_lignes=8;
226  if (ordre_anc!=ordre)
227  {
228  lcd_init=2;
229  cherche_lignes=0;
230  for(i=0;i<4;++i){Ligne[i]=1;}
231  l=1;
232  }
233  break;
234  }
235  if(lcd_inverse_anc!=inverse)
236  {
237  lcd_inverse=inverse;
238  lcd_inverse_anc=inverse;
239  lcd_init=0;
240  cherche_lignes=4;
241  if (ordre==1)
242  {
243  cherche_lignes=0;
244  for(i=0;i<4;++i){Ligne[i]=1;}
245  l=1;
246  }
247  else
248  {
249  cherche_lignes=0;
250  for(i=0;i<8;++i){Ligne[i]=1;}
251  l=1;
252  }
253  }
254  if(SPI2_ecr==0)
255  {
256  cherche_lignes=0;
257  lcd_inverse_anc=lcd_inverse;
258  for(i=0;i<N_L;++i){ Ligne[i]=1;}
259  lcd_init=0;
260  l=1;
261  }
262 
263 
264  if(cherche_lignes>0)
265  {
266 
267  for(i=0;i<cherche_lignes;++i)//Chercher les lignes modifi�es
268  {
269  Ligne[i]=0;
270  for(j=0;j<N_CHAR;++j)
271  {
272  if (atxt_anc[i][j]!=atxt[i][j])
273  {
274  atxt_anc[i][j]=atxt[i][j];
275  Ligne[i]=1;l=1;
276  }
277  }
278  }
279  }
280 
281 
282 
283  if (l==1)//Si au moin une ligne a �t� modifi�e
284  {
285  if (lcd_end==1)//on ne rafraichit pas tant que ecriture en cour sauf pour reinitialiser
286  {
287  if(SPI2_ecr==0){SPI2_ecr=1;initSPI_ECR();StartSPI_ECR();}
288  }
289  else
290  {
291  if(SPI2_ecr==0){SPI2_ecr=1;initSPI_ECR();}
292  StartSPI_ECR();
293  }
294  }
295 
296  ordre_anc=ordre;
297  return 0;
298  }
299  else
300  {
301  return 1;
302  }
303 #else
304  return 0;
305 #endif
306 }
void initSPI_ECR(void)
Definition: Ecran.c:46
void StartSPI_ECR(void)
Definition: Ecran.c:100

◆ initSPI_ECR()

void initSPI_ECR ( void  )
47 {
48 static unsigned int temp=0;
49 
50 #if defined ECR_ON
51 
52 LCD_CS=1; // de-select the Serial EEPROM
53 
54 LCD_CS_Dir=0; // make CS pin output
55 LCD_RST_Dir=0; // make Reset pin output
56 LCD_AO_Dir=0; // make Commande/Data pin output
57 
58 ECR_mSPIxIntDisable(); //Enlever interruptions
59 ECR_SPIxCON=0; //Eteindre module et tout effacer
60 temp=ECR_SPIxBUF;
61 ECR_SPIxBUF=0xFFFFFFFF;//Effacer les signaux
62 ECR_mSPIxClearAllIntFlags();//Effacer eventuelles flags
66 ECR_SPIxCONSET = 0b1 <<5;//Master
67 ECR_SPIxCONSET = 0b1 <<6;//blabla
68 //ECR_SPIxCONSET = 0b1 <<8;//blabla
69 
70 ECR_SPIxCONSET = 0b1 <<15;//On
71 //ECR_SPIxBRG = 10; //4max ou d�conne// select clock speed// clock divider Fpb/(2 * (n+1))
72 /*Initialiser ds ERREURS_HELLO*/
73 
74 temp=0;
75 
76 #endif
77 
78 
79 }
#define ECR_mSPIxClearAllIntFlags
Definition: Definitions.h:147
#define ECR_mSPIxIntDisable
Definition: Definitions.h:143
#define ECR_mSPIxINT_PRIORITY
Definition: Definitions.h:140
#define ECR_mSPIxSetIntPriority
Definition: Definitions.h:148
#define ECR_mSPIxSetIntSubPriority
Definition: Definitions.h:149
#define ECR_SPIxBUF
Definition: Definitions.h:145
#define ECR_mSPIxINT_SUBPRIORITY
Definition: Definitions.h:141
#define ECR_SPIxCONSET
Definition: Definitions.h:151
#define LCD_RST_Dir
Definition: Definitions.h:236
#define LCD_AO_Dir
Definition: Definitions.h:224
#define ECR_SPIxCON
Definition: Definitions.h:144
#define LCD_CS
Definition: Definitions.h:229
#define LCD_CS_Dir
Definition: Definitions.h:230
#define ECR_mSPIxRXIntEnable
Definition: Definitions.h:150

◆ StartSPI_ECR()

void StartSPI_ECR ( void  )
101 {
102  static unsigned int temp=0;
103 
104 #if defined ECR_ON
105  //ECR_mSPIxClearAllIntFlags();
107  //ECR_mSPIxRXIntEnable(1);
108 
109 
110  ECR_SPIxCONSET = 0b1 <<15;//On
111  if(ECR_SPIxSTATbits.SPIRBF){temp=ECR_SPIxBUF;}//Si buffer plein
112 
113  ECR_SPIxBUF = 0xE3;//NOP Pour lancer l'interruption
114 #endif
115 }
#define ECR_SPIxBUF
Definition: Definitions.h:145
#define ECR_SPIxCONSET
Definition: Definitions.h:151
#define ECR_SPIxSTATbits
Definition: Definitions.h:155
#define ECR_mSPIxRXClearIntFlag
Definition: Definitions.h:156

◆ StopSPI_ECR()

void StopSPI_ECR ( void  )
83 {
84  static unsigned int temp=0;
85 
86 #if defined ECR_ON
87  //LCD_RST=0;//reset on//Plus stable sans?
88  LCD_CS=1;//CS
89 
90  temp=ECR_SPIxBUF;
91 
92  ECR_SPIxCONCLR = 0b1 <<15;//Off
93 
94  SPI2_ecr=0;
95 
96 #endif
97 }
#define ECR_SPIxCONCLR
Definition: Definitions.h:153
#define ECR_SPIxBUF
Definition: Definitions.h:145
#define LCD_CS
Definition: Definitions.h:229

Variable Documentation

◆ tactil_compt

int tactil_compt

◆ tactil_x_max

int tactil_x_max

◆ tactil_y_max

int tactil_y_max