Projet

Général

Profil

« Précédent | Suivant » 

Révision 763

Ajouté par jileng il y a presque 4 ans

leng commit sp4c1 fichier main .c et uart0.c , uart0.h

Voir les différences:

branch/leng/sp4c12/sp4c1/sp4c1/uart0.h
/* This file is generated by Renesas Project Generator (Ver.4.18). */
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
/***********************************************************************/
void uart0_init(void);
char uart0_txchar(char c) ;
void uart0_init(void)
{
}
void uart0_tx(char c);
branch/leng/sp4c12/sp4c1/sp4c1/sp4c1.c
/***********************************************************************/
//importation bibliotheque
#include "sfr32c87.h"
#include "uart0.h"
void main(void)
{
char c;
char i='a';
int k=0;
while(1){
uart0_init();
c=uart0_txchar('a');
c=uart0_txchar(i);
for(k=0;k<=26;k++)
{
c=uart0_txchar(i+k);
}
}
}
branch/leng/sp4c12/sp4c1/sp4c1/uart0.c
/***********************************************************************/
//importation bibliotheque
#include "sfr32c87.h"
#include "uart0.h"
void uart0_init(void)
{
//fonction envoyant un caract?re sur la liaison s?rie
//cts entr?e
pd6_0 = 0;
ps0_0=0;
//rts sortie
psl0_0 = 0;
ps0_0 = 1;
//CLK entr?e
pd6_1 = 0;
ps0_1=0;
//RXD0 entr?e
pd6_2=0;
ps0_2=0;
//TX sortie
//psl0_3 = 0;
ps0_3 = 1;
//p240 datasheet mode Uart 8bits
u0brg=0;
smd0_u0mr =1;
smd1_u0mr = 0;
smd2_u0mr = 1;
//u0c0=0;
//u0c1=0x11;
u0brg=00000001;
u0tb=0;
}
char uart0_txchar(char c)
{
//transmission de c
u0tb=c;
return u0tb;
}
void uart0_tx(char c)
{
//transmission de c
u0tb=c;
}
//reception u0rb p248

Formats disponibles : Unified diff