root/branch/dia/sp4b1/SP4b1/SP4b1.c @ 700
555 | modia3 | /***********************************************************************/
|
|
/* */
|
|||
/* FILE :SP4b1.c */
|
|||
/* DATE :Wed, May 26, 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. */
|
|||
/***********************************************************************/
|
|||
566 | modia3 | #include "sfr32c87.h"
|
|
void init_keyboard(void);
|
|||
char t;
|
|||
700 | modia3 | char touche;
|
|
555 | modia3 | void main(void)
|
|
{
|
|||
566 | modia3 | pd10=0xF0;
|
|
p10=0xFF;
|
|||
t=p10;
|
|||
pu30=1;
|
|||
p10=0x00;
|
|||
t=p10;
|
|||
700 | modia3 | while(1)
|
|
{
|
|||
t=p10;
|
|||
if(t!=0x0F) // si une touche est appuy?
|
|||
{
|
|||
p10=0xEF; // test de la touche * et 7
|
|||
t=p10;
|
|||
if(t==0xEB)
|
|||
{
|
|||
touche='7';
|
|||
}
|
|||
if(t==0xE7)
|
|||
{
|
|||
touche='*';
|
|||
}
|
|||
p10=0x7F;
|
|||
t=p10;
|
|||
if(t==0x7E)
|
|||
{
|
|||
touche='3';
|
|||
}
|
|||
if(t==0x7D)
|
|||
{
|
|||
touche='6';
|
|||
}
|
|||
if(t==0x7B)
|
|||
{
|
|||
touche='9';
|
|||
}
|
|||
if(t==0x77)
|
|||
{
|
|||
touche='#';
|
|||
}
|
|||
p10=0xDF;
|
|||
t=p10;
|
|||
if(t==0xDE)
|
|||
{
|
|||
touche='2';
|
|||
}
|
|||
if(t==0xDD)
|
|||
{
|
|||
touche='5';
|
|||
}
|
|||
if(t==0xDB)
|
|||
{
|
|||
touche='8';
|
|||
}
|
|||
if(t==0xD7)
|
|||
{
|
|||
touche='0';
|
|||
}
|
|||
p10=0xBF;
|
|||
t=p10;
|
|||
if(t==0xBE)
|
|||
{
|
|||
touche='1';
|
|||
}
|
|||
if(t==0xBD)
|
|||
{
|
|||
touche='4';
|
|||
}
|
|||
}
|
|||
}
|
|||
}
|
|||