|
/***********************************************************************/
|
|
/* */
|
|
/* 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. */
|
|
/***********************************************************************/
|
|
|
|
#include "sfr32c87.h"
|
|
char t;
|
|
|
|
/* void init_keyboard(void);
|
|
void tpo_50ms(void);
|
|
unsigned char touche = 0;*/
|
|
|
|
void main(void){
|
|
|
|
char touche = 'X';
|
|
pd10 = 0xF0;
|
|
p10 = 0xFF;
|
|
pu30 = 1;
|
|
t = p10;
|
|
p10 = 0x00;
|
|
|
|
while(1){
|
|
p10 = 0x0F; // On part de la premi?re colonne
|
|
t = p10;
|
|
if (t != 0x0F){
|
|
|
|
if (t == 0x07){ //On change un bit pour voir
|
|
touche = '#';
|
|
}
|
|
|
|
if (t == 0x0e){ //On change un bit pour voir
|
|
touche = '3';
|
|
}
|
|
|
|
if (t == 0x0d){ //On change un bit pour voir
|
|
touche = '6';
|
|
}
|
|
|
|
if (t == 0x0b){ //On change un bit pour voir
|
|
touche = '9';
|
|
}
|
|
|
|
|
|
p10 = 0xEF; // On d?finit un premier chiffre pour commencer la v?rif
|
|
t = p10; //On r?cup?re la valeur appuy?e
|
|
|
|
if (t == 0xE7){ //On change un bit pour voir
|
|
touche = '*';
|
|
}
|
|
if (t == 0xEB){
|
|
touche = '7';
|
|
}
|
|
|
|
|
|
p10 = 0xDF; // On d?finit un premier chiffre pour commencer la v?rif
|
|
t = p10; //On r?cup?re la valeur appuy?e
|
|
|
|
if (t == 0xD7){ //On regarde la premi?re colonne
|
|
touche = '0'; //V
|
|
}
|
|
if (t == 0xDB){ //On change un bit pour voir
|
|
touche = '8'; //V
|
|
}
|
|
if (t == 0xDD){
|
|
// p10 = 0xDF;
|
|
touche = '5'; //V
|
|
}
|
|
if (t == 0xDE){
|
|
touche = '2'; //V
|
|
}
|
|
|
|
p10 = 0xBF; // On d?finit un premier chiffre pour commencer la v?rif
|
|
t = p10; //On r?cup?re la valeur appuy?e
|
|
|
|
if (t == 0xBD){ //On change un bit pour voir
|
|
touche = '4'; // V
|
|
}
|
|
|
|
if (t == 0xBE){ //On change un bit pour voir
|
|
touche = '1'; // V
|
|
}
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|