Révision 779
Ajouté par mukis il y a plus de 4 ans
| branch/KIS/sp4c12/Uart/Uart/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]
|
||
|
M32C E8a SYSTEM=Renesas Communications
|
||
|
[USER_DATA]
|
||
|
RESET=fe0000
|
||
| branch/KIS/sp4c12/Uart/Uart/Uart.c | ||
|---|---|---|
|
/* This file is generated by Renesas Project Generator (Ver.4.18). */
|
||
|
/* NOTE:THIS IS A TYPICAL EXAMPLE. */
|
||
|
/***********************************************************************/
|
||
|
#include "sfr32c87.h"
|
||
|
void uart0_init(void);
|
||
|
void uart0_tx(char c);
|
||
|
//char uart0_rx(void);
|
||
|
|
||
|
void main(void)
|
||
|
{
|
||
|
uart0_init();
|
||
|
while(1)
|
||
|
{
|
||
|
uart0_tx('c');
|
||
|
}
|
||
|
}
|
||
|
|
||
|
void uart0_init(void)
|
||
|
{
|
||
|
|
||
|
pd6_1=0;
|
||
|
pd6_2=0;
|
||
|
ps0_1=0;
|
||
|
ps0_2=0;
|
||
|
ps0_3=1;
|
||
|
|
||
|
//UART Mode
|
||
|
smd0_u0mr =1;
|
||
|
smd1_u0mr =0;
|
||
|
smd2_u0mr =1;
|
||
|
ckdir_u0mr=0;
|
||
|
stps_u0mr =0;
|
||
|
//pry_u0mr =0;
|
||
|
prye_u0mr =0;
|
||
|
iopol_u0mr=0;
|
||
|
|
||
|
//UART Special Mode
|
||
|
u0smr =0x00;
|
||
|
u0smr2=0x00;
|
||
|
u0smr3=0x00;
|
||
|
u0smr4=0x00;
|
||
|
|
||
|
//UART Transmit/Receive Control Register 0
|
||
|
clk0_u0c0 =1;
|
||
|
clk1_u0c0 =0;
|
||
|
crs_u0c0 =0;
|
||
|
crd_u0c0 =0;
|
||
|
nch_u0c0 =0;
|
||
|
ckpol_u0c0=0;
|
||
|
uform_u0c0=0;
|
||
|
|
||
|
//Baud Rate
|
||
|
u0brg = 0x20;
|
||
|
|
||
|
//UART Transmit/Receive Control Register 1
|
||
|
te_u0c1 =0;
|
||
|
re_u0c1 =0;
|
||
|
/*u0irs_u0c1 =1;
|
||
|
u0rrm_u0c1 =0;
|
||
|
u0lch_u0c1 =0;
|
||
|
sclkstpb_u0c1=0;*/
|
||
|
}
|
||
|
|
||
|
void uart0_tx(char c)
|
||
|
{
|
||
|
crd_u0c0=1;
|
||
|
crs_u0c0=0;
|
||
|
te_u0c1=1;
|
||
|
u0tb =c;
|
||
|
te_u0c1=0;
|
||
|
}
|
||
Formats disponibles : Unified diff
Envoie d'un caractere