Projet

Général

Profil

/***********************************************************************/
/* */
/* FILE :SP4b1.c */
/* DATE :Wed, Jun 02, 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 uart0_init(void); // Initialisation du port s?rie
void uart0_tx(char c); //Envoie d'un caract?re
char uart0_rx(void); //Fonction d'attente et lecture d'un caract?re
int rectrame(char * Buffer);

void main(void)
{
int i = 0;
uart0_init();
while (1){
uart0_tx( uart0_rx()+1 );


}
}

void uart0_init(void){
u0mr = 0x05;
u0brg = 32;
u0c0 = 0x11;
u0c1 = 0x05;
pd6 = 0x08;
psl0 = 0x00;
ps0 = 0x08;
}

void uart0_tx(char c){
while (ti_u0c1 != 1);
u0tb = c;
}

char uart0_rx(void){
while (ri_u0c1 != 1);
return u0rb;
}

int rectrame(char * Buffer){
int i = 0;
while (uart0_rx() != 0x0D && uart0_rx() != 0x0A){
}
}
(2-2/9)