Révision 802
Ajouté par beboucheix il y a presque 4 ans
branch/boucheix/sp4c12/Sp4c1/Sp4c1/SessionM32C_E8a_SYSTEM.ini | ||
---|---|---|
PROCESSOR_MODE=0
|
||
[COMMUNI]
|
||
COMSPEED=8
|
||
COMSPEED PROGRAM FLASH=8
|
||
COMSPEED DATA FLASH=8
|
||
[Driver Configuration]
|
||
Renesas Communications=USB interface,0,
|
||
[Target]
|
branch/boucheix/sp4c12/Sp4c1/Sp4c1/Sp4c1.c | ||
---|---|---|
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
||
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
||
/***********************************************************************/
|
||
#include"sfr32c87.h"
|
||
#include "sfr32c87.h"
|
||
|
||
void uart0_init(void)
|
||
{
|
||
u0mr = 0x05;
|
||
u0brg = 0x20;
|
||
u0c0 = 0x11;
|
||
u0c1 = 0x05;
|
||
pd6_0 = 0;
|
||
pd6_1 = 0;
|
||
pd6_2 = 0;
|
||
pd6_3 = 1;
|
||
ps0 = 0x08;
|
||
}
|
||
|
||
void uart0_init(void);
|
||
void uart0_tx(char c)
|
||
{
|
||
U0MR=0b00000101;
|
||
U0SMR=0b00000000;
|
||
U0C0=0b00010101;
|
||
U0C1=0b00000101;
|
||
U0brg=0b00100000;
|
||
pd6=0b00001000;
|
||
ps0=0b10001000;
|
||
|
||
while(ti_u0c1!=1);
|
||
u0tb=c;
|
||
}
|
||
void uart0_tx(char c){
|
||
char uart0_rx()
|
||
{
|
||
while(ri_u0c1!=1);
|
||
return u0rb;
|
||
}
|
||
|
||
void main (void) {
|
||
|
||
int etat=0;
|
||
uart0_init();
|
||
pd1=0xff;
|
||
|
||
if((uart0_rx())=='$'){
|
||
p1=0xff;
|
||
|
||
if((uart0_rx())=='*'){
|
||
p1=0x0f;
|
||
|
||
}
|
||
}
|
||
}
|
||
|
||
/*char c='A';
|
||
int i;
|
||
uart0_init();
|
||
|
||
while(1){
|
||
i=0;
|
||
while (i<26){
|
||
uart0_tx(c+i);
|
||
i++;
|
||
}
|
||
}
|
||
*/
|
||
|
||
|
||
|
||
|
||
|
||
|
Formats disponibles : Unified diff
fin de tp