Projet

Général

Profil

« Précédent | Suivant » 

Révision 608

Ajouté par mukis il y a presque 4 ans

Fin du code clavier matriciel ainsi que creation du nouveau HEW pour lcd.

Voir les différences:

SP4b1.c
/***********************************************************************/
#include "sfr32c87.h"
/*void init_keyboard(void);
void tpo_50ms(void);
unsigned char touche = 0;*/
char t;
char touche;
void main(void)
{
......
{
p10=0xEF; // colonne de droite a 0
t=p10;
if (t == 0x0F) //une touche est apuyee
if (t == 0xEB) //une touche est apuyee
{
touche='7';
}
if (t == 0xE7) //une touche est apuyee
{
touche='*';
}
p10=0x7F; // colonne du milieu a 0
t=p10;
if (t == 0x7E) //une touche est apuyee
{
touche='3';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0x7D) //une touche est apuyee
{
touche='6';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0x7B) //une touche est apuyee
{
touche='9';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0x77) //une touche est apuyee
{
touche='#';
}
p10=0xDF; // colonne du milieu a 0
t=p10;
if (t == 0x0F) //une touche est apuyee
if (t == 0xDE) //une touche est apuyee
{
touche='2';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0xDD) //une touche est apuyee
{
touche='5';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0xDB) //une touche est apuyee
{
touche='8';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0xD7) //une touche est apuyee
{
touche='0';
}
p10=0xBF; // colonne de gauche a 0
t=p10;
if (t == 0x0F) //une touche est apuyee
if (t == 0xBE) //une touche est apuyee
{
touche='1';
}
if (t == 0x0F) //une touche est apuyee
if (t == 0xBD) //une touche est apuyee
{
touche='4';
}
if (t == 0x0F) //une touche est apuyee
{
touche='7';
}
if (t == 0x0F) //une touche est apuyee
{
touche='*';
}
}
}
}
/*void main(void)
{
init_keyboard();
while(1)
{
if ( (p10 & 0xf0)!= 0xf0 )
{
touche = p10;
tpo_50ms();
}
}
}
void init_keyboard(void)
{
pd10 = 0x0F;
p10=0;
pu31 = 1;
}
void tpo_50ms(void)
{
tcspr = 0x8A;
ta0mr = 0x82;
ta0 = 50000;
ta0s = 1;
ta0os = 1;
ta0ic = 0x00;
while(ir_ta0ic != 1);
ta0s = 0;
}*/

Formats disponibles : Unified diff