/********************************************************************************************************************** * DISCLAIMER * This software is supplied by Renesas Electronics Corporation and is only intended for use with Renesas products. No * other uses are authorized. This software is owned by Renesas Electronics Corporation and is protected under all * applicable laws, including copyright laws. * THIS SOFTWARE IS PROVIDED "AS IS" AND RENESAS MAKES NO WARRANTIES REGARDING * THIS SOFTWARE, WHETHER EXPRESS, IMPLIED OR STATUTORY, INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. ALL SUCH WARRANTIES ARE EXPRESSLY DISCLAIMED. TO THE MAXIMUM * EXTENT PERMITTED NOT PROHIBITED BY LAW, NEITHER RENESAS ELECTRONICS CORPORATION NOR ANY OF ITS AFFILIATED COMPANIES * SHALL BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES FOR ANY REASON RELATED TO * THIS SOFTWARE, EVEN IF RENESAS OR ITS AFFILIATES HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. * Renesas reserves the right, without notice, to make changes to this software and to discontinue the availability of * this software. By using this software, you agree to the additional terms and conditions found by accessing the * following link: * http://www.renesas.com/disclaimer * * Copyright (C) 2020 Renesas Electronics Corporation. All rights reserved. *********************************************************************************************************************/ /***********************************************************************/ /* */ /* FILE :Main.c or Main.cpp */ /* DATE :Tue, Oct 31, 2006 */ /* DESCRIPTION :Main Program */ /* CPU TYPE : */ /* */ /* NOTE:THIS IS A TYPICAL EXAMPLE. */ /* */ /***********************************************************************/ //#include "typedefine.h" #include "r_smc_entry.h" #pragma address g_sci_tx_buf=0x00800000 #pragma address g_sci_rx_buf=0x00801000 unsigned char g_sci_tx_buf[0x1000]; unsigned char g_sci_rx_buf[0x1000]; volatile unsigned long g_sci_txi_count = 0; //TXI割り込みの回数をカウント volatile unsigned long g_sci_tei_count = 0; //TEI割り込みの回数をカウント volatile unsigned long g_sci_rxi_count = 0; //RXI割り込みの回数をカウント void sci_tx_buf_copy(unsigned char *buf); #ifdef __cplusplus //#include // Remove the comment when you use ios //_SINT ios_base::Init::init_cnt; // Remove the comment when you use ios #endif void main(void); #ifdef __cplusplus extern "C" { void abort(void); } #endif void main(void) { unsigned long i; unsigned char dummy1, dummy2; //メモリ初期化 for (i=0; i<0x1000; i++) { g_sci_tx_buf[i] = 0x00; g_sci_rx_buf[i] = 0x00; } R_Config_SCI1_Start(); R_Config_DMAC4_Start(); R_Config_DMAC5_Start(); //受信側 DMAC5.DMCRA = 10; //受信10バイト R_Config_SCI1_Serial_Receive(&dummy1, 1); //RE=RIE1に設定 //送信側 sci_tx_buf_copy("SCI DMAC test\r\n"); //0x0080_0000~にコピー(15バイト) DMAC4.DMCRA = 15; //送信15バイト R_Config_SCI1_Serial_Send(&dummy2, 1); //DMAC起動トリガ while(1) { __nop(); } } #ifdef __cplusplus void abort(void) { } #endif void sci_tx_buf_copy(unsigned char *buf) { unsigned long index = 0; while (*buf != '\0') { g_sci_tx_buf[index++] = *buf++; } }