root/branch/Morales/sp4b1/SP4b1/SP4b1.c @ 540
331 | mamorales | /***********************************************************************/
|
|
/* */
|
|||
/* FILE :SP4b1.c */
|
|||
/* DATE :Tue, May 18, 2021 */
|
|||
/* DESCRIPTION :main program file. */
|
|||
/* CPU GROUP :87B */
|
|||
/* */
|
|||
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
|||
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
|||
/***********************************************************************/
|
|||
#include "sfr32c87.h"
|
|||
void init_keyboard(void);
|
|||
void tpo_50ms(void) ;
|
|||
unsigned char touche = 0;
|
|||
344 | mamorales | char t;
|
|
331 | mamorales | void main(void)
|
|
{
|
|||
344 | mamorales | pd10 = 0x0F;pu31=1;
|
|
p10=0x00;
|
|||
331 | mamorales | ||
while(1)
|
|||
{
|
|||
540 | mamorales | char touche;
|
|
char c;
|
|||
451 | mamorales | p10=0x07; // bits de pooid fort de la forme 0111
|
|
344 | mamorales | t=p10;
|
|
540 | mamorales | c = t & 0xf0;
|
|
if ((t&0xf0)!=0xf0) //test les bits de poids forts. Si le bit de poid for de t est != de f, alors t&0xF0 sera != de 0xF0
|
|||
331 | mamorales | {
|
|
344 | mamorales | touche=p10;
|
|
540 | mamorales | switch (t)
|
|
{
|
|||
case 0b11100111:
|
|||
touche ='*';
|
|||
break;
|
|||
}
|
|||
331 | mamorales | }
|
|
344 | mamorales | p10=0x0B;
|
|
t=p10;
|
|||
540 | mamorales | if((t&0xf0)!=0xf0)
|
|
344 | mamorales | {
|
|
touche=p10;
|
|||
}
|
|||
p10=0x0D;
|
|||
t=p10;
|
|||
540 | mamorales | if((t&0xf0)!=0xf0)
|
|
344 | mamorales | {
|
|
touche=p10;
|
|||
}
|
|||
p10=0x0E;
|
|||
t=p10;
|
|||
540 | mamorales | if((t&0xf0)!=0xf0)
|
|
344 | mamorales | {
|
|
touche=p10;
|
|||
}
|
|||
}
|
|||
331 | mamorales | ||
}
|