root/branch/CHAMBELLON/sp4b2/SP4b2/SP4b2.c @ 712
712 | rochambell | /***********************************************************************/
|
|
/* */
|
|||
/* FILE :SP4b2.c */
|
|||
/* DATE :Fri, May 28, 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"
|
|||
/* definition des ports connect?s au micro-controlleur*/
|
|||
#define port pd3
|
|||
#define LCD_RS p3_0
|
|||
#define LCD_RW p3_1
|
|||
#define LCD_E p3_2
|
|||
#define LCD_B4 p3_4
|
|||
#define LCD_B5 p3_5
|
|||
#define LCD_B6 p3_6
|
|||
#define LCD_B7 p3_7
|
|||
void LCD_init_port(void);
|
|||
/*D?claration des fonction utilis?es*/
|
|||
void tpo_us(unsigned short duree);
|
|||
void tpo_ms(unsigned short duree);
|
|||
void LCD_4b(unsigned char car);
|
|||
void LCD_8b(unsigned char car);
|
|||
void LCD_com(unsigned char car);
|
|||
void LCD_init(void);
|
|||
void LCD_char(unsigned char car);
|
|||
void LCD_str(unsigned char *str);
|
|||
void init_keyboard(void);
|
|||
void tpo_50ms(void);
|
|||
void decode_touche(unsigned char ct,unsigned char* val_t);
|
|||
//D?claration des variables
|
|||
unsigned char t = 0;
|
|||
unsigned char ct1 = 0;
|
|||
unsigned char ct2e = 0;
|
|||
unsigned char ct = 0;
|
|||
unsigned char val_t;
|
|||
void LCD_init_port(void){
|
|||
port = 0xFF;
|
|||
}v
|
|||
void LCD_4b(unsigned char c){
|
|||
LCD_E = 1; //Pr?t ? envoyer une donn?e (sur front descendant)
|
|||
if (c & 128){ //Si le bits de poids fort vaut 1
|
|||
LCD_B7 = 1; //Application d'un 1 sur la sortie
|
|||
}
|
|||
else{
|
|||
LCD_B7 = 0; //Sinon application d'un 0 sur la sortie
|
|||
}
|
|||
if (c & 64){
|
|||
LCD_B6 = 1;
|
|||
}
|
|||
else{
|
|||
LCD_B6 = 0;
|
|||
}
|
|||
if (c & 32){
|
|||
LCD_B5 = 1;
|
|||
}
|
|||
else{
|
|||
LCD_B5 = 0;
|
|||
}
|
|||
if (c & 16){
|
|||
LCD_B4 = 1;
|
|||
}
|
|||
else{
|
|||
LCD_B4 = 0;
|
|||
}
|
|||
LCD_E = 0; //Donn?e envoy?e
|
|||
}
|
|||
void LCD_8b(unsigned char c){
|
|||
LCD_4b(c); //Envoi du bit de poids fort
|
|||
LCD_4b(c<<4); //Envoi du bit de poids faible
|
|||
}
|
|||
void main(void)
|
|||
{
|
|||
}
|