cs+ code generator tool - renesas electronics...r20ut3103ej0130 rev.1.30 page 6 of 375 oct 01, 2016...

375
www.renesas.com User’s Manual All information contained in these materials, including products and product specifications, represents information on the product at the time of publication and is subject to change by Renesas Electronics Corp. without notice. Please review the latest information published by Renesas Electronics Corp. through various means, including the Renesas Electronics Corp. website (http://www.renesas.com). CS+ Code Generator Tool Integrated Development Environment User's Manual: RX API Reference Target Device RX Family Target Tool CS+ V4.01.00 Rev.1.30 Oct 2016

Upload: others

Post on 31-Jul-2020

4 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

www.renesas.com

User’s M

anual

All information contained in these materials, including products and product specifications,represents information on the product at the time of publication and is subject to change byRenesas Electronics Corp. without notice. Please review the latest information published byRenesas Electronics Corp. through various means, including the Renesas Electronics Corp.website (http://www.renesas.com).

CS+ Code Generator ToolIntegrated Development Environment

User's Manual: RX API Reference

Target Device

RX Family

Target Tool

CS+ V4.01.00

Rev.1.30 Oct 2016

Page 2: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

Notice 1. Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of

semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software, and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from the use of these circuits, software, or information.

2. Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages incurred by you resulting from errors in or omissions from the information included herein.

3. Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of Renesas Electronics or others.

4. You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part. Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration, modification, copy or otherwise misappropriation of Renesas Electronics product.

5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The recommended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below. “Standard”: Computers; office equipment; communications equipment; test and measurement equipment; audio and visual

equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots etc. “High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anti-

crime systems; and safety equipment etc. Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to human life or bodily injury (artificial life support devices or systems, surgical implantations etc.), or may cause serious property damages (nuclear reactor control systems, military equipment etc.). You must check the quality grade of each Renesas Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any application for which it is not intended. Renesas Electronics shall not be in any way liable for any damages or losses incurred by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas Electronics.

6. You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics, especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or damages arising out of the use of Renesas Electronics products beyond such specified ranges.

7. Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further, Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation of microcomputer software alone is very difficult, please evaluate the safety of the final products or systems manufactured by you.

8. Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive. Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.

9. Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You should not use Renesas Electronics products or technology described in this document for any purpose relating to military applications or use by the military, including but not limited to the development of weapons of mass destruction. When exporting the Renesas Electronics products or technology described in this document, you should comply with the applicable export control laws and regulations and follow the procedures required by such laws and regulations.

10. It is the responsibility of the buyer or distributor of Renesas Electronics products, who distributes, disposes of, or otherwise places the product with a third party, to notify such third party in advance of the contents and conditions set forth in this document, Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of unauthorized use of Renesas Electronics products.

11. This document may not be reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas Electronics.

12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products, or if you have any other inquiries.

(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majority-owned subsidiaries.

(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.

(2012.4)

Page 3: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

How to Use This Manual

This manual describes the role of the CS+ integrated development environment for developing applications and sys-tems for RX family, and provides an outline of its features.

CS+ is an integrated development environment (IDE) for RX family, integrating the necessary tools for the development phase of software (e.g. design, implementation, and debugging) into a single platform.

By providing an integrated environment, it is possible to perform all development using just this product, without the need to use many different tools separately.

Readers This manual is intended for users who wish to understand the functions of the CS+ and design software and hardware application systems.

Purpose This manual is intended to give users an understanding of the functions of the CS+ to use for reference in developing the hardware or software of systems using these devices.

We aim to help their system development including their hardware and software.

Organization This manual can be broadly divided into the following units.

1.GENERAL2.OUTPUT FILES3.API FUNCTIONS

How to Read This Manual It is assumed that the readers of this manual have general knowledge of electricity, logic circuits, and microcontrollers.

Conventions Data significance: Higher digits on the left and lower digits on the right

Active low representation: XXX (overscore over pin or signal name)

Note: Footnote for item marked with Note in the text

Caution: Information requiring particular attention

Remark: Supplementary information

Numeric representation: Decimal ... XXXXHexadecimal ... 0xXXXX

All trademarks and registered trademarks are the property of their respective owners.

Page 4: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

TABLE OF CONTENTS

1. GENERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

1.2 Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6

2. OUTPUT FILES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

2.1 Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7

3. API FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.2 Function Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

3.2.1 Common . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19

3.2.2 Clock generation circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34

3.2.3 Voltage detection circuit (LVDA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

3.2.4 Clock frequency accuracy measurement circuit (CAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.2.5 Low power consumption . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 54

3.2.6 Interrupt controller (ICU) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 64

3.2.7 Buses . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 79

3.2.8 DMA Controller(DMAC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 86

3.2.9 Data transfer controller (DTC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 96

3.2.10 Event link controller (ELC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 101

3.2.11 I/O ports . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

3.2.12 Multi-function timer pulse unit 2 (MTU2). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 113

3.2.13 Multi-function timer pulse unit 3 (MTU3). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123

3.2.14 Port output enable 2 (POE2) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 133

3.2.15 Port output enable 3 (POE3) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 141

3.2.16 General PWM timer (GPT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 151

3.2.17 16-bit timer pulse unit (TPU). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 164

3.2.18 8-bit timer (TMR). . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 172

3.2.19 Programmable pulse generator (PPG) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 179

3.2.20 Compare match timer (CMT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 182

3.2.21 Compare match timer W (CMTW) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 188

3.2.22 Realtime clock (RTC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 196

3.2.23 Watchdog timer (WDT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219

3.2.24 Independent watchdog timer (IWDT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 225

3.2.25 Serial communications interface (SCI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 231

3.2.26 FIFO embedded serial communications interface (SCIFA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258

3.2.27 I2C bus interface (RIIC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 275

3.2.28 Serial peripheral interface (RSPI) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 293

Page 5: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

3.2.29 CRC calculator (CRC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 307

3.2.30 12-bit A/D converter (S12AD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

3.2.31 D/A converter (DA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 325

3.2.32 12-bit converter (R12DA) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331

3.2.33 Comparator B (CMPB) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 339

3.2.34 Data operation circuit (DOC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 345

3.2.35 Low power timer (LPT) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 353

3.2.36 Comparator C (CMPC) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 358

3.2.37 LCD controller / driver (LCD) . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 364

Revision Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 371

Page 6: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 6 of 375Oct 01, 2016

CS+ Code Generator Tool 1. GENERAL

1. GENERAL

Code Generator Tool is a software tool that automatically generates device drivers.This manual explains about .This manual gives Output files and API functions.

1.1 Overview

Code Generator tool enables you to output the pin assignment of the microcontroller (device pin list and device top view), and the source code (device driver programs, C source files and header files) necessary to control the peripheral functions (clock generator, port functions, etc.) provided by the microcontroller by configuring various information using the GUI.

1.2 Features

The Code Generator tool has the following features.

- Code generating functionThe Code Generator can output not only device driver programs in accordance with the information configured using the GUI, but also a build environment such as sample programs containing main functions and link directive files.

- Reporting functionYou can output configured information using the Pin Configurator/Code Generator as files in various formats for use as design documents.

- Renaming functionThe user can change default names assigned to the files output by the Code Generator and the API functions con-tained in the source code.

- User code protective functionThe user can add user's original source code to each API function.When user generated the device driver programs again by the Code Generator, user's source code within this comment is protected.

[Comment for user source code descriptions]/* Start user code. Do not edit comment generated here *//* End user code. Do not edit comment generated here */

Page 7: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 2. OUTPUT FILES

R20UT3103EJ0130 Rev.1.30 Page 7 of 375Oct 01, 2016

2. OUTPUT FILES

This appendix describes the files output by the Code Generator.

2.1 Description

Below is a list of output file files by the Code Generator.

Table 2.1 Output File List

Peripheral Function File Name API Function Name output(*1)

Common r_cg_dbsct.c - -

r_cg_hardware_setup.c

HardwareSetupR_Systeminit

AA

r_cg_intprg.c r_undefined_exceptionr_privileged_exceptionr_floatingpoint_exceptionr_access_exceptionr_nmi_exceptionr_brk_exceptionr_reserved_exception

AAAAAAA

r_cg_main.c mainR_MAIN_UserInit

AA

r_cg_resetprg.c PowerON_ResetPowerON_Reset_PC

AA

r_cg_sbrk.c - -

r_cg_vecttbl.c - -

r_cg_macrodriver.h - -

r_cg_sbrk.h - -

r_cg_stacksct.h - -

r_cg_userdefine.h - -

r_cg_vect.h - -

Clock generation circuit r_cg_cgc.c R_CGC_CreateR_CGC_Set_ClockMode

AM

r_cg_cgc_user.c R_CGC_Create_UserInitr_cgc_oscillation_stop_interruptr_cgc_oscillation_stop_nmi_interrupt

MAA

r_cg_cgc.h - -

Voltage detection circuit (LVDA) r_cg_lvd.c R_LVDn_CreateR_LVDn_StartR_LVDn_Stop

AAA

r_cg_lvd_user.c R_LVDn_Create_UserInitr_lvd_lvdn_interrupt

MA

r_cg_lvd.h - -

Page 8: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 8 of 375Oct 01, 2016

CS+ Code Generator Tool 2. OUTPUT FILES

Clock frequency accuracy measure-ment circuit (CAC)

r_cg_cac.c R_CAC_CreateR_CAC_StartR_CAC_Stop

AAA

r_cg_cac_user.c R_CAC_Create_UserInitr_cac_mendf_interruptr_cac_ferrf_interruptr_cac_ovff_interrupt

MAAA

r_cg_cac.h - -

Low power consumption r_cg_lpc.c R_LPC_CreateR_LPC_AllModuleClockStopR_LPC_ChangeSleepModeRetrunClockR_LPC_SleepR_LPC_DeepSleepR_LPC_DeepSoftwareStandbyR_LPC_SoftwareStandbyR_LPC_ChangeOperationPowerControl

AAAAAAAA

r_cg_lpc_user.c R_LPC_Create_UserInit M

r_cg_lpc.h - -

Interrupt controller (ICU) r_cg_icu.c R_ICU_CreateR_ICU_IRQn_StartR_ICU_IRQn_StopR_ICU_Software_StartR_ICU_Software2_StartR_ICU_Software_StopR_ICU_Software2_StopR_ICU_SoftwareInterrupt_GenerateR_ICU_SoftwareInterrupt2_Generate

AAAAAAAAA

r_cg_icu_user.c R_ICU_Create_UserInitr_icu_irqn_interruptr_icu_software_interruptr_icu_software2_interruptr_icu_nmi_interrupt

MAAAA

r_cg_icu.h - -

Buses r_cg_bsc.c R_BSC_CreateR_BSC_Error_Monitoring_StartR_BSC_Error_Monitoring_StopR_BSC_InitializeSDRAM

AAAA

r_cg_bsc_user.c R_BSC_Create_UserInitr_bsc_buserr_interrupt

MA

r_cg_bsc.h - -

Peripheral Function File Name API Function Name output(*1)

Page 9: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 2. OUTPUT FILES

R20UT3103EJ0130 Rev.1.30 Page 9 of 375Oct 01, 2016

DMA Controller(DMAC) r_cg_dmac.c R_DMAC_CreateR_DMACn_StartR_DMACn_StopR_DMACn_Set_SoftwareTriggerR_DMACn_Clear_SoftwareTrigger

AAAAA

r_cg_dmac_user.c r_dmac_dmacni_interruptr_dmacn_callback_transfer_endr_dmacn_callback_transfer_escape_endR_DMAC_Create_UserInit

AAAM

r_cg_dmac.h - -

Data transfer controller (DTC) r_cg_dtc.c R_DTC_CreateR_DTCm_StartR_DTCm_Stop

AAA

r_cg_dtc_user.c R_DTC_Create_UserInit M

r_cg_dtc.h - -

Event link controller (ELC) r_cg_elc.c R_ELC_CreateR_ELC_StartR_ELC_StopR_ELC_GenerateSoftwareEventR_ELC_Set_PortBuffernR_ELC_Get_PortBuffern

AAAAAA

r_cg_elc_user.c R_ELC_Create_UserInitr_elc_elsrni_interrupt

MA

r_cg_elc.h - -

I/O ports r_cg_port.c R_PORT_Create A

r_cg_port_user.c R_PORT_Create_UserInit M

r_cg_port.h - -

Multi-function timer pulse unit 2 (MTU2)

r_cg_mtu2.c R_MTU2_CreateR_MTU2_Cn_StartR_MTU2_Cn_Stop

AAA

r_cg_mtu2_user.c R_MTU2_Create_UserInitr_mtu2_tgimn_interruptr_mtu2_cj_tgimn_interruptr_mtu2_tcivn_interruptr_mtu2_cj_tcivn_interruptr_mtu2_tciun_interrupt

MAAAAA

r_cg_mtu2.h - -

Peripheral Function File Name API Function Name output(*1)

Page 10: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 10 of 375Oct 01, 2016

CS+ Code Generator Tool 2. OUTPUT FILES

Multi-function timer pulse unit 3 (MTU3)

r_cg_mtu3.c R_MTU3_CreateR_MTU3_Cn_StartR_MTU3_Cn_Stop

AAA

r_cg_mtu3_user.c R_MTU3_Create_UserInitr_mtu3_tgimn_interruptr_mtu3_cj_tgimn_interruptr_mtu3_tcivn_interruptr_mtu3_cj_tcivn_interruptr_mtu3_tciun_interrupt

MAAAAA

r_cg_mtu3.h - -

Port output enable 2 (POE2) r_cg_poe2.c R_POE2_CreateR_POE2_StartR_POE2_StopR_POE2_Set_HiZ_MTUnR_POE2_Clear_HiZ_MTUn

AAAAA

r_cg_poe2_user.c R_POE2_Create_UserInitr_poe2_oein_interrupt

MA

r_cg_poe2.h - -

Port output enable 3 (POE3) r_cg_poe3.c R_POE3_CreateR_POE3_StartR_POE3_StopR_POE3_Set_HiZ_MTUnR_POE3_Clear_HiZ_MTUnR_POE3_Set_HiZ_GPTnR_POE3_Clear_HiZ_GPTn

AAAAAAA

r_cg_poe3_user.c R_POE3_Create_UserInitr_poe3_oein_interrupt

MA

r_cg_poe3.h - -

General PWM timer (GPT) r_cg_gpt.c R_GPT_CreateR_GPTn_StartR_GPTn_StopR_GPTn_HardwareStartR_GPTn_HardwareStop

AAAAA

r_cg_gpt_user.c R_GPT_Create_UserInitr_gpt_gtcimn_interruptr_gpt_gtcivn_interruptr_gpt_gtciun_interruptr_gpt_gdten_interruptr_gpt_etgip_interruptr_gpt_etgin_interrupt

MAAAAAA

r_cg_gpt.h - -

Peripheral Function File Name API Function Name output(*1)

Page 11: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 2. OUTPUT FILES

R20UT3103EJ0130 Rev.1.30 Page 11 of 375Oct 01, 2016

16-bit timer pulse unit (TPU) r_cg_tpu.c R_TPU_CreateR_TPUn_StartR_TPUn_Stop

AAA

r_cg_tpu_user.c R_TPU_Create_UserInitr_tpu_tginm_interruptr_tpu_tcinv_interruptr_tpu_tcinu_interrupt

MAAA

r_cg_tpu.h - -

8-bit timer (TMR) r_cg_tmr.c R_TMR_CreateR_TMRn_StartR_TMRn_Stop

AAA

r_cg_tmr_user.c R_TMR_Create_UserInitr_tmr_cmimn_interruptr_tmr_ovin_interrupt

MAA

r_cg_tmr.h - -

Programmable pulse generator (PPG) r_cg_ppg.c R_PPG_Create A

r_cg_ppg_user.c R_PPG_Create_UserInit M

r_cg_ppg.h - -

Compare match timer (CMT) r_cg_cmt.c R_CMTn_CreateR_CMTn_StartR_CMTn_Stop

AAA

r_cg_cmt_user.c R_CMTn_Create_UserInitr_cmt_cmin_interrupt

MA

r_cg_cmt.h - -

Compare match timer W (CMTW) r_cg_cmtw.c R_CMTWn_CreateR_CMTWn_StartR_CMTWn_Stop

AAA

r_cg_cmtw_user.c R_CMTWn_Create_UserInitr_cmtw_cmwin_interruptr_cmtw_icmin_interruptr_cmtw_ocmin_interrupt

MAAA

r_cg_cmtw.h - -

Peripheral Function File Name API Function Name output(*1)

Page 12: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 12 of 375Oct 01, 2016

CS+ Code Generator Tool 2. OUTPUT FILES

Realtime clock (RTC) r_cg_rtc.c R_RTC_CreateR_RTC_Set_CalendarAlarmR_RTC_Set_BinaryAlarmR_RTC_Set_ConstPeriodInterruptOnR_RTC_Set_ConstPeriodInterruptOffR_RTC_Set_CarryInterruptOnR_RTC_Set_CarryInterruptOffR_RTC_Set_RTCOUTOnR_RTC_Set_RTCOUTOffR_RTC_StartR_RTC_StopR_RTC_RestartR_RTC_Set_CalendarCounterValueR_RTC_Get_CalendarCounterValueR_RTC_Set_BinaryCounterValueR_RTC_Get_BinaryCounterValueR_RTC_Get_CalendarTimeCaptureValuenR_RTC_Get_BinaryTimeCaptureValuen

AAAAAAAAAAAAAAAAAA

r_cg_rtc_user.c R_RTC_Create_UserInitr_rtc_alm_interruptr_rtc_prd_interruptr_rtc_cup_interrupt

MAAA

r_cg_rtc.h - -

Watchdog timer (WDT) r_cg_wdt.c R_WDT_CreateR_WDT_Restart

AA

r_cg_wdt_user.c R_WDT_Create_UserInitr_wdt_nmi_interruptr_wdt_wuni_interrupt

MAA

r_cg_wdt.h - -

Independent watchdog timer (IWDT) r_cg_iwdt.c R_IWDT_CreateR_IWDT_Restart

AA

r_cg_iwdt_user.c R_IWDT_Create_UserInitr_iwdt_nmi_interruptr_iwdt_iwuni_interrupt

MAA

r_cg_iwdt.h - -

Peripheral Function File Name API Function Name output(*1)

Page 13: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 2. OUTPUT FILES

R20UT3103EJ0130 Rev.1.30 Page 13 of 375Oct 01, 2016

Serial communications interface (SCI) r_cg_sci.c R_SCIn_CreateR_SCIn_StartR_SCIn_StopR_SCIn_Serial_SendR_SCIn_Serial_ReceiveR_SCIn_Serial_Multiprocessor_SendR_SCIn_Serial_Multiprocessor_ReceiveR_SCIn_Serial_Send_ReceiveR_SCIn_SmartCard_SendR_SCIn_SmartCard_ReceiveR_SCIn_IIC_Master_SendR_SCIn_IIC_Master_ReceiveR_SCIn_SPI_Master_SendR_SCIn_SPI_Master_Send_ReceiveR_SCIn_SPI_Slave_SendR_SCIn_SPI_Slave_Send_ReceiveR_SCIn_IIC_StartConditionR_SCIn_IIC_StopCondition

AAAAAAAAAAAAAAAAAA

r_cg_sci_user.c R_SCIn_Create_UserInitr_scin_transmitend_interruptr_scin_transmit_interruptr_scin_receive_interruptr_scin_receiveerror_interruptr_scin_callback_transmitendr_scin_callback_receiveendr_scin_callback_receiveerror

MAAAAAAA

r_cg_sci.h - -

FIFO embedded serial communica-tions interface (SCIFA)

r_cg_scifa.c R_SCIFAn_CreateR_SCIFAn_StartR_SCIFAn_StopR_SCIFAn_Serial_SendR_SCIFAn_Serial_ReceiveR_SCIFAn_Serial_Send_Receive

AAAAAA

r_cg_scifa_user.c R_SCIFAn_Create_UserInitr_scifan_teif_interruptr_scifan_txif_interruptr_scifan_rxif_interruptr_scifan_erif_interruptr_scifan_brif_interruptr_scifan_drif_interruptr_scifan_callback_transmitendr_scifan_callback_receiveendr_scifan_callback_error

MAAAAAAAAA

r_cg_scifa.h - -

Peripheral Function File Name API Function Name output(*1)

Page 14: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 14 of 375Oct 01, 2016

CS+ Code Generator Tool 2. OUTPUT FILES

I2C bus interface (RIIC) r_cg_riic.c R_RIICn_CreateR_RIICn_StartR_RIICn_StopR_RIICn_Master_SendR_RIICn_Master_ReceiveR_RIICn_Slave_SendR_RIICn_Slave_ReceiveR_RIICn_StartConditionR_RIICn_StopCondition

AAAAAAAAA

r_cg_riic_user.c R_RIICn_Create_UserInitr_riicn_error_interruptr_riicn_receive_interruptr_riicn_transmit_interruptr_riicn_transmitend_interruptr_riicn_callback_receiveerrorr_riicn_callback_transmitendr_riicn_callback_receiveend

MAAAAAAA

r_cg_riic.h - -

Serial peripheral interface (RSPI) r_cg_rspi.c R_RSPIn_CreateR_RSPIn_StartR_RSPIn_StopR_RSPIn_SendR_RSPIn_Send_Receive

AAAAA

r_cg_rspi_user.c R_RSPIn_Create_UserInitr_rspin_receive_interruptr_rspin_transmit_interruptr_rspin_error_interruptr_rspin_idle_interruptr_rspin_callback_receiveendr_rspin_callback_errorr_rspin_callback_transmitend

MAAAAAAA

r_cg_rspi.h - -

CRC calculator (CRC) r_cg_crc.c R_CRC_SetCRC8R_CRC_SetCRC16R_CRC_SetCCITTR_CRC_SetCRC32R_CRC_SetCRC32CR_CRC_Input_DataR_CRC_Get_Result

AAAAAAA

r_cg_crc.h - -

12-bit A/D converter (S12AD) r_cg_s12ad.c R_S12ADn_CreateR_S12ADn_StartR_S12ADn_StopR_S12ADn_Get_ValueResultR_S12ADn_Set_CompareValue

AAAAA

r_cg_s12ad_user.c R_S12ADn_Create_UserInitr_s12adn_interruptr_s12adn_groupb_interruptr_s12adn_compare_interrupt

MAAA

r_cg_s12ad.h - -

Peripheral Function File Name API Function Name output(*1)

Page 15: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 2. OUTPUT FILES

R20UT3103EJ0130 Rev.1.30 Page 15 of 375Oct 01, 2016

D/A converter (DA) r_cg_da.c R_DA_CreateR_DAm_StartR_DAm_StopR_DAm_Set_ConversionValue

AAAA

r_cg_da_user.c R_DA_Create_UserInit M

r_cg_da.h - -

12-bit converter (R12DA) r_cg_r12da.c R_R12DA_CreateR_R12DAn_StartR_R12DAn_StopR_R12DAn_Set_ConversionValueR_R12DA_sync_StartR_R12DA_sync_Stop

AAAAAA

r_cg_r12da_user.c R_DA_Create_UserInit M

r_cg_r12da.h - -

Comparator B (CMPB) r_cg_cmpb.c R_CMPB_CreateR_CMPBn_StartR_CMPBn_Stop

AAA

r_cg_cmpb_user.c R_CMPB_Create_UserInitr_cmpb_cmpbn_interrupt

MA

r_cg_cmpb.h - -

Data operation circuit (DOC) r_cg_doc.c R_DOC_CreateR_DOC_SetModeR_DOC_WriteDataR_DOC_GetResultR_DOC_ClearFlag

AAAAA

r_cg_doc_user.c R_DOC_Create_UserInitr_doc_dopcf_interrupt

MA

r_cg_doc.h -

Low power timer (LPT) r_cg_lpt.c R_LPT_CreateR_LPT_StartR_LPT_Stop

AAA

r_cg_lpt_user.c R_LPT_Create_UserInit M

r_cg_lpt.h - -

Comparator C (CMPC) r_cg_cmpc.c R_CMPC_CreateR_CMPCn_StartR_CMPCn_Stop

AAA

r_cg_cmpc_user.c R_CMPC_Create_UserInitr_cmpc_cmpcn_interrupt

MA

r_cg_cmpc.h - -

Peripheral Function File Name API Function Name output(*1)

Page 16: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 16 of 375Oct 01, 2016

CS+ Code Generator Tool 2. OUTPUT FILES

*1 In case of [API output control] setting are default ([Output all API functions according to the setting]).  A:Output by settings on each peripheral functions panel automatically.  M:Output by the file used setting in API property.

LCD controller / driver (LCD) r_cg_cld.c R_LCD_CreateR_LCD_StartR_LCD_StopR_LCD_Voltage_OnR_LCD_Voltage_Off

AAAAA

r_cg_lcd_user.c R_LCD_Create_UserInit M

r_cg_lcd.h - -

Peripheral Function File Name API Function Name output(*1)

Page 17: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 17 of 375Oct 01, 2016

3. API FUNCTIONS

This appendix describes the API functions output by the Code Generator.

3.1 Overview

Below are the naming conventions for API functions output by the Code Generator.

- Macro names are in ALL CAPS.The number in front of the macro name is a hexadecimal value; this is the same value as the macro value.

- Local variable names are in all lower case.

- Global variable names start with a "g" and use Camel Case.

- Names of pointers to global variables start with a "gp" and use Camel Case.

- Names of elements in enum statements are in ALL CAPS.

3.2 Function Reference

This section describes the API functions output by the Code Generator, using the following notation format.

Figure 3.1 Notation Format of API Functions

(1) NameIndicates the name of the API function.

(2) OutlineOutlines the functions of the API function.

(3) [Syntax]Indicates the format to be used when describing an API function to be called in C language.

(4) [Argument(s)]API function arguments are explained in the following format.

I/O Argument Description

(a) (b) (c)

(1)

(2)

(3)

(4)

(5)

I/O Argument Description

DescriptionMacro

...

... .........

... .........

.........

.........

[Syntax]

[Argument(s)]

[Return value]

...........................

...........................

...........................

Page 18: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 18 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

(a) I/OArgument classificationI ... Input argumentO ... Output argument

(b) ArgumentArgument data type

(c) DescriptionDescription of argument

(5) [Return value]API function return value is explained in the following format.

(a) MacroMacro of return value

(b) DescriptionDescription of return value

Macro Description

(a) (b)

Page 19: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 19 of 375Oct 01, 2016

3.2.1 Common

Below is a list of API functions output by the Code Generator for common use.Performs processing in response to the exception (other than undefined instruction exception, reset, non-maskable

interrupt and unconditional trap).

Table 3.1 API Functions: [Common]

API Function Name Function

r_undefined_exception Performs processing in response to the undefined instruction exception.

PowerON_Reset Performs processing in response to the reset.

PowerON_Reset_PC Performs processing in response to the reset

r_privileged_exception Performs processing in response to the privileged instruction exception.

r_floatingpoint_exception Performs processing in response to the floating-point exception.

r_access_exception Performs processing in response to the access exception.

r_nmi_exception Performs processing in response to the non-maskable interrupt.

r_brk_exception Performs processing in response to the unconditional trap.

r_reserved_exception Performs processing in response to the exception (other than undefined instruction exception, reset, non-maskable interrupt and unconditional trap).

HardwareSetup Performs initialization necessary to control the various hardwares.

R_Systeminit Performs initialization necessary to control the various peripheral functions.

main This is a main function.

R_MAIN_UserInit Performs user-defined initialization.

r_icu_group_n_interrupt Performs processing in response to the group interrupt.

Page 20: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 20 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the undefined instruction exception.

Remark This API function is called to run interrupt processing in response to an undefined instruction exception occurred when detecting the undefined instruction (unimplemented instruction) execution.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_undefined_exception

void r_undefined_exception ( void );

Page 21: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 21 of 375Oct 01, 2016

Performs processing in response to the reset.

Remark This API function is called to run interrupt processing for an internal reset by the power-on reset circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

PowerON_Reset

void PowerON_Reset ( void );

Page 22: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 22 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the reset.

Remark This API function is called to run interrupt processing for an internal reset by the power-on reset circuit.

[Syntax]

[Argument(s)]

None.

[Return value]None.

PowerON_Reset_PC

void PowerON_Reset_PC ( void );

Page 23: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 23 of 375Oct 01, 2016

Performs processing in response to the privileged instruction exception.

Remark This API function is called to run interrupt processing in response to a privilegedundefined instruction exception occurred when detecting the execution of a privileged instruction in user mode.

[Syntax]

[Argument(s)]

None.

[Return value]None.

r_privileged_exception

void r_privileged_exception ( void );

Page 24: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 24 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the floating-point exception.

Remark This API function is called to run interrupt processing in response to a floating-point exception occurred when detecting the five exception events ( overflow, underflow, inexact, division-by-zero, and invalid operation ) specified in the IEEE754 standard and another floating-point exception that is generated on detection of unimplemented processing.

[Syntax]

[Argument(s)]

None.

[Return value]None.

r_floatingpoint_exception

void r_floatingpoint_exception ( void );

Page 25: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 25 of 375Oct 01, 2016

Performs processing in response to the access exception.

Remark This API function is called to run interrupt processing in response to an access exception occurred when detecting the memory-protection error, and data memory protection error.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_access_exception

void r_access_exception ( void );

Page 26: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 26 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the non-maskable interrupt.

Remark This API function is called to run interrupt processing for the non-maskable interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_nmi_exception

void r_nmi_exception ( void );

Page 27: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 27 of 375Oct 01, 2016

Performs processing in response to the unconditional trap.

Remark This API function is called to run interrupt processing for an unconditional trap.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_brk_exception

void r_brk_exception ( void );

Page 28: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 28 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the exception (other than undefined instruction exception, reset, non-maskable interrupt and unconditional trap).

Remark This API function is called to run interrupt processing for the exceptions other than undefined instruction exception, reset, non-maskable interrupt, and unconditional trap.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_reserved_exception

void r_reserved_exception ( void );

Page 29: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 29 of 375Oct 01, 2016

Performs initialization necessary to control the various hardwares.

Remark This API function is called as the PowerON_Reset callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

HardwareSetup

void HardwareSetup ( void );

Page 30: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 30 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the various peripheral functions.

Remark This API function is called as the HardwareSetup callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_Systeminit

void R_Systeminit ( void );

Page 31: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 31 of 375Oct 01, 2016

This is a main function.

Remark This API function is called as the PowerON_Reset callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

main

void main ( void );

Page 32: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 32 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization.

Remark This API function is called as the main callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MAIN_UserInit

void R_MAIN_UserInit ( void );

Page 33: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 33 of 375Oct 01, 2016

Performs processing in response to the group interrupts.

[Syntax]

Remark n is the group interrupt number.

[Argument(s)]

None.

[Return value]

None.

r_icu_group_n_interrupt

void r_icu_group_n_interrupt ( void );

Page 34: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 34 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.2 Clock generation circuit

Below is a list of API functions output by the Code Generator for clock generation circuit use.

Table 3.2 API Functions: [Clock Generation Circuit]

API Function Name Function

R_CGC_Create Performs initialization required to control the clock generation circuit.

R_CGC_Create_UserInit Performs user-defined initialization relating to the clock generation circuit.

r_cgc_oscillation_stop_interrupt Performs processing in response to the osillation stop detection inter-rupt.

r_cgc_oscillation_stop_nmi_interrupt Performs processing in response to the oscillation stop detection NMI.

R_CGC_Set_ClockMode Sets the clock source.

Page 35: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 35 of 375Oct 01, 2016

Performs initialization required to control the clock generation circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_Create

void R_CGC_Create ( void );

Page 36: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 36 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the clock generation circuit.

Remark This API function is called as the R_CGC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_Create_UserInit

void R_CGC_Create_UserInit ( void );

Page 37: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 37 of 375Oct 01, 2016

Performs processing in response to the oscillation stop detection interrupt.

Remark This API function is called to run interrupt processing for the oscillation stop detection interrupt, which is generated when the clock generation circuit detects oscillation by the main clock having stopped.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_cgc_oscillation_stop_interrupt

static void r_cgc_oscillation_stop_interrupt ( void );

Page 38: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 38 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the oscillation stop detection NMI.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_cgc_oscillation_stop_nmi_interrupt

static void r_cgc_oscillation_stop_nmi_interrupt ( void );

Page 39: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 39 of 375Oct 01, 2016

Sets the clock source.

[Syntax]

[Argument(s)]

[Return value]

R_CGC_Set_ClockMode

#include "r_cg_macrodriver.h"#include "r_cg_cgc.h"MD_STATUS R_CGC_Set_ClockMode ( clock_mode_t mode );

I/O Argument Description

I clock_mode_t mode; Clock source typeMAINCLK: Main clock oscillatorSUBCLK: Sub-clock oscillatorPLLCLK: PLL circuitHOCO: High-speed on-chip oscillatorLOCO: Low-speed on-chip oscillator

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

MD_ARGERROR Invalid argument mode specification

Page 40: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 40 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.3 Voltage detection circuit (LVDA)

Below is a list of API functions output by the Code Generator for voltage detection circuit use.

Table 3.3 API Functions: [Voltage Detection Circuit]

API Function Name Function

R_LVDn_Create Performs initialization necessary to control the voltage detection circuit.

R_LVDn_Create_UserInit Performs user-defined initialization relating to the voltage detection circuit.

r_lvd_lvdn_interrupt Performs processing in response to the voltage monitoring n interrupt.

R_LVDn_Start Starts voltage monitoring (when in interrupt mode, and interrupt & reset mode).

R_LVDn_Stop Ends voltage monitoring (when in interrupt mode, and interrupt & reset mode).

Page 41: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 41 of 375Oct 01, 2016

Performs initialization necessary to control the voltage detection circuit.

[Syntax]

Remark n is the circuit number.

[Argument(s)]

None.

[Return value]

None.

R_LVDn_Create

void R_LVDn_Create ( void );

Page 42: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 42 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the voltage detection circuit.

Remark This API function is called as the R_LVDn_Create callback routine.

[Syntax]

Remark n is the circuit number.

[Argument(s)]

None.

[Return value]

None.

R_LVDn_Create_UserInit

void R_LVDn_Create_UserInit ( void );

Page 43: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 43 of 375Oct 01, 2016

Performs processing in response to the voltage monitoring n interrupt.

Remark This API function is called to run interrupt processing for the voltage monitoring n interrupt, which is gen-erated when the voltage detection circuit detects the voltage being dropped.

[Syntax]

Remark n is the circuit number.

[Argument(s)]

None.

[Return value]

None.

r_lvd_lvdn_interrupt

static void r_lvd_lvdn_interrupt ( void );

Page 44: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 44 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts voltage monitoring (when in interrupt mode, and interrupt & reset mode).

[Syntax]

Remark n is the circuit number.

[Argument(s)]

None.

[Return value]

None.

R_LVDn_Start

void R_LVDn_Start ( void );

Page 45: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 45 of 375Oct 01, 2016

Ends voltage monitoring (when in interrupt mode, and interrupt & reset mode).

[Syntax]

Remark n is the circuit number.

[Argument(s)]

None.

[Return value]

None.

R_LVDn_Stop

void R_LVDn_Stop ( void );

Page 46: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 46 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.4 Clock frequency accuracy measurement circuit (CAC)

Below is a list of API functions output by the Code Generator for clock frequency accuracy measurement circuit use.

Table 3.4 API Functions: [Clock Frequency Accuracy Measurement Circuit]

API Function Name Function

R_CAC_Create Performs initialization necessary to control the clock frequency accuracy measurement circuit.

R_CAC_Create_UserInit Performs user-defined initialization relating to the clock frequency accuracy measurement circuit.

r_cac_mendf_interrupt Performs processing in response to the measurement end interrupt.

r_cac_ferrf_interrupt Performs processing in response to the frequency error interrupt.

r_cac_ovff_interrupt Performs processing in response to the overflow interrupt.

R_CAC_Start Starts measurement of the accuracy of the clock frequency.

R_CAC_Stop Ends measurement of the accuracy of the clock frequency.

Page 47: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 47 of 375Oct 01, 2016

Performs initialization necessary to control the clock frequency accuracy measurement circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAC_Create

void R_CAC_Create ( void );

Page 48: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 48 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the clock frequency accuracy measurement circuit.

Remark This API function is called as the R_CAC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAC_Create_UserInit

void R_CAC_Create_UserInit ( void );

Page 49: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 49 of 375Oct 01, 2016

Performs processing in response to the measurement end interrupt.

Remark This API function is called to run interrupt processing for the measurement end interrupt, which is gener-ated when the clock frequency accuracy measurement circuit detects the valid edge of the reference sig-nal.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_cac_mendf_interrupt

static void r_cac_mendf_interrupt ( void );

Page 50: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 50 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the frequency error interrupt.

Remark This API function is called to run interrupt processing for the frequency error interrupt, which is generated when the clock frequency is not in the allowed range (from the minimum to the maximum value).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_cac_ferrf_interrupt

static void r_cac_ferrf_interrupt ( void );

Page 51: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 51 of 375Oct 01, 2016

Performs processing in response to the overflow interrupt.

Remark This API function is called to run interrupt processing for the overflow interrupt, which is generated when the counter overflows.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_cac_ovff_interrupt

static void r_cac_ovff_interrupt ( void );

Page 52: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 52 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts measurement of the accuracy of the clock frequency.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAC_Start

void R_CAC_Start ( void );

Page 53: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 53 of 375Oct 01, 2016

Ends measurement of the accuracy of the clock frequency.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAC_Stop

void R_CAC_Stop ( void );

Page 54: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 54 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.5 Low power consumption

Below is a list of API functions output by the Code Generator for low power consumption use.

Table 3.5 API Functions: [Low Power Consumption]

API Function Name Function

R_LPC_Create Performs initialization required to control the low power consumption.

R_LPC_Create_UserInit Performs user-defined initialization relating to the low power consumption.

R_LPC_AllModuleClockStop Stops the clock for all modules.

R_LPC_ChangeSleepModeRetrunClock Sets the clock source that is selected following release from sleep mode.

R_LPC_Sleep Transits the low power consumption mode of the MCU to the sleep mode.

R_LPC_DeepSleep Transits the low power consumption mode of the MCU to the deep sleep mode.

R_LPC_DeepSoftwareStandby Transits the low power consumption mode of the MCU to the deep soft-ware standby mode.

R_LPC_SoftwareStandby Transits the low power consumption mode of the MCU to the software standby mode.

R_LPC_ChangeOperationPowerControl Changes the operating power control mode of the MCU.

Page 55: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 55 of 375Oct 01, 2016

Performs initialization required to control the low power consumption.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPC_Create

void R_LPC_Create ( void );

Page 56: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 56 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the low power consumption.

Remark This API function is called as the R_LPC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPC_Create_UserInit

void R_LPC_Create_UserInit ( void );

Page 57: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 57 of 375Oct 01, 2016

Stops the clock for all modules.

[Syntax]

[Argument(s)]

None.

[Return value]

R_LPC_AllModuleClockStop

#include "r_cg_macrodriver.h"MD_STATUS R_LPC_AllModuleClockStop ( void );

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

Page 58: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 58 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the clock source that is selected following release from sleep mode.

[Syntax]

[Argument(s)]

[Return value]

R_LPC_ChangeSleepModeRetrunClock

#include "r_cg_macrodriver.h"#include "r_cg_lpc.h"MD_STATUS R_LPC_ChangeSleepModeReturnClock ( return_clock_t clock );

I/O Argument Description

I return_clock_t clock; Clock source typeRETURN_LOCO: Low-speed on-chip oscillatorRETURN_HOCO: High-speed on-chip oscillatorRETURN_MAIN_CLOCK: Main clock oscillatorRETURN_DISABLE: Switching of the clock source does not proceed.

Macro Description

MD_OK Normal completion

MD_ERROR1 Change to the low-speed operating mode ended abnormally.

MD_ARGERROR Invalid argument clock specification

Page 59: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 59 of 375Oct 01, 2016

Transits the low power consumption mode of the MCU to the sleep mode.

[Syntax]

[Argument(s)]

None.

[Return value]

R_LPC_Sleep

#include "r_cg_macrodriver.h"MD_STATUS R_LPC_Sleep ( void );

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

Page 60: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 60 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Transits the low power consumption mode of the MCU to the deep sleep mode.

[Syntax]

[Argument(s)]

None.

[Return value]

R_LPC_DeepSleep

#include "r_cg_macrodriver.h"MD_STATUS R_LPC_DeepSleep ( void );

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

Page 61: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 61 of 375Oct 01, 2016

Transits the low power consumption mode of the MCU to the deep software standby mode.

[Syntax]

[Argument(s)]

None.

[Return value]

R_LPC_DeepSoftwareStandby

MD_STATUS R_LPC_DeepSoftwareStandby ( void );

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

Page 62: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 62 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Transits the low power consumption mode of the MCU to the software standby mode.

[Syntax]

[Argument(s)]

None.

[Return value]

R_LPC_SoftwareStandby

#include "r_cg_macrodriver.h"MD_STATUS R_LPC_SoftwareStandby ( void );

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

Page 63: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 63 of 375Oct 01, 2016

Changes the operating power control mode of the MCU.

[Syntax]

[Argument(s)]

[Return value]

R_LPC_ChangeOperationPowerControl

#include "r_cg_macrodriver.h"#include "r_cg_lpc.h"MD_STATUS R_LPC_ChangeOperationPowerControl ( operaring_mode_t mode );

I/O Argument Description

I operating_mode_t mode; Operating power control mode typeHIGH_SPEED: High-speed operating modeMIDDLE_SPEED: Middle-speed operating modeLOW_SPEED: Low-speed operating mode

Macro Description

MD_OK Normal completion

MD_ERROR1 Change to the low-speed operating mode ended abnormally.

MD_ERROR2 Change to the middle-speed operating mode is ended abnormally.

MD_ARGERROR Invalid argument mode specification

Page 64: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 64 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.6 Interrupt controller (ICU)

Below is a list of API functions output by the Code Generator for interrupt controller use.

Table 3.6 API Functions: [Interrupt Controller]

API Function Name Function

R_ICU_Create Performs initialization necessary to control the interrupt controller.

R_ICU_Create_UserInit Performs user-defined initialization relating to the interrupt controller.

r_icu_irqn_interrupt Performs processing in response to the external pin interrupts.

r_icu_software_interrupt Performs processing in response to the software interrupt.

r_icu_software2_interrupt Performs processing in response to the software interrupt2.

r_icu_nmi_interrupt Performs processing in response to the NMI pin interrupt.

R_ICU_IRQn_Start Allows detection of the external pin interrupt.

R_ICU_IRQn_Stop Prohibits detection of the external pin interrupt.

R_ICU_Software_Start Allows detection of the software interrupt.

R_ICU_Software2_Start Allows detection of the software interrupt2.

R_ICU_Software_Stop Prohibits detection of the software interrupt.

R_ICU_Software2_Stop Prohibits detection of the software interrupt2.

R_ICU_SoftwareInterrupt_Generate Generates the software interrupt.

R_ICU_SoftwareInterrupt2_Generate Generates the software interrupt2.

Page 65: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 65 of 375Oct 01, 2016

Performs initialization necessary to control the interrupt controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Create

void R_ICU_Create ( void );

Page 66: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 66 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the interrupt controller.

Remark This API function is called as the R_ICU_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Create_UserInit

void R_ICU_Create_UserInit ( void );

Page 67: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 67 of 375Oct 01, 2016

Performs processing in response to the external pin interrupts.

Remark This API function is called to run interrupt processing for the external pin interrupts.

[Syntax]

Remark n is the source number.

[Argument(s)]

None.

[Return value]

None.

r_icu_irqn_interrupt

static void r_icu_irqn_interrupt ( void );

Page 68: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 68 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the software interrupt.

Remark This API function is called to run the interrupt processing for the software interrupt, which is generated in response to calling of R_ICU_SoftwareInterrupt_Generate.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_icu_software_interrupt

static void r_icu_software_interrupt ( void );

Page 69: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 69 of 375Oct 01, 2016

Performs processing in response to the software interrupt2.

Remark This API function is called to run the interrupt processing for the software interrupt, which is generated in response to calling of R_ICU_SoftwareInterrupt2_Generate.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_icu_software2_interrupt

static void r_icu_software2_interrupt ( void );

Page 70: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 70 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the NMI pin interrupt.

Remark This API function is called to run interrupt processing for the NMI pin interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_icu_nmi_interrupt

static void r_icu_nmi_interrupt ( void );

Page 71: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 71 of 375Oct 01, 2016

Allows detection of the external pin interrupt.

[Syntax]

Remark n is the source number.

[Argument(s)]

None.

[Return value]

None.

R_ICU_IRQn_Start

void R_ICU_IRQn_Start ( void );

Page 72: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 72 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Prohibits detection of the external pin interrupt.

[Syntax]

Remark n is the source number.

[Argument(s)]

None.

[Return value]

None.

R_ICU_IRQn_Stop

void R_ICU_IRQn_Stop ( void );

Page 73: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 73 of 375Oct 01, 2016

Allows detection of the software interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Software_Start

void R_ICU_Software_Start ( void );

Page 74: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 74 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Allows detection of the software interrupt 2.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Software2_Start

void R_ICU_Software2_Start ( void );

Page 75: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 75 of 375Oct 01, 2016

Prohibits detection of the software interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Software_Stop

void R_ICU_Software_Stop ( void );

Page 76: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 76 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Prohibits detection of the software interrupt 2.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_Software2_Stop

void R_ICU_Software2_Stop ( void );

Page 77: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 77 of 375Oct 01, 2016

Generates the software interrupt.

Remark r_icu_software_interrupt is called in response to calling od this API function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_SoftwareInterrupt_Generate

void R_ICU_SoftwareInterrupt_Generate ( void );

Page 78: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 78 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Generates the software interrupt 2.

Remark r_icu_software2_interrupt is called in response to calling od this API function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ICU_SoftwareInterrupt2_Generate

void R_ICU_SoftwareInterrupt2_Generate ( void );

Page 79: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 79 of 375Oct 01, 2016

3.2.7 Buses

Below is a list of API functions output by the Code Generator for buses use.

Table 3.7 API Functions: [Buses]

API Function Name Function

R_BSC_Create Performs initialization necessary to control the buses.

R_BSC_Create_UserInit Performs user-defined initialization relating to the buses.

r_bsc_buserr_interrupt Performs processing in response to the bus error (illegal address access).

R_BSC_Error_Monitoring_Start Allows the detection of bus errors (illegal address access).

R_BSC_Error_Monitoring_Stop Prohibits the detection of bus errors (illegal address access).

R_BSC_InitializeSDRAM Performs initialization of SDRAM controller.

Page 80: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 80 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the buses.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BSC_Create

void R_BSC_Create ( void );

Page 81: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 81 of 375Oct 01, 2016

Performs user-defined initialization relating to the buses.

Remark This API function is called as the R_BSC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BSC_Create_UserInit

void R_BSC_Create_UserInit ( void );

Page 82: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 82 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the bus error (illegal address access).

Remarks 1. This API function is called to run interrupt processing for a bus error (illegal address access), which is generated through access by the processing program to a location within an illegal address range.

Remarks 2. The bus master that caused the bus error can be confirmed by reading the MST bit of bus error status register 1 (BERSR1) from within this API function.

Remarks 3. The illegal address (high-order 13 bits) that caused the bus error can be confirmed by reading the ADDR bit of bus error status register 2 (BERSR2) from within this API function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_bsc_buserr_interrupt

static void r_bsc_buserr_interrupt ( void );

Page 83: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 83 of 375Oct 01, 2016

Allows the detection of bus errors (illegal address access).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BSC_Error_Monitoring_Start

void R_BSC_Error_Monitoring_Start ( void );

Page 84: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 84 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Prohibits the detection of bus errors (illegal address access).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BSC_Error_Monitoring_Stop

void R_BSC_Error_Monitoring_Stop ( void );

Page 85: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 85 of 375Oct 01, 2016

Performs initialization of SDRAM controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BSC_InitializeSDRAM

void R_BSC_InitializeSDRAM ( void );

Page 86: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 86 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.8 DMA Controller(DMAC)

Below is a list of API functions output by the Code Generator for DMA controller use.

Table 3.8 API Functions: [DMA Controller]

API Function Name Function

R_DMAC_Create Performs initialization necessary to control the DMA controller.

R_DMAC_Create_UserInit Performs user-defined initialization relating to the DMA controller.

r_dmac_dmacni_interrupt Performs processing in response to the transfer end interrupt.

r_dmacn_callback_transfer_end Performs processing in response to the transfer end interrupt.

r_dmacn_callback_transfer_escape_end

Performs processing in response to the escape transfer end interrupt.

R_DMACn_Start Allows starting of the DMAC controller.

R_DMACn_Stop Prohibits starting of the DMAC controller.

R_DMACn_Set_SoftwareTrigger Sets the software request of DMA transfer by software.

R_DMACn_Clear_SoftwareTrigger Clears the software request of DMA transfer by software.

Page 87: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 87 of 375Oct 01, 2016

Performs initialization necessary to control the DMA controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DMAC_Create

void R_DMAC_Create ( void );

Page 88: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 88 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the DMA controller.

Remark This API function is called as the R_DMAC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DMAC_Create_UserInit

void R_DMAC_Create_UserInit ( void );

Page 89: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 89 of 375Oct 01, 2016

Performs processing in response to the transfer end interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dmac_dmacni_interrupt

static void r_dmac_dmacni_interrupt ( void );

Page 90: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 90 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transfer end interrupt.

Remark This API function is called as thecall r_dmac_dmacni_interrupt back routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dmacn_callback_transfer_end

static void r_dmacn_callback_transfer_end ( void );

Page 91: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 91 of 375Oct 01, 2016

Performs processing in response to the escape transfer end interrupt.

Remark This API function is called as the r_dmac_dmacni_interrupt callback routine, which is generated by escape transfer end.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dmacn_callback_transfer_escape_end

static void r_dmacn_callback_transfer_escape_end ( void );

Page 92: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 92 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Allows starting of the DMAC controller.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Start

void R_DMACn_Start ( void );

Page 93: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 93 of 375Oct 01, 2016

Prohibits starting of the DMAC controller.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Stop

void R_DMACn_Stop ( void );

Page 94: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 94 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the software request of DMA transfer by software.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Set_SoftwareTrigger

void R_DMACn_Set_SoftwareTrigger ( void );

Page 95: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 95 of 375Oct 01, 2016

Clears the software request of DMA transfer by software.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Clear_SoftwareTrigger

void R_DMACn_Clear_SoftwareTrigger ( void );

Page 96: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 96 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.9 Data transfer controller (DTC)

Below is a list of API functions output by the Code Generator for data transfer controller use.

Table 3.9 API Functions: [Data Transfer Controller]

API Function Name Function

R_DTC_Create Performs initialization necessary to control the data transfer controller.

R_DTC_Create_UserInit Performs user-defined initialization relating to the data transfer controller.

R_DTCm_Start Allows starting of the data transfer controller.

R_DTCm_Stop Prohibits starting of the data transfer controller.

Page 97: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 97 of 375Oct 01, 2016

Performs initialization necessary to control the data transfer controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DTC_Create

void R_DTC_Create ( void );

Page 98: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 98 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the data transfer controller.

Remark This API function is called as the R_DTC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DTC_Create_UserInit

void R_DTC_Create_UserInit ( void );

Page 99: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 99 of 375Oct 01, 2016

Allows starting the data transfer controller.

Remark In this API function, starting the data transfer controller is allowed by operating the DTCE bit of the DTC activation enable register n (DTCERn) supporting the transfer data number m.m is the transfer data number, n is the interrupt vector number.

[Syntax]

Remark m is the transfer data number.

[Argument(s)]

None.

[Return value]

None.

R_DTCm_Start

void R_DTCm_Start ( void );

Page 100: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 100 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Prohibits starting of the data transfer controller.

Remark In this API function, starting the data transfer controller is prohibited by operating the DTCE bit of the DTC activation enable register n (DTCERn) supporting the transfer data number m.m is the transfer data number, n is the interrupt vector number.

[Syntax]

Remark m is the transfer data number.

[Argument(s)]

None.

[Return value]

None.

R_DTCm_Stop

void R_DTCm_Stop ( void );

Page 101: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 101 of 375Oct 01, 2016

3.2.10 Event link controller (ELC)

Below is a list of API functions output by the Code Generator for event link controller use.

Table 3.10 API Functions: [Event Link Controller]

API Function Name Function

R_ELC_Create Performs initialization necessary to control the event link controller.

R_ELC_Create_UserInit Performs user-defined initialization relating to the event link controller.

r_elc_elsrni_interrupt Performs processing in response to the event link interrupt.

R_ELC_Start Starts interlinked operation of peripheral functions.

R_ELC_Stop Ends interlinked operation of peripheral functions.

R_ELC_GenerateSoftwareEvent Generates the software event.

R_ELC_Set_PortBuffern Sets the value of a port buffer.

R_ELC_Get_PortBuffern Gets the value of a port buffer.

Page 102: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 102 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the event link controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_Create

void R_ELC_Create ( void );

Page 103: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 103 of 375Oct 01, 2016

Performs user-defined initialization relating to the event link controller.

Remark This API function is called as the R_ELC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_Create_UserInit

void R_ELC_Create_UserInit ( void );

Page 104: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 104 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the event link interrupt.

Remark This API function is called to run interrupt processing for the event signal defined in event link setting reg-ister.n is the source number.

[Syntax]

Remark n is the source number.

[Argument(s)]

None.

[Return value]

None.

r_elc_elsrni_interrupt

static void r_elc_elsrni_interrupt ( void );

Page 105: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 105 of 375Oct 01, 2016

Starts interlinked operation of peripheral functions.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_Start

void R_ELC_Start ( void );

Page 106: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 106 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Ends interlinked operation of peripheral functions.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_Stop

void R_ELC_Stop ( void );

Page 107: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 107 of 375Oct 01, 2016

Generates the software event.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_GenerateSoftwareEvent

void R_ELC_GenerateSoftwareEvent ( void );

Page 108: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 108 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the value of a port buffer.

[Syntax]

Remark n is the source number.

[Argument(s)]

[Return value]

None.

R_ELC_Set_PortBuffern

void R_ELC_Set_PortBuffern ( uint8_t value );

I/O Argument Description

I uint8_t value; The value set in the port buffer.

Page 109: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 109 of 375Oct 01, 2016

Gets the value of a port buffer.

[Syntax]

Remark n is the source number.

[Argument(s)]

[Return value]

None.

R_ELC_Get_PortBuffern

void R_ELC_Get_PortBuffern ( uint8_t * const value );

I/O Argument Description

O uint8_t * const value; Pointer to the location where the obtained value is to be stored.

Page 110: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 110 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.11 I/O ports

Below is a list of API functions output by the Code Generator for I/O ports use.

Table 3.11 API Functions: [I/O Ports]

API Function Name Function

R_PORT_Create Performs initialization necessary to control the I/O ports.

R_PORT_Create_UserInit Performs user-defined initialization relating to the I/O ports.

Page 111: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 111 of 375Oct 01, 2016

Performs initialization necessary to control the I/O ports.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PORT_Create

void R_PORT_Create ( void );

Page 112: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 112 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the I/O ports.

Remark This API function is called as the R_PORT_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PORT_Create_UserInit

void R_PORT_Create_UserInit ( void );

Page 113: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 113 of 375Oct 01, 2016

3.2.12 Multi-function timer pulse unit 2 (MTU2)

Below is a list of API functions output by the Code Generator for multi-function timer pulse unit 2 use.

Table 3.12 API Functions: [Multi-Function Timer Pulse Unit 2]

API Function Name Function

R_MTU2_Create Performs initialization necessary to control the multi-function timer pulse unit 2.

R_MTU2_Create_UserInit Performs user-defined initialization relating to the multi-function timer pulse unit 2.

r_mtu2_tgimn_interrupt Performs processing in response to the input capture/compare match interrupt.

r_mtu2_cj_tgimn_interrupt Performs processing in response to the input capture/compare match interrupt.

r_mtu2_tcivn_interrupt Performs processing in response to the overflow interrupt.

r_mtu2_cj_tcivn_interrupt Performs processing in response to the overflow interrupt.

r_mtu2_tciun_interrupt Performs processing in response to the underflow interrupt.

R_MTU2_Cn_Start Starts counting by a 16-bit timer.

R_MTU2_Cn_Stop Ends counting by a 16-bit timer.

Page 114: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 114 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the multi-function timer pulse unit 2.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MTU2_Create

void R_MTU2_Create ( void );

Page 115: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 115 of 375Oct 01, 2016

Performs user-defined initialization relating to the multi-function timer pulse unit 2.

Remark This API function is called as the R_MTU2_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MTU2_Create_UserInit

void R_MTU2_Create_UserInit ( void );

Page 116: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 116 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the input capture/compare match interrupt.

Remark This API function is called to run interrupt processing for the input capture interrupt generated because multi-function timer pulse unit 2 detected the effective edge of the input signal or for the compare match interrupt generated because the current counter value (value of the timer counter, TCNT) matched the defined counter value (value of the timer general register, TGR).

[Syntax]

Remark m is the timer general register number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu2_tgimn_interrupt

static void r_mtu2_tgimn_interrupt ( void );

Page 117: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 117 of 375Oct 01, 2016

Performs processing in response to the input capture/compare match interrupt.

Remark This API function is called to run interrupt processing for the input capture interrupt generated because multi-function timer pulse unit 2 detected the effective edge of the input signal or for the compare match interrupt generated because the current counter value (value of the timer counter, TCNT) matched the defined counter value (value of the timer general register, TGR).

[Syntax]

Remark j is the relationship channel number, m is the timer general register number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu2_cj_tgimn_interrupt

static void r_mtu2_cj_tgimn_interrupt ( void );

Page 118: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 118 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the overflow interrupt.

Remark This API function is called to run interrupt processing for the overflow interrupt, which is generated in response to an overflow of the timer counter (TCNT).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu2_tcivn_interrupt

static void r_mtu2_tcivn_interrupt ( void );

Page 119: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 119 of 375Oct 01, 2016

Performs processing in response to the overflow interrupt.

Remark This API function is called to run interrupt processing for the overflow interrupt, which is generated in response to an overflow of the timer counter (TCNT).

[Syntax]

Remark j is the relationship channel number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu2_cj_tcivn_interrupt

static void r_mtu2_cj_tcivn_interrupt ( void );

Page 120: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 120 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the underflow interrupt.

Remark This API function is called to run interrupt processing for the underflow interrupt, which is generated in response to an underflow of the timer counter (TCNT).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu2_tciun_interrupt

static void r_mtu2_tciun_interrupt ( void );

Page 121: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 121 of 375Oct 01, 2016

Starts counting by the 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_MTU2_Cn_Start

void R_MTU2_Cn_Start ( void );

Page 122: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 122 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Ends counting by the 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_MTU2_Cn_Stop

void R_MTU2_Cn_Stop ( void );

Page 123: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 123 of 375Oct 01, 2016

3.2.13 Multi-function timer pulse unit 3 (MTU3)

Below is a list of API functions output by the Code Generator for multi-function timer pulse unit 3 use.

Table 3.13 API Functions: [Multi-Function Timer Pulse Unit 3]

API Function Name Function

R_MTU3_Create Performs initialization necessary to control the multi-function timer pulse unit 3.

R_MTU3_Create_UserInit Performs user-defined initialization relating to the multi-function timer pulse unit 3.

r_mtu3_tgimn_interrupt Performs processing in response to the input capture/compare match interrupt.

r_mtu3_cj_tgimn_interrupt Performs processing in response to the input capture/compare match interrupt.

r_mtu3_tcivn_interrupt Performs processing in response to the overflow interrupt.

r_mtu3_cj_tcivn_interrupt Performs processing in response to the overflow interrupt.

r_mtu3_tciun_interrupt Performs processing in response to the underflow interrupt.

R_MTU3_Cn_Start Starts counting by a 16-bit timer.

R_MTU3_Cn_Stop Ends counting by a 16-bit timer.

Page 124: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 124 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the multi-function timer pulse unit 3.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MTU3_Create

void R_MTU3_Create ( void );

Page 125: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 125 of 375Oct 01, 2016

Performs user-defined initialization relating to the multi-function timer pulse unit 3.

Remark This API function is called as the R_MTU3_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MTU3_Create_UserInit

void R_MTU3_Create_UserInit ( void );

Page 126: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 126 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the input capture/compare match interrupt.

Remark This API function is called to run interrupt processing for the input capture interrupt generated because multi-function timer pulse unit 3 detected the effective edge of the input signal or for the compare match interrupt generated because the current counter value (value of the timer counter, TCNT) matched the defined counter value (value of the timer general register, TGR).

[Syntax]

Remark m is the timer general register number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu3_tgimn_interrupt

static void r_mtu3_tgimn_interrupt ( void );

Page 127: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 127 of 375Oct 01, 2016

Performs processing in response to the input capture/compare match interrupt.

Remark This API function is called to run interrupt processing for the input capture interrupt generated because multi-function timer pulse unit 3 detected the effective edge of the input signal or for the compare match interrupt generated because the current counter value (value of the timer counter, TCNT) matched the defined counter value (value of the timer general register, TGR).

[Syntax]

Remark j is the relationship channel number, m is the timer general register number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu3_cj_tgimn_interrupt

static void r_mtu3_cj_tgimn_interrupt ( void );

Page 128: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 128 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the overflow interrupt.

Remark This API function is called to run interrupt processing for the overflow interrupt, which is generated in response to an overflow of the timer counter (TCNT).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu3_tcivn_interrupt

static void r_mtu3_tcivn_interrupt ( void );

Page 129: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 129 of 375Oct 01, 2016

Performs processing in response to the overflow interrupt.

Remark This API function is called to run interrupt processing for the overflow interrupt, which is generated in response to an overflow of the timer counter (TCNT).

[Syntax]

Remark j is the relationship channel number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu3_cj_tcivn_interrupt

static void r_mtu3_cj_tcivn_interrupt ( void );

Page 130: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 130 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the underflow interrupt.

Remark This API function is called to run interrupt processing for the underflow interrupt, which is generated in response to an underflow of the timer counter (TCNT).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_mtu3_tciun_interrupt

static void r_mtu3_tciun_interrupt ( void );

Page 131: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 131 of 375Oct 01, 2016

Starts counting by the 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_MTU3_Cn_Start

void R_MTU3_Cn_Start ( void );

Page 132: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 132 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Ends counting by the 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_MTU3_Cn_Stop

void R_MTU3_Cn_Stop ( void );

Page 133: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 133 of 375Oct 01, 2016

3.2.14 Port output enable 2 (POE2)

Below is a list of API functions output by the Code Generator for port output enable 2 use.

Table 3.14 API Functions: [Port Output Enable 2]

API Function Name Function

R_POE2_Create Performs initialization necessary to control the port output enable 2.

R_POE2_Create_UserInit Performs user-defined initialization relating to the port output enable 2.

r_poe2_oein_interrupt Performs processing in response to the output enable interrupt n (OEIn).

R_POE2_Start Places the MTU's complementary PWM output pins in the high-impedance state.

R_POE2_Stop Releases the R_POE2_Stop MTU's complementary PWM output pins from the high-impedance state.

R_POE2_Set_HiZ_MTUn Sets the high-impedance state for the MTUn pins.

R_POE2_Clear_HiZ_MTUn Clear the high-impedance state for the MTUn pins

Page 134: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 134 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the port output enable 2.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE2_Create

void R_POE2_Create ( void );

Page 135: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 135 of 375Oct 01, 2016

Performs user-defined initialization relating to the port output enable 2.

Remark This API function is called as the R_POE2_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE2_Create_UserInit

void R_POE2_Create_UserInit ( void );

Page 136: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 136 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the output enable interrupt n (OEIn).

Remark This API function is called to run interrupt processing for the output enable interrupt n (OEIn), which is generated when a pin (any of POE0#, POE1#, POE2#, POE3#, and POE8#) becomes high-impedance or the output short flag 1 is set.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_poe2_oein_interrupt

static void r_poe2_oein_interrupt ( void );

Page 137: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 137 of 375Oct 01, 2016

Places the MTU's complementary PWM output pins in the high-impedance state.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE2_Start

void R_POE2_Start ( void );

Page 138: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 138 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Releases the MTU's complementary PWM output pins from the high-impedance state.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE2_Stop

void R_POE2_Stop ( void );

Page 139: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 139 of 375Oct 01, 2016

Sets the high-impedance state for the MTUn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE2_Set_HiZ_MTUn

void R_POE2_Set_HiZ_MTUn ( void );

Page 140: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 140 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clear the high-impedance state for the MTUn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE2_Clear_HiZ_MTUn

void R_POE2_Clear_HiZ_MTUn ( void );

Page 141: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 141 of 375Oct 01, 2016

3.2.15 Port output enable 3 (POE3)

Below is a list of API functions output by the Code Generator for port output enable 3 use.

Table 3.15 API Functions: [Port Output Enable 3]

API Function Name Function

R_POE3_Create Performs initialization necessary to control the port output enable 3.

R_POE3_Create_UserInit Performs user-defined initialization relating to the port output enable 3.

r_poe3_oein_interrupt Performs processing in response to the output enable interrupt n (OEIn).

R_POE3_Start Places the MTU's complementary PWM output pins in the high-impedance state.

R_POE3_Stop Releases the R_POE3_Stop MTU's complementary PWM output pins from the high-impedance state.

R_POE3_Set_HiZ_MTUn Sets the high-impedance state for the MTUn pins.

R_POE3_Clear_HiZ_MTUn Clear the high-impedance state for the MTUn pins.

R_POE3_Set_HiZ_GPTn Sets the high-impedance state for the GPTn pins.

R_POE3_Clear_HiZ_GPTn Clear the high-impedance state for the GPTn pins.

Page 142: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 142 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the port output enable 3.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE3_Create

void R_POE3_Create ( void );

Page 143: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 143 of 375Oct 01, 2016

Performs user-defined initialization relating to the port output enable 3.

Remark This API function is called as the R_POE3_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE3_Create_UserInit

void R_POE3_Create_UserInit ( void );

Page 144: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 144 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the output enable interrupt.

Remark This API function is called to run interrupt processing for the output enable interrupt, which is generated when a related pin becomes high-impedance or the output short flag 1 is set.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_poe3_oein_interrupt

static void r_poe3_oein_interrupt ( void );

Page 145: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 145 of 375Oct 01, 2016

Places the related pins in the high-impedance state.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE3_Start

void R_POE3_Start ( void );

Page 146: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 146 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Replaces the related output pins from the high-impedance state.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_POE3_Stop

void R_POE3_Stop ( void );

Page 147: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 147 of 375Oct 01, 2016

Sets the high-impedance state for the MTUn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE3_Set_HiZ_MTUn

void R_POE3_Set_HiZ_MTUn ( void );

Page 148: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 148 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clear the high-impedance state for the MTUn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE3_Clear_HiZ_MTUn

void R_POE3_Clear_HiZ_MTUn ( void );

Page 149: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 149 of 375Oct 01, 2016

Sets the high-impedance state for the GPTn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE3_Set_HiZ_GPTn

void R_POE3_Set_HiZ_GPTn ( void );

Page 150: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 150 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clear the high-impedance state for the GPTn pins.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_POE3_Clear_HiZ_GPTn

void R_POE3_Clear_HiZ_GPTn ( void );

Page 151: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 151 of 375Oct 01, 2016

3.2.16 General PWM timer (GPT)

Below is a list of API functions output by the Code Generator for general PWM timer use.

Table 3.16 API Functions: [General PWM timer]

API Function Name Function

R_GPT_Create Performs initialization necessary to control the general PWM timer.

R_GPT_Create_UserInit Performs user-defined initialization relating to the general PWM timer.

r_gpt_gtcimn_interrupt Performs processing in response to the input capture/compare match interrupt.

r_gpt_gtcivn_interrupt Performs processing in response to the overflow interrupt.

r_gpt_gtciun_interrupt Performs processing in response to the underflow interrupt.

r_gpt_gdten_interrupt Performs processing in response to the dead time error interrupt.

r_gpt_etgip_interrupt Performs processing in response to the external trigger rising interrupt.

r_gpt_etgin_interrupt Performs processing in response to the external trigger falling interrupt.

R_GPTn_Start Starts counting by a 16-bit timer.

R_GPTn_Stop Ends counting by a 16-bit timer.

R_GPTn_HardwareStart Allows GPT interrupts.

R_GPTn_HardwareStop Prohibits GPT interrupts.

Page 152: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 152 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the general PWM timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_GPT_Create

void R_GPT_Create ( void );

Page 153: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 153 of 375Oct 01, 2016

Performs user-defined initialization relating to the general PWM timer.

Remark This API function is called as the R_GPT_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_GPT_Create_UserInit

void R_GPT_Create_UserInit ( void );

Page 154: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 154 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the input capture/compare match interrupt.

[Syntax]

Remark m is the timer general register number, n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_gpt_gtcimn_interrupt

static void r_gpt_gtcimn_interrupt ( void );

Page 155: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 155 of 375Oct 01, 2016

Performs processing in response to the overflow interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_gpt_gtcivn_interrupt

static void r_gpt_gtcivn_interrupt ( void );

Page 156: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 156 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the underflow interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_gpt_gtciun_interrupt

static void r_gpt_gtciun_interrupt ( void );

Page 157: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 157 of 375Oct 01, 2016

Performs processing in response to the dead time error interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_gpt_gdten_interrupt

static void r_gpt_gdten_interrupt ( void );

Page 158: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 158 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the external trigger rising interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_gpt_etgip_interrupt

static void r_gpt_eigip_interrupt ( void );

Page 159: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 159 of 375Oct 01, 2016

Performs processing in response to the external trigger falling interrupt.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_gpt_etgin_interrupt

static void r_gpt_etgin_interrupt ( void );

Page 160: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 160 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_GPTn_Start

void R_GPTn_Start ( void );

Page 161: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 161 of 375Oct 01, 2016

Ends counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_GPTn_Stop

void R_GPTn_Stop ( void );

Page 162: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 162 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Allows detection of GPT interrupts.

Remark This API function enables GPT interrupts when starting timer count by the hardware trigger.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_GPTn_HardwareStart

void R_GPTn_HardwareStart ( void );

Page 163: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 163 of 375Oct 01, 2016

Prohibits detection of GPT interrupts.

Remark This API function disables GPT interrupts when starting timer count by the hardware trigger.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_GPTn_HardwareStop

void R_GPTn_HardwareStop ( void );

Page 164: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 164 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.17 16-bit timer pulse unit (TPU)

Below is a list of API functions output by the Code Generator for 16-bit timer pulse unit use.

Table 3.17 API Functions: [16-bit timer pulse unit]

API Function Name Function

R_TPU_Create Performs initialization necessary to control the 16-bit timer pulse unit.

R_TPU_Create_UserInit Performs user-defined initialization relating to the 16-bit timer pulse unit.

r_tpu_tginm_interrupt Performs processing in response to the input capture/compare match interrupt.

r_tpu_tcinv_interrupt Performs processing in response to the overflow interrupt.

r_tpu_tcinu_interrupt Performs processing in response to the underflow interrupt.

R_TPUn_Start Starts counting by a 16-bit timer.

R_TPUn_Stop Ends counting by a 16-bit timer.

Page 165: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 165 of 375Oct 01, 2016

Performs initialization necessary to control the 16-bit timer pulse unit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TPU_Create

void R_TPU_Create ( void );

Page 166: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 166 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the 16-bit timer pulse unit.

Remark This API function is called as the R_TPU_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TPU_Create_UserInit

void R_TPU_Create_UserInit ( void );

Page 167: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 167 of 375Oct 01, 2016

Performs processing in response to the input capture/compare match interrupt.

[Syntax]

Remark m is the timer general register number, n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tpu_tginm_interrupt

static void r_tpu_tginm_interrupt ( void );

Page 168: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 168 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the overflow interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tpu_tcinv_interrupt

static void r_tpu_tcinv_interrupt ( void );

Page 169: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 169 of 375Oct 01, 2016

Performs processing in response to the underflow interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tpu_tcinu_interrupt

static void r_tpu_tcinu_interrupt ( void );

Page 170: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 170 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TPUn_Start

void R_TPUn_Start ( void );

Page 171: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 171 of 375Oct 01, 2016

Ends counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TPUn_Stop

void R_TPUn_Stop ( void );

Page 172: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 172 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.18 8-bit timer (TMR)

Below is a list of API functions output by the Code Generator for 8-bit timer use.

Table 3.18 API Functions: [8-bit timer]

API Function Name Function

R_TMR_Create Performs initialization necessary to control the 8-bit timer pulse unit.

R_TMR_Create_UserInit Performs user-defined initialization relating to the 8-bit timer pulse unit.

r_tmr_cmimn_interrupt Performs processing in response to the compare match interrupt.

r_tmr_ovin_interrupt Performs processing in response to the overflow interrupt.

R_TMRn_Start Starts counting by an 8-bit timer.

R_TMRn_Stop Ends counting by an 8-bit timer.

Page 173: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 173 of 375Oct 01, 2016

Performs initialization necessary to control the 8-bit timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_Create

void R_TMR_Create ( void );

Page 174: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 174 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the 8-bit timer.

Remark This API function is called as the R_TMR_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_Create_UserInit

void R_TMR_Create_UserInit ( void );

Page 175: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 175 of 375Oct 01, 2016

Performs processing in response to the compare match interrupt.

[Syntax]

Remark m is the timer general register number, n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmr_cmimn_interrupt

static void r_tmr_cmimn_interrupt ( void );

Page 176: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 176 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the overflow interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmr_ovin_interrupt

static void r_tmr_ovin_interrupt ( void );

Page 177: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 177 of 375Oct 01, 2016

Starts counting by an 8-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRn_Start

void R_TMRn_Start ( void );

Page 178: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 178 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Ends counting by an 8-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRn_Stop

void R_TMRn_Stop ( void );

Page 179: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 179 of 375Oct 01, 2016

3.2.19 Programmable pulse generator (PPG)

Below is a list of API functions output by the Code Generator for programmable pulse generator use.

Table 3.19 API Functions: [Programmable Pulse Generator ]

API Function Name Function

R_PPG_Create Performs initialization necessary to control the programmable pulse gen-erator .

R_PPG_Create_UserInit Performs user-defined initialization relating to the programmable pulse generator .

Page 180: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 180 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the programmable pulse generator .

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PPG_Create

void R_PPG_Create ( void );

Page 181: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 181 of 375Oct 01, 2016

Performs user-defined initialization relating to the programmable pulse generator .

Remark This API function is called as the R_PPG_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PPG_Create_UserInit

void R_PPG_Create_UserInit ( void );

Page 182: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 182 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.20 Compare match timer (CMT)

Below is a list of API functions output by the Code Generator for compare match timer use.

Table 3.20 API Functions: [Compare Match Timer]

API Function Name Function

R_CMTn_Create Performs initialization necessary to control the compare match timer.

R_CMTn_Create_UserInit Performs user-defined initialization relating to the compare match timer.

r_cmt_cmin_interrupt Performs processing in response to the compare match interrupt (CMIn).

R_CMTn_Start Starts counting by a 16-bit timer.

R_CMTn_Stop Ends counting by a 16-bit timer.

Page 183: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 183 of 375Oct 01, 2016

Performs initialization necessary to control the compare match timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTn_Create

void R_CMTn_Create ( void );

Page 184: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 184 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the compare match timer.

Remark This API function is called as the R_CMTn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTn_Create_UserInit

void R_CMTn_Create_UserInit ( void );

Page 185: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 185 of 375Oct 01, 2016

Performs processing in response to the compare match interrupt (CMIn).

Remark This API function is called to run interrupt processing for the compare match interrupt (CMIn), which is generated because the current counter value (value of the compare match timer counter, CMCR) matched the defined counter value (value of the compare match timer constant register, CMCOR).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmt_cmin_interrupt

static void r_cmt_cmin_interrupt ( void );

Page 186: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 186 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTn_Start

void R_CMTn_Start ( void );

Page 187: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 187 of 375Oct 01, 2016

Ends counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTn_Stop

void R_CMTn_Stop ( void );

Page 188: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 188 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.21 Compare match timer W (CMTW)

Below is a list of API functions output by the Code Generator for compare match timer W use.

Table 3.21 API Functions: [Compare Match Timer W]

API Function Name Function

R_CMTWn_Create Performs initialization necessary to control the compare match timer W.

R_CMTWn_Create_UserInit Performs user-defined initialization relating to the compare match timer W.

r_cmtw_cmwin_interrupt Performs processing in response to the compare match interrupt.

r_cmtw_icmin_interrupt Performs processing in response to the input capture interrupt.

r_cmtw_ocmin_interrupt Performs processing in response to the output compare interrupt.

R_CMTWn_Start Starts counting by a 16-bit timer.

R_CMTWn_Stop Ends counting by a 16-bit timer.

Page 189: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 189 of 375Oct 01, 2016

Performs initialization necessary to control the compare match timer W.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTWn_Create

void R_CMTPn_Create ( void );

Page 190: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 190 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the compare match timer W.

Remark This API function is called as the R_CMTWn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTWn_Create_UserInit

void R_CMTWn_Create_UserInit ( void );

Page 191: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 191 of 375Oct 01, 2016

Performs processing in response to the compare match interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmtw_cmwin_interrupt

static void r_cmtw_cmwin_interrupt ( void );

Page 192: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 192 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the input capture interrupt.

[Syntax]

Remark m is the timer general register number, n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmtw_icmin_interrupt

static void r_cmtw_icmin_interrupt ( void );

Page 193: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 193 of 375Oct 01, 2016

Performs processing in response to the output compare interrupt.

[Syntax]

Remark m is the timer general register number, n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmtw_ocmin_interrupt

static void r_cmtw_ocmin_interrupt ( void );

Page 194: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 194 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTWn_Start

void R_CMTWn_Start ( void );

Page 195: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 195 of 375Oct 01, 2016

Ends counting by a 16-bit timer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMTWn_Stop

void R_CMTWn_Stop ( void );

Page 196: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 196 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.22 Realtime clock (RTC)

Below is a list of API functions output by the Code Generator for realtime clock use.

Table 3.22 API Functions: [Realtime Clock]

API Function Name Function

R_RTC_Create Performs initialization necessary to control the realtime clock.

R_RTC_Create_UserInit Performs user-defined initialization relating to the realtime clock.

r_rtc_alm_interrupt Performs processing in response to the alarm interrupt (ALM).

r_rtc_prd_interrupt Performs processing in response to the periodic interrupt (PRD).

r_rtc_cup_interrupt Performs processing in response to the carry interrupt (CUP).

R_RTC_Set_CalendarAlarm Sets the condition for the alarm interrupt (ALM) and allows detection of ALM (calendar count mode).

R_RTC_Set_BinaryAlarm Sets the condition for the alarm interrupt (ALM) and allows detection of ALM (binary count mode).

R_RTC_Set_ConstPeriodInterruptOn

Sets the period of the periodic interrupt (PRD) and allows detection of PRD.

R_RTC_Set_ConstPeriodInterruptOff

Prohibits detection of the periodic interrupt (PRD).

R_RTC_Set_CarryInterruptOn Allows detection of the carry interrupt (CUP).

R_RTC_Set_CarryInterruptOff Prohibits detection of the carry interrupt (CUP).

R_RTC_Set_RTCOUTOn Set the RTCOUT output period and starts RTCOUT output.

R_RTC_Set_RTCOUTOff Ends the RTCOUT output.

R_RTC_Start Starts counting.

R_RTC_Stop Ends counting.

R_RTC_Restart Initializes the counter then starts counting.

R_RTC_Set_CalendarCounterValue

Sets the values of the calendar and time counters.

R_RTC_Get_CalendarCounterValue

Gets the values of the calendar and time counters.

R_RTC_Set_BinaryCounterValue Sets the value of the binary counter.

R_RTC_Get_BinaryCounterValue Gets the value of the binary counter.

R_RTC_Get_CalendarTimeCaptureValuen

Gets the captured calendar time value.

R_RTC_Get_BinaryTimeCaptureValuen

Gets the captured binary time value.

Page 197: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 197 of 375Oct 01, 2016

Performs initialization necessary to control the realtime clock.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Create

void R_RTC_Create ( void );

Page 198: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 198 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the realtime clock.

Remark This API function is called as the R_RTC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Create_UserInit

void R_RTC_Create_UserInit ( void );

Page 199: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 199 of 375Oct 01, 2016

Performs processing in response to the alarm interrupt (ALM).

Remark This API function is called to run interrupt processing for the alarm interrupt (ALM), which is generated when the condition specified by R_RTC_Set_CalendarAlarm is satisfied.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_alm_interrupt

static void r_rtc_alm_interrupt ( void );

Page 200: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 200 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the periodic interrupt (PRD).

Remark This API function is called to run interrupt processing for the periodic interrupt (PRD), which is generated when the period specified by R_RTC_Set_ConstPeriodInterruptOn elapses.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_prd_interrupt

static void r_rtc_prd_interrupt ( void );

Page 201: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 201 of 375Oct 01, 2016

Performs processing in response to the carry interrupt (CUP).

Remark This API function is called to run interrupt processing for the carry interrupt (CUP), which is generated on carries from the seconds counter (RSECCNT) or binary counter 0 (BCNT0) or when the 64-Hz counter (R64CNT) is read at the same time as a carry from the 64-Hz counter (R64CNT).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_cup_interrupt

static void r_rtc_cup_interrupt ( void );

Page 202: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 202 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the condition for the alarm interrupt (ALM) and allows detection of ALM (calendar count mode).

[Syntax]

[Argument(s)]

Remarks 1. The configuration of the comparison flag structure rtc_calendar_alarm_enable_t is shown below.

Remarks 2. The configuration of the calendar and time values rtc_calendar_alarm_value_t is shown below.

[Return value]

None.

R_RTC_Set_CalendarAlarm

#include "r_cg_rtc.h"void R_RTC_Set_CalendarAlarm ( rtc_calendar_alarm_enable_t alarm_enable, rtc_calendar_alarm_value_t alarm_val );

I/O Argument Description

I rtc_calendar_alarm_enable_t alarm_enable;

Comparison flags (year, month, date, day-of-the-week, hour, min-ute, and second).

0x0: Comparison proceeds0x80: Comparison does not proceed

I rtc_calendar_alarm_value_t alarm_val;

Calendar and time values (year, month, date, day-of-week, time, minute, and second)

typedef struct { uint8_t sec_enb; /* Second */ uint8_t min_enb; /* Minute */ uint8_t hr_enb; /* Time */ uint8_t day_enb; /* Date */ uint8_t wk_enb; /* Day-of-week */ uint8_t mon_enb; /* Month */ uint8_t yr_enb; /* Year */} rtc_calendar_alarm_enable_t;

typedef struct { uint8_t rsecar; /* second */ uint8_t rminar; /* Minute */ uint8_t rhrar; /* Time */ uint8_t rdayar; /* Date */ uint8_t rwkar; /* Day-of-week (0: Sunday, 6: Saturday) */ uint8_t rmonar; /* Month */ uint16_t ryrar; /* Year */} rtc_calendar_alarm_value_t;

Page 203: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 203 of 375Oct 01, 2016

Sets the condition for the alarm interrupt (ALM) and allows detection of ALM (binary count mode).

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Set_BinaryAlarm

#include "r_cg_macrodriver.h"void R_RTC_Set_BinaryAlarm ( uint32_t alarm_enable, uint32_t alarm_val );

I/O Argument Description

I uint32_t alarm_enable; Comparison flag0x0: Comparison does not proceed0x1: Comparison proceeds

I uint32_t alarm_val; The value of the binary counter

Page 204: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 204 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the period of the periodic interrupt (PRD) and allows detection of the PRD.

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Set_ConstPeriodInterruptOn

#include "r_cg_rtc.h"void R_RTC_Set_ConstPeriodInterruptOn ( rtc_int_period_t period );

I/O Argument Description

I rtc_int_period_t period; Period of the periodic interrupt (PRD).PES_2_SEC: 2 secondsPES_1_SEC: 1 secondPES_1_2_SEC: 1/2 secondPES_1_4_SEC: 1/4 secondPES_1_8_SEC: 1/8 secondPES_1_16_SEC: 1/16 secondPES_1_32_SEC: 1/32 secondPES_1_64_SEC: 1/64 secondPES_1_128_SEC: 1/128 secondPES_1_256_SEC: 1/256 second

Page 205: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 205 of 375Oct 01, 2016

Prohibits detection of the periodic interrupt (PRD).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_ConstPeriodInterruptOff

void R_RTC_Set_ConstPeriodInterruptOff ( void );

Page 206: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 206 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Allows detection of the carry interrupt (CUP).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_CarryInterruptOn

void R_RTC_Set_CarryInterruptOn ( void );

Page 207: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 207 of 375Oct 01, 2016

Prohibits detection of the carry interrupt (CUP).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_CarryInterruptOff

void R_RTC_Set_CarryInterruptOff ( void );

Page 208: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 208 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the RTCOUT output period and starts RTCOUT output.

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Set_RTCOUTOn

#include "r_cg_rtc.h"void R_RTC_Set_RTCOUTOn ( rtc_rtcout_period_t rtcout_freq );

I/O Argument Description

I rtc_rtcout_period_t rtcout_freq;

RTCOUT output periodRTCOUT_1HZ: 1HzRTCOUT_64HZ: 64Hz

Page 209: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 209 of 375Oct 01, 2016

Ends RTCOUT output.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_RTCOUTOff

void R_RTC_Set_RTCOUTOff ( void );

Page 210: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 210 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Start

void R_RTC_Start ( void );

Page 211: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 211 of 375Oct 01, 2016

Ends counting.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Stop

void R_RTC_Stop ( void );

Page 212: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 212 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Initializes the counter then starts counting.

Remarks 1. When the realtime clock is operating in the calendar counting mode, this API function initializes the coun-ters to the values specified by the argument counter_write_val.

Remarks 2. When the realtime clock is operating in the binary counting mode, this API function ignores the value specified by the argument counter_write_val and clears the counter to zero.

[Syntax]

[Argument(s)]

Remark The configuration of the initial value rtc_calendarcounter_value_t is shown below.

[Return value]

None.

R_RTC_Restart

#include "r_cg_rtc.h"void R_RTC_Restart ( rtc_calendarcounter_value_t counter_write_val );

I/O Argument Description

I rtc_calendarcounter_value_t counter_write_val;

Initial value (year, month, date, day-of-week, time, minute, and second)

typedef struct { uint8_t rseccnt; /* second */ uint8_t rmincnt; /* Minute */ uint8_t rhrcnt; /* Time */ uint8_t rdaycnt; /* Date */ uint8_t rwkcnt; /* Day-of-week (0: Sunday, 6: Saturday) */ uint8_t rmoncnt; /* Month */ uint16_t ryrcnt; /* Year */} rtc_calendarcounter_value_t;

Page 213: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 213 of 375Oct 01, 2016

Sets the calendar and time values.

[Syntax]

[Argument(s)]

Remark The configuration of the calendar and time values rtc_calendarcounter_value_t is shown below.

[Return value]

None.

R_RTC_Set_CalendarCounterValue

#include "r_cg_rtc.h"void R_RTC_Set_CalendarCounterValue ( rtc_calendarcounter_value_t counter_write_val );

I/O Argument Description

I rtc_calendarcounter_value_t counter_write_val;

Calendar and time values (year, month, date, day-of-week, time, minute, and second)

typedef struct { uint8_t rseccnt; /* second */ uint8_t rmincnt; /* Minute */ uint8_t rhrcnt; /* Time */ uint8_t rdaycnt; /* Date */ uint8_t rwkcnt; /* Day-of-week (0: Sunday, 6: Saturday) */ uint8_t rmoncnt; /* Month */ uint16_t ryrcnt; /* Year */} rtc_calendarcounter_value_t;

Page 214: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 214 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Gets the calendar and time values.

[Syntax]

[Argument(s)]

Remark The configuration of the calendar and time values rtc_calendarcounter_value_t is shown below.

[Return value]

None.

R_RTC_Get_CalendarCounterValue

#include "r_cg_rtc.h"void R_RTC_Get_CalendarCounterValue ( rtc_calendarcounter_value_t * const counter_read_val );

I/O Argument Description

O rtc_calendarcounter_value_t * const counter_read_val;

Pointer to the area where the obtained calendar and time values (year, month, date, day-of-week, time, minute, and second) are to be stored

typedef struct { uint8_t rseccnt; /* second */ uint8_t rmincnt; /* Minute */ uint8_t rhrcnt; /* Time */ uint8_t rdaycnt; /* Date */ uint8_t rwkcnt; /* Day-of-week (0: Sunday, 6: Saturday) */ uint8_t rmoncnt; /* Month */ uint16_t ryrcnt; /* Year */} rtc_calendarcounter_value_t;

Page 215: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 215 of 375Oct 01, 2016

Sets the value of the binary counter.

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Set_BinaryCounterValue

#include "r_cg_macrodriver.h"void R_RTC_Set_BinaryCounterValue ( uint32_t counter_write_val );

I/O Argument Description

I uint32_t counter_write_val; The value of the binary counter

Page 216: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 216 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Gets the value of the binary count.

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Get_BinaryCounterValue

#include "r_cg_macrodriver.h"void R_RTC_Get_BinaryCounterValue ( uint32_t * const counter_read_val );

I/O Argument Description

O uint32_t * const counter_read_val;

Pointer to an area where the obtained value of the binary counter is to be stored

Page 217: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 217 of 375Oct 01, 2016

Gets the captured calendar time value.

[Syntax]

Remark n is the channel number.

[Argument(s)]

Remark The configuration of the calendar and time values rtc_calendarcounter_value_t is shown below.

[Return value]

None.

R_RTC_Get_CalendarTimeCaptureValuen

void R_RTC_Get_CalendarTimeCaptureValuen ( rtc_calendarcounter_value_t * const counter_read_val );

I/O Argument Description

O rtc_calendarcounter_value_t* const counter_read_val;

Pointer to the area where the obtained calendar and time values.

typedef struct { uint8_t rseccnt; /* Second */ uint8_t rmincnt; /* Minute */ uint8_t rhrcnt; /* Time */ uint8_t rdaycnt; /* Date */ uint8_t rwkcnt; /* Day-of-week (0: Sunday, 6: Saturday) */ uint8_t rmoncnt; /* Month */ uint16_t ryrcnt; /* Year */} rtc_calendarcounter_value_t;

Page 218: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 218 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Gets the value of the binary count.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_RTC_Get_BinaryTimeCaptureValuen

void R_RTC_Get_BinaryTimeCaptureValuen ( uint32_t * const counter_read_val );

I/O Argument Description

O uint32_t* const counter_read_val;

The value of the binary counter.

Page 219: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 219 of 375Oct 01, 2016

3.2.23 Watchdog timer (WDT)

Below is a list of API functions output by the Code Generator for watchdog timer use.

Table 3.23 API Functions: [Watchdog Timer]

API Function Name Function

R_WDT_Create Performs initialization necessary to control the watchdog timer.

R_WDT_Create_UserInit Performs user-defined initialization relating to the watchdog timer.

r_wdt_nmi_interrupt Performs processing in response to the non-maskable interrupt.

r_wdt_wuni_interrupt Performs processing in response to the non-maskable/maskable inter-rupt.

R_WDT_Restart Clears the watchdog timer counter and resumes counting.

Page 220: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 220 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the watchdog timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WDT_Create

void R_WDT_Create ( void );

Page 221: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 221 of 375Oct 01, 2016

Performs user-defined initialization relating to the watchdog timer.

Remark This API function is called as the R_WDT_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WDT_Create_UserInit

void R_WDT_Create_UserInit ( void );

Page 222: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 222 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the non-maskable interrupt.

Remark This API function is called to run interrupt processing for the non-maskable interrupt , which is generated when the down-counter underflows or refreshing proceeds.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_wdt_nmi_interrupt

static void r_wdt_nmi_interrupt ( void );

Page 223: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 223 of 375Oct 01, 2016

Performs processing in response to the non-maskable/maskable interrupt.

Remark This API function is called to run interrupt processing for the non-maskable / maskable interrupt , which is generated when the down-counter underflows or refreshing proceeds.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_wdt_wuni_interrupt

static void r_wdt_wuni_interrupt ( void );

Page 224: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 224 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clears the watchdog timer counter and resumes counting.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WDT_Restart

void R_WDT_Restart ( void );

Page 225: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 225 of 375Oct 01, 2016

3.2.24 Independent watchdog timer (IWDT)

Below is a list of API functions output by the Code Generator for independent watchdog timer use.

Table 3.24 API Functions: [Independent Watchdog Timer]

API Function Name Function

R_IWDT_Create Performs initialization necessary to control the independent watchdog timer.

R_IWDT_Create_UserInit Performs user-defined initialization relating to the independent watchdog timer.

r_iwdt_nmi_interrupt Performs processing in response to the non-maskable interrupt (WUNI).

r_iwdt_iwuni_interrupt Performs processing in response to the non-maskable/maskable interrupt.

R_IWDT_Restart Clears the independent watchdog timer counter and resumes counting.

Page 226: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 226 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the independent watchdog timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IWDT_Create

void R_IWDT_Create ( void );

Page 227: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 227 of 375Oct 01, 2016

Performs user-defined initialization relating to the independent watchdog timer.

Remark This API function is called as the R_IWDT_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IWDT_Create_UserInit

void R_IWDT_Create_UserInit ( void );

Page 228: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 228 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the non-maskable interrupt (WUNI).

Remark This API function is called to run interrupt processing for the non-maskable interrupt (WUNI), which is generated when the down-counter underflows or refreshing proceeds outside the period where it is per-mitted.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_iwdt_nmi_interrupt

static void r_iwdt_nmi_interrupt ( void );

Page 229: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 229 of 375Oct 01, 2016

Performs processing in response to the non-maskable/maskable interrupt.

Remark This API function is called to run interrupt processing for the non-maskable / maskable interrupt , which is generated when the down-counter underflows or refreshing proceeds.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_iwdt_iwuni_interrupt

static void r_iwdt_iwuni_interrupt ( void );

Page 230: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 230 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clears the independent watchdog timer counter and resumes counting.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IWDT_Restart

void R_IWDT_Restart ( void );

Page 231: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 231 of 375Oct 01, 2016

3.2.25 Serial communications interface (SCI)

Below is a list of API functions output by the Code Generator for serial communications interface use.

Table 3.25 API Functions: [Serial Communications Interface]

API Function Name Function

R_SCIn_Create Performs initialization necessary to control the serial communications interface.

R_SCIn_Create_UserInit Performs user-defined initialization related to the serial communications interface.

r_scin_transmitend_interrupt Performs processing in response to the transmit-end interrupts.

r_scin_transmit_interrupt Performs processing in response to the transmit-data-empty interrupts.

r_scin_receive_interrupt Performs processing in response to the receive-data-full interrupts.

r_scin_receiveerror_interrupt Performs processing in response to the receive error interrupts.

R_SCIn_Start Starts SCI communication.

R_SCIn_Stop Ends SCI communication.

R_SCIn_Serial_Send Starts SCI transmission (synchronous mode).

R_SCIn_Serial_Receive Starts SCI reception (synchronous mode).

R_SCIn_Serial_Multiprocessor_Send Starts SCI transmission (multi-processor communications function).

R_SCIn_Serial_Multiprocessor_Receive Starts SCI reception (multi-processor communications function).

R_SCIn_Serial_Send_Receive Starts SCI transmission/reception (clock synchronous mode).

R_SCIn_SmartCard_Send Starts SCI transmission (smart card interface mode).

R_SCIn_SmartCard_Receive Starts SCI reception (smart card interface mode).

R_SCIn_IIC_Master_Send Starts SCI master transmission (simple I2C mode).

R_SCIn_IIC_Master_Receive Starts SCI master reception (simple I2C mode).

R_SCIn_SPI_Master_Send Starts SCI master transmission (simple SPI mode).

R_SCIn_SPI_Master_Send_Receive Starts SCI master transmission/reception (simple SPI mode).

R_SCIn_SPI_Slave_Send Starts SCI slave transmission (simple SPI mode).

R_SCIn_SPI_Slave_Send_Receive Starts SCI slave transmission/reception (simple SPI mode).

R_SCIn_IIC_StartCondition Sends the start bit.

R_SCIn_IIC_StopCondition Sends the stop bit.

r_scin_callback_transmitend Performs processing in response to the transmit-end interrupts.

r_scin_callback_receiveend Performs processing in response to the receive-data-full interrupts.

r_scin_callback_receiveerror Performs processing in response to the receive error interrupts.

Page 232: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 232 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the serial communication interface.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_Create

void R_SCIn_Create ( void );

Page 233: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 233 of 375Oct 01, 2016

Performs user-defined initialization related to the serial communications interface.

Remark This API function is called as the R_SCIn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_Create_UserInit

void R_SCIn_Create_UserInit ( void );

Page 234: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 234 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transmit-end interrupts.

Remark This API function is called to run interrupt processing for the transmit-end interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_transmitend_interrupt

static void r_scin_transmitend_interrupt ( void );

Page 235: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 235 of 375Oct 01, 2016

Performs processing in response to the transmit-data-empty interrupts.

Remark This API function is called to run interrupt processing for the transmit-data-empty interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_transmit_interrupt

static void r_scin_transmit_interrupt ( void );

Page 236: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 236 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the receive-data-full interrupts.

Remark This function is called to run interrupt processing for the receive-data-full interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_receive_interrupt

static void r_scin_receive_interrupt ( void );

Page 237: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 237 of 375Oct 01, 2016

Performs processing in response to the receive error interrupts.

Remark This API function is called to run interrupt processing for the receive error interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_receiveerror_interrupt

static void r_scin_receiveerror_interrupt ( void );

Page 238: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 238 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_Start

void R_SCIn_Start ( void );

Page 239: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 239 of 375Oct 01, 2016

Ends SCI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_Stop

void R_SCIn_Stop ( void );

Page 240: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 240 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI transmission (asynchronous mode).

Remarks 1. This API function repeats the byte-level SCI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_Serial_Send

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_Serial_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 241: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 241 of 375Oct 01, 2016

Starts SCI reception (asynchronous mode).

Remarks 1. This API function repeats SCI reception in byte units the number of times specified by the argument rx_num and then stores the received data in the buffer at the location specified by the argument rx_buf.

Remarks 2. When performing a SCI reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_Serial_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_Serial_Receive ( uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument rx_num specification

Page 242: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 242 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI transmission (multi-processor communications function).

Remarks 1. This API function repeats the byte-level SCI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_Serial_Multiprocessor_Send

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_Serial_Multiprocessor_Send ( uint8_t * id_buf, uint16_t id_num, uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * id_buf; Pointer to a buffer storing the transmission ID

I uint16_t id_num; Total amount of ID to send

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 243: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 243 of 375Oct 01, 2016

Starts SCI reception (multi-processor communications function).

Remarks 1. This API function repeats SCI reception in byte units the number of times specified by the argument rx_num and then stores the received data in the buffer at the location specified by the argument rx_buf.

Remarks 2. When performing a SCI reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_Serial_Multiprocessor_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_Serial_Multiprocessor_Receive ( uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument rx_num specification

Page 244: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 244 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI transmission/reception (clock synchronous mode).

Remarks 1. This API function repeats SCI transmission in byte units the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function repeats SCI reception processing in byte units the number of times specified by the argument rx_num and then stores the received data in the buffer at the location specified by the argu-ment rx_buf.

Remarks 3. When performing a SCI transmission/reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_Serial_Send_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_Serial_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 245: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 245 of 375Oct 01, 2016

Starts SCI transmission (smart card interface mode).

Remarks 1. This API function repeats the byte-level SCI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SmartCard_Send

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SmartCard_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 246: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 246 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI reception (smart card interface mode).

Remarks 1. This API function repeats SCI reception in byte units the number of times specified by the argument rx_num and then stores the received data in the buffer at the location specified by the argument rx_buf.

Remarks 2. When performing a SCI reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SmartCard_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SmartCard_Receive ( uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument rx_num specification

Page 247: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 247 of 375Oct 01, 2016

Starts SCI master transmission (simple I2C mode).

Remarks 1. This API function handles SCI master transmission to the slave device at the address specified by the argument adr and the R/W#bit. SCI master transmission in byte units is repeated the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function internally calls R_SCIn_IIC_StartCondition to handle processing to start SCI master transmission.

Remarks 3. When performing a SCI master transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_SCIn_IIC_Master_Send

#include "r_cg_macrodriver.h"void R_SCIn_IIC_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t adr; Slave address

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Page 248: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 248 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI master reception (simple I2C mode).

Remarks 1. This API function handles SCI master transmission to the slave device at the address specified by the argument adr. SCI master reception in byte units is repeated the number of times specified by the argu-ment rx_num and the received data are stored in the buffer at the location specified by the argument rx_buf.

Remarks 2. This API function internally calls R_SCIn_IIC_StartCondition to handle processing to start SCI master reception.

Remarks 3. When performing a SCI master reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_SCIn_IIC_Master_Receive

#include "r_cg_macrodriver.h"void R_SCIn_IIC_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t adr; Slave address

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Page 249: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 249 of 375Oct 01, 2016

Starts SCI master transmission (simple SPI mode).

Remarks 1. This API function repeats the byte-level SCI master transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI master transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SPI_Master_Send

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SPI_Master_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 250: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 250 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI master transmission/reception (simple SPI mode).

Remarks 1. This API function repeats SCI master transmission in byte units the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function repeats SCI master reception in byte units the number of times specified by the argu-ment rx_num and the received data are stored in the buffer at the location specified by the argument rx_buf.

Remarks 3. When performing a SCI master transmission/reception, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SPI_Master_Send_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SPI_Master_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 251: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 251 of 375Oct 01, 2016

Starts SCI slave transmission (simple SPI mode).

Remarks 1. This API function repeats the byte-level SCI slave transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI slave transmission, R_SCIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SPI_Slave_Send

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SPI_Slave_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 252: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 252 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts SCI slave transmission/reception (simple SPI mode).

Remarks 1. This API function repeats SCI slave transmission in byte units the number of times specified by the argu-ment tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function repeats SCI slave reception in byte units the number of times specified by the argument rx_num and the received data are stored in the buffer at the location specified by the argument rx_buf.

Remarks 3. When performing a SCI slave transmission/reception, R_SCIn_Start must be called before this API func-tion is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIn_SPI_Slave_Send_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_SCIn_SPI_Slave_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 253: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 253 of 375Oct 01, 2016

Sends the start bit.

Remark This API function is called as the internal function of R_SCIn_IIC_Master_Send and R_SCIn_IIC_Master_Receive.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_IIC_StartCondition

void R_SCIn_IIC_StartCondition ( void );

Page 254: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 254 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sends the stop bit.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIn_IIC_StopCondition

void R_SCIn_IIC_StopCondition ( void );

Page 255: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 255 of 375Oct 01, 2016

Performs processing in response to the transmit-end interrupts.

Remark This API function is called as the r_scin_transmitend_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_callback_transmitend

static void r_scin_callback_transmitend ( void );

Page 256: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 256 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the receive-data-full interrupts.

Remark This API function is called as the r_scin_receive_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_callback_receiveend

static void r_scin_callback_receiveend ( void );

Page 257: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 257 of 375Oct 01, 2016

Performs processing in response to the receive error interrupts.

Remark This API function is called as the r_scin_receiveerror_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scin_callback_receiveerror

static void r_scin_callback_receiveerror ( void );

Page 258: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 258 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.26 FIFO embedded serial communications interface (SCIFA)

Below is a list of API functions output by the Code Generator for FIFO embedded serial communications interface use.

Table 3.26 API Functions: [FIFO Embedded Serial Communications Interface]

API Function Name Function

R_SCIFAn_Create Performs initialization necessary to control the FIFO embedded serial communications interface.

R_SCIFAn_Create_UserInit Performs user-defined initialization relating to the FIFO embedded serial communications interface.

r_scifan_teif_interrupt Performs processing in response to the transmit-end interrupts.

r_scifan_txif_interrupt Performs processing in response to the transmit FIFO data empty interrupts.

r_scifan_rxif_interrupt Performs processing in response to the receive FIFO data full interrupts.

r_scifan_erif_interrupt Performs processing in response to the framing error or parity error interrupts.

r_scifan_brif_interrupt Performs processing in response to the break or overrun interrupts.

r_scifan_drif_interrupt Performs processing in response to the receive data ready interrupts.

r_scifan_callback_transmitend Performs processing in response to the transmit-end interrupts.

r_scifan_callback_receiveend Performs processing in response to the receive FIFO data full interrupts.

r_scifan_callback_error Performs processing in response to the error interrupts.

R_SCIFAn_Start Starts FIFO embedded SCI communication.

R_SCIFAn_Stop Ends FIFO embedded SCI communication.

R_SCIFAn_Serial_Send EStarts FIFO embedded SCI transmission (asynchronous mode).

R_SCIFAn_Serial_Receive Starts FIFO embedded SCI reception (asynchronous mode).

R_SCIFAn_Serial_Send_Receive Starts FIFO embedded SCI transmission/reception (clock synchronous mode).

Page 259: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 259 of 375Oct 01, 2016

Performs initialization necessary to control the FIFO embedded serial communications interface.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIFAn_Create

void R_SCIFAn_Create ( void );

Page 260: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 260 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization related to the FIFO embedded serial communications interface.

Remark This API function is called as the R_SCIFAn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIFAn_Create_UserInit

void R_SCIFAn_Create_UserInit ( void );

Page 261: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 261 of 375Oct 01, 2016

Performs processing in response to the transmit-end interrupts.

Remark This API function is called to run the interrupt processing for the transmit-end interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_teif_interrupt

static void r_scifan_teif_interrupt ( void );

Page 262: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 262 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transmit FIFO data empty interrupts.

Remark This API function is called to run the interrupt processing for the transmit FIFO data empty interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_txif_interrupt

static void r_scifan_txif_interrupt ( void );

Page 263: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 263 of 375Oct 01, 2016

Performs processing in response to the receive FIFO data full interrupts.

Remark This API function is called to run the interrupt processing for the receive FIFO data full interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_rxif_interrupt

static void r_scifan_rxif_interrupt ( void );

Page 264: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 264 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the framing error or parity error interrupts.

Remark This API function is called to run the interrupt processing for the framing error or parity error interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_erif_interrupt

static void r_scifan_erif_interrupt ( void );

Page 265: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 265 of 375Oct 01, 2016

Performs processing in response to the break or overrun interrupts.

Remark This API function is called to run the interrupt processing for the break or overrun interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_brif_interrupt

static void r_scifan_brif_interrupt ( void );

Page 266: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 266 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the receive data ready interrupts.

Remark This API function is called to run the interrupt processing for the receive data ready interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_drif_interrupt

static void r_scifan_drif_interrupt ( void );

Page 267: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 267 of 375Oct 01, 2016

Performs processing in response to the transmit-end interrupts.

Remark This API function is called as the r_scifan_teif_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_callback_transmitend

static void r_scifan_callback_transmitend ( void );

Page 268: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 268 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transmit-end interrupts.

Remark This API function is called as the r_scifan_txif_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_callback_receiveend

static void r_scifan_callback_receiveend ( void );

Page 269: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 269 of 375Oct 01, 2016

Performs processing in response to the error interrupts.

Remark This API function is called as the r_scifan_erif_interrupt or r_scifan_brif_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_scifan_callback_error

static void r_scifan_callback_error ( void );

Page 270: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 270 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts FIFO embedded SCI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIFAn_Start

void R_SCIFAn_Start ( void );

Page 271: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 271 of 375Oct 01, 2016

Ends FIFO embedded SCI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_SCIFAn_Stop

void R_SCIFAn_Stop ( void );

Page 272: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 272 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts FIFO embedded SCI transmission (asynchronous mode).

Remarks 1. This API function repeats the byte-level SCI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a SCI transmission, R_SCIFAn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIFAn_Serial_Send

MD_STATUS R_SCIFAn_Serial_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument

Page 273: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 273 of 375Oct 01, 2016

Starts FIFO embedded SCI reception (asynchronous mode).

Remarks 1. This API function repeats the byte-level SCI reception from the buffer specified in argument rx_buf the number of times specified in argument rx_num.

Remarks 2. When performing a SCI reception, R_SCIFAn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIFAn_Serial_Receive

MD_STATUS R_SCIFAn_Serial_Receive ( uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument

Page 274: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 274 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts FIFO embedded SCI transmission/reception (clock synchronous mode).

Remarks 1. This API function repeats the byte-level SCI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. This API function repeats the byte-level SCI reception from the buffer specified in argument rx_buf the number of times specified in argument rx_num.

Remarks 3. When performing a SCI transmission/reception, R_SCIFAn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_SCIFAn_Serial_Send_Receive

MD_STATUS R_SCIn_Serial_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument

Page 275: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 275 of 375Oct 01, 2016

3.2.27 I2C bus interface (RIIC)

Below is a list of API functions output by the Code Generator for I2C bus interface use.

Table 3.27 API Functions: [I2C Bus Interface]

API Function Name Function

R_RIICn_Create Performs initialization necessary to control the I2C bus interface.

R_RIICn_Create_UserInit Performs user-defined initialization relating to the I2C bus interface.

r_riicn_error_interrupt Performs processing in response to the transfer error/event generation interrupts (EEI).

r_riicn_receive_interrupt Performs processing in response to the receive data full interrupts (RXI).

r_riicn_transmit_interrupt Performs processing in response to the transmit data empty interrupts (TXI).

r_riicn_transmitend_interrupt Performs processing in response to the transmit end interrupts (TEI).

R_RIICn_Start Starts RIIC communication.

R_RIICn_Stop Ends RIIC communication.

R_RIICn_Master_Send Starts RIIC master transmission.

R_RIICn_Master_Receive Starts RIIC master reception.

R_RIICn_Slave_Send Starts RIIC slave transmission.

R_RIICn_Slave_Receive Starts RIIC slave reception.

R_RIICn_StartCondition Issues the start condition and causes a transfer error and an event gen-eration interrupt (EEI).

R_RIICn_StopCondition Issues the stop condition and causes a transfer error and an event gen-eration interrupt (EEI).

r_riicn_callback_receiveerror Of the internal processing for transfer error/event generation interrupts (EEI), this function handles processing specialized in the arbitration-lost detection, NACK detection, and timeout detection.

r_riicn_callback_transmitend Of the internal processing for transfer error/event generation interrupts (EEI), this function handles processing specialized in the start condition detection in response to calling of R_RIICn_Master_Send.

r_riicn_callback_receiveend Of the interrupt processing for transfer error/event generation interrupts (EEI), processing specialized in the start condition detection in response to calling of R_RIICn_Master_Receive is performed.

Page 276: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 276 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the I2C bus interface.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_Create

void R_RIICn_Create ( void );

Page 277: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 277 of 375Oct 01, 2016

Performs user-defined initialization relating to the I2C bus interface.

Remark This API function is called as the R_RIICn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_Create_UserInit

void R_RIICn_Create_UserInit ( void );

Page 278: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 278 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transfer error/event generation interrupts (EEI).

Remark This API function is called to run interrupt processing for the transfer error/event generation interrupts (EEI), which are generated when the I2C bus interface detects the transfer error/event generation (arbi-tration-lost, NACK, timeout, start condition, and stop condition).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_error_interrupt

static void r_riicn_error_interrupt ( void );

Page 279: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 279 of 375Oct 01, 2016

Performs processing in response to the receive data full interrupts (RXI).

Remark This API function is called to run interrupt processing for the receive data full interrupts (RXI).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_receive_interrupt

static void r_riicn_receive_interrupt ( void );

Page 280: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 280 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the transmit data empty interrupts (TXI).

Remark This function is called to run interrupt processing for the transmit data empty interrupts (TXI).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_transmit_interrupt

static void r_riicn_transmit_interrupt ( void );

Page 281: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 281 of 375Oct 01, 2016

Performs processing in response to the transmit end interrupts (TEI).

Remark This API function is called to run interrupt processing for the transmit end interrupts (TEI).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_transmitend_interrupt

static void r_riicn_transmitend_interrupt ( void );

Page 282: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 282 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts RIIC communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_Start

void R_RIICn_Start ( void );

Page 283: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 283 of 375Oct 01, 2016

Ends RIIC communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_Stop

void R_RIICn_Stop ( void );

Page 284: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 284 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts RIIC master transmission.

Remarks 1. This API function handles RIIC master transmission to the slave device at the address specified by the argument adr and the R/W#bit. RIIC master transmission in byte units is repeated the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function internally calls R_RIICn_StartCondition to handle processing to start RIIC master trans-mission.

Remarks 3. When performing a RIIC master transmission, R_RIICn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_RIICn_Master_Send

#include "r_cg_macrodriver.h"MD_STATUS R_RIICn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t adr; Slave address

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ERROR1 Bus busy

MD_ERROR2 Invalid argument adr specification

Page 285: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 285 of 375Oct 01, 2016

Starts RIIC master reception.

Remarks 1. This API function handles RIIC master transmission to the slave device at the slave address specified by the argument adr. RIIC master reception in byte units is repeated the number of times specified by the argument rx_num and the received data are stored in the buffer at the location specified by the argument rx_buf.

Remarks 2. This API function internally calls R_RIICn_StartCondition to handle processing to start RIIC master reception.

Remarks 3. When performing a RIIC master reception, R_RIICn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_RIICn_Master_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_RIICn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t adr; Slave address

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ERROR1 Bus busy

MD_ERROR2 Invalid argument adr specification

Page 286: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 286 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts RIIC slave transmission.

Remarks 1. This API function repeats the byte-level RIIC slave transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a RIIC slave transmission, R_RIICn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_RIICn_Slave_Send

#include "r_cg_macrodriver.h"void R_RIICn_Slave_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Page 287: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 287 of 375Oct 01, 2016

Starts RIIC slave reception.

Remarks 1. This API function performs byte-level RIIC slave reception the number of times specified by the argument rx_num, and stores the data in the buffer specified by the argument rx_buf.

Remarks 2. When performing a RIIC slave reception, R_RIICn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_RIICn_Slave_Receive

#include "r_cg_macrodriver.h"void R_RIICn_Slave_Receive ( uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

I uint16_t rx_num; Total amount of data to receive

Page 288: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 288 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Issues the start condition and causes a transfer error and an event generation interrupt (EEI).

Remarks 1. This API function is called as the internal function of R_RIICn_Master_Send and R_RIICn_Master_Receive.

Remarks 2. r_riicn_error_interrupt is called in response to calling of this API function.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_StartCondition

void R_RIICn_StartCondition ( void );

Page 289: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 289 of 375Oct 01, 2016

Issues the stop condition and causes a transfer error and an event generation interrupt (EEI).

Remark r_riicn_error_interrupt is called in response to calling of this API function.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RIICn_StopCondition

void R_RIICn_StopCondition ( void );

Page 290: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 290 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Of the internal processing for transfer errors and event generation interrupts (EEI), this function handles processing specialized in the arbitration-lost detection, NACK detection, and timeout detection.

Remark This API function is called as the r_riicn_error_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_riicn_callback_receiveerror

#include "r_cg_macrodriver.h"static void r_riicn_callback_receiveerror ( MD_STATUS status );

I/O Argument Description

I MD_STATUS status; Source of the transfer errors and event generation interruptsMD_ERROR1: Arbitration-lost detectionMD_ERROR2: Timeout detectionMD_ERROR3: NACK detection

Page 291: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 291 of 375Oct 01, 2016

Of the internal processing for transfer errors and event generation interrupts (EEI), this function handles processing specialized in the start condition detection in response to calling of R_RIICn_Master_Send.

Remark This API function is called as the r_riicn_error_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_callback_transmitend

static void r_riicn_callback_transmitend ( void );

Page 292: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 292 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Of the internal processing for transfer errors and event generation interrupts (EEI), this function handles processing specialized in the start condition detection in response to calling of R_RIICn_Master_Receive.

Remark This API function is called as the r_riicn_error_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_riicn_callback_receiveend

static void r_riicn_callback_receiveend ( void );

Page 293: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 293 of 375Oct 01, 2016

3.2.28 Serial peripheral interface (RSPI)

Below is a list of API functions output by the Code Generator for serial peripheral interface use.

Table 3.28 API Functions: [Serial Peripheral Interface]

API Function Name Function

R_RSPIn_Create Performs initialization necessary to control the serial peripheral interface.

R_RSPIn_Create_UserInit Performs user-defined initialization relating to the serial peripheral interface.

r_rspin_receive_interrupt Performs processing in response to the receive buffer full interrupts.

r_rspin_transmit_interrupt Performs processing in response to the transmit buffer error interrupts.

r_rspin_error_interrupt Performs processing in response to the RSPI error interrupts.

r_rspin_idle_interrupt Performs processing in response to the RSPI idle interrupts.

R_RSPIn_Start Starts RSPI communication.

R_RSPIn_Stop Ends RSPI communication.

R_RSPIn_Send Starts RSPI transmission.

R_RSPIn_Send_Receive Starts RSPI transmission/reception.

r_rspin_callback_receiveend Performs processing in response to the receive buffer full interrupts.

r_rspin_callback_error Performs processing in response to the RSPI error interrupts.

r_rspin_callback_transmitend Performs processing in response to the RSPI idle interrupts.

Page 294: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 294 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the serial peripheral interface.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RSPIn_Create

void R_RSPIn_Create ( void );

Page 295: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 295 of 375Oct 01, 2016

Performs user-defined initialization relating to the serial peripheral interface.

Remark This API function is called as the R_RSPIn_Create callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RSPIn_Create_UserInit

void R_RSPIn_Create_UserInit ( void );

Page 296: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 296 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the receive buffer full interrupts.

Remark This API function is called to run interrupt processing for the receive buffer full interrupt.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_receive_interrupt

static void r_rspin_receive_interrupt ( void );

Page 297: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 297 of 375Oct 01, 2016

Performs processing in response to the transmit buffer empty interrupts.

Remark This API function is called to run interrupt processing for the transmit buffer empty interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_transmit_interrupt

static void r_rspin_transmit_interrupt ( void );

Page 298: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 298 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the RSPI error interrupts.

Remark This API function is called to run interrupt processing for the RSPI error interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_error_interrupt

static void r_rspin_error_interrupt ( void );

Page 299: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 299 of 375Oct 01, 2016

Performs processing in response to the RSPI idle interrupts.

Remark This API function is called to run interrupt processing for the RSPI idle interrupts.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_idle_interrupt

static void r_rspin_idle_interrupt ( void );

Page 300: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 300 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts RSPI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RSPIn_Start

void R_RSPIn_Start ( void );

Page 301: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 301 of 375Oct 01, 2016

Ends RSPI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_RSPIn_Stop

void R_RSPIn_Stop ( void );

Page 302: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 302 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts RSPI transmission.

Remarks 1. This API function repeats the byte-level RSPI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a RSPI transmission, R_RSPIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_RSPIn_Send

#include "r_cg_macrodriver.h"MD_STATUS R_RSPIn_Send ( uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 303: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 303 of 375Oct 01, 2016

Starts RSPI transmission/reception.

Remarks 1. This API function repeats RSPI transmission in byte units the number of times specified by the argument tx_num from the buffer at the location specified by the argument tx_buf.

Remarks 2. This API function repeats RSPI reception processing in byte units the number of times specified by the argument tx_num and then stores the received data in the buffer at the location specified by the argu-ment rx_buf.

Remarks 3. When performing a RSPI transmission/reception, R_RSPIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_RSPIn_Send_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_RSPIn_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const rx_buf );

I/O Argument Description

I uint8_t * const tx_buf; Pointer to a buffer storing the transmission data

I uint16_t tx_num; Total amount of data to send/receive

O uint8_t * const rx_buf; Pointer to a buffer to store the reception data

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument tx_num specification

Page 304: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 304 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the receive buffer full interrupts.

Remark This API function is called as the r_rspin_receive_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_callback_receiveend

static void r_rspin_callback_receiveend ( void );

Page 305: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 305 of 375Oct 01, 2016

Performs processing in response to the RSPI error interrupts.

Remark This API function is called as the r_rspin_error_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_rspin_callback_error

static void r_rspin_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Source of the RSPI error interrupt (x is undefined)xxxx00x1B: Overrun error detectionxxxx01x0B: Mode fault error detectionxxxx10x0B: Parity error detection

Page 306: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 306 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the RSPI idle interrupts.

Remark This API function is called as the r_rspin_idle_interrupt callback routine.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_rspin_callback_transmitend

static void r_rspin_callback_transmitend ( void );

Page 307: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 307 of 375Oct 01, 2016

3.2.29 CRC calculator (CRC)

Below is a list of API functions output by the Code Generator for CRC calculator use.

Table 3.29 API Functions: [CRC calculator]

API Function Name Function

R_CRC_SetCRC8 Initializes the CRC calculator for 8-bit CRC calculation (CRC generating polyno-mial: X8 + X2 + X + 1).

R_CRC_SetCRC16 Initializes the CRC calculator for 16-bit CRC calculation (CRC generating poly-nomial: X16 + X15 + X2 + 1).

R_CRC_SetCCITT Initializes the CRC calculator for 16-bit CRC calculation (CRC generating poly-nomial: X16 + X12 + X5 + 1).

R_CRC_SetCRC32 Initializes the CRC calculator for 32-bit CRC calculation (CRC generating poly-nomial: X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X4 + X2 + X + 1)

R_CRC_SetCRC32C Initializes the CRC calculator for 32-bit CRC calculation (CRC generating poly-nomial: X32 + X28 + X27 + X26 + X25 + X23 + X22 + X20 + X19 + X18 + X14 + X13 + X11 + X10 + X9 + X8 + X6 + 1)

R_CRC_Input_Data Sets the initial value of the data from which the CRC is to be calculated.

R_CRC_Get_Result Gets the result of operation.

Page 308: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 308 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Initializes the CRC calculator for 8-bit CRC calculation (CRC generating polynomial: X8 + X2 + X + 1).

[Syntax]

RX65N/RX651

Other devices

[Argument(s)]

[Return value]

None.

R_CRC_SetCRC8

void R_CRC_SetCRC8 ( void );

#include "r_cg_crc.h"void R_CRC_SetCRC8 ( crc_bitorder order );

I/O Argument Description

I crc_bitorder order; CRC calculation switching typeCRC_LSB: LSB-firstCRC_MSB: MSB-first

Page 309: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 309 of 375Oct 01, 2016

Initializes the CRC calculator for 16-bit CRC calculation (CRC generating polynomial: X16 + X15 + X2 + 1).

[Syntax]

RX65N/RX651

Other devices

[Argument(s)]

[Return value]

None.

R_CRC_SetCRC16

void R_CRC_SetCRC16 ( void );

#include "r_cg_crc.h"void R_CRC_SetCRC16 ( crc_bitorder order );

I/O Argument Description

I crc_bitorder order; CRC calculation switching typeCRC_LSB: LSB-firstCRC_MSB: MSB-first

Page 310: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 310 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Initializes the CRC calculator for the 16-bit CRC calculation (CRC generating polynomial: X16 + X12 + X5 + 1).

[Syntax]

RX65N/RX651

Other devices

[Argument(s)]

[Return value]

None.

R_CRC_SetCCITT

void R_CRC_SetCCITT ( void );

#include "r_cg_crc.h"void R_CRC_SetCCITT ( crc_bitorder order );

I/O Argument Description

I crc_bitorder order; CRC calculation switching typeCRC_LSB: LSB-firstCRC_MSB: MSB-first

Page 311: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 311 of 375Oct 01, 2016

Initializes the CRC calculator for the 32-bit CRC calculation (CRC generating polynomial: X32 + X26 + X23 + X22 + X16 + X12 + X11 + X10 + X8 + X7 + X5 + X + 1).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CRC_SetCRC32

void R_CRC_SetCRC32 ( void );

Page 312: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 312 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Initializes the CRC calculator for the 32-bit CRC calculation (CRC generating polynomial: X32 + X28 + X27 + X26 + X25 + X23 + X22 + X20 + X19 + X18 + X14 + X13 + X11 + X10 + X9 + X8 + X6 + 1).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CRC_SetCRC32C

void R_CRC_SetCRC32C ( void );

Page 313: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 313 of 375Oct 01, 2016

Sets the initial value of the data from which the CRC is to be calculated.

[Syntax]

[Argument(s)]

[Return value]

None.

R_CRC_Input_Data

#include "r_cg_macrodriver.h"void R_CRC_Input_Data ( uint8_t data );

I/O Argument Description

I uint8_t data; The initial value of the data from which the CRC is to be calcu-lated

Page 314: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 314 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Gets the result of operation.

[Syntax]

[Argument(s)]

[Return value]

None.

R_CRC_Get_Result

#include "r_cg_macrodriver"void R_CRC_Get_Result ( uint8_t * const result );

I/O Argument Description

O uint8_t * const result; Pointer to the location where the result of operation is stored

Page 315: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 315 of 375Oct 01, 2016

3.2.30 12-bit A/D converter (S12AD)

Below is a list of API functions output by the Code Generator for 12-bit A/D converter use.

Table 3.30 API Functions: [12-Bit A/D Converter]

API Function Name Function

R_S12ADn_Create Performs initialization necessary to control the 12-bit A/D converter.

R_S12ADn_Create_UserInit Performs user-defined initialization relating to the 12-bit A/D converter.

r_s12adn_interrupt Performs processing in response to the A/D scan end interrupt.

r_s12adn_groupb_interrupt Performs processing in response to the group B scan end interrupt.

R_S12ADn_Start Starts A/D conversion.

R_S12ADn_Stop Ends A/D conversion.

R_S12ADn_Get_ValueResult Gets the result of conversion.

R_S12ADn_Set_CompareValue Sets compare level.

r_s12adn_compare_interrupt Performs processing in response to the compare interrupt.

Page 316: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 316 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 12-bit A/D converter.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_S12ADn_Create

void R_S12ADn_Create ( void );

Page 317: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 317 of 375Oct 01, 2016

Performs user-defined initialization relating to the 12-bit A/D converter.

Remark This API function is called as the R_S12ADn_Create callback routine.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_S12ADn_Create_UserInit

void R_S12ADn_Create_UserInit ( void );

Page 318: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 318 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the A/D scan end interrupt.

Remark This API function is called to run interrupt processing for the A/D scan end interrupt, which is generated on completion of scanning of the analog inputs.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

r_s12adn_interrupt

static void r_s12adn_interrupt ( void );

Page 319: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 319 of 375Oct 01, 2016

Performs processing in response to the group B scan end interrupt.

Remark This function is called to run interrupt processing for the group B scan end interrupt, which is generated when scanning of the analog inputs allocated to group B is completed.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

r_s12adn_groupb_interrupt

static void r_s12adn_groupb_interrupt ( void );

Page 320: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 320 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts A/D conversion.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_S12ADn_Start

void R_S12ADn_Start ( void );

Page 321: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 321 of 375Oct 01, 2016

Ends A/D conversion.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_S12ADn_Stop

void R_S12ADn_Stop ( void );

Page 322: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 322 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Gets the result of conversion.

[Syntax]

Remark n is the unit number.

[Argument(s)]

[Return value]

None.

R_S12ADn_Get_ValueResult

#include "r_cg_macrodriver.h"#include "r_cg_s12ad.h"void R_S12ADn_Get_ValueResult ( ad_channel_t channel, uint16_t * const buffer );

I/O Argument Description

I ad_channel_t channel; Channel numberADCHANNEL0: Input channel AN000ADCHANNEL1: Input channel AN001ADCHANNEL2: Input channel AN002ADCHANNEL3: Input channel AN003ADCHANNEL4: Input channel AN004ADCHANNEL6: Input channel AN006ADCHANNEL8: Input channel AN008ADCHANNEL9: Input channel AN009ADCHANNEL10: Input channel AN010ADCHANNEL11: Input channel AN011ADCHANNEL12: Input channel AN012ADCHANNEL13: Input channel AN013ADCHANNEL14: Input channel AN014ADCHANNEL15: Input channel AN015ADTEMPSENSOR: Extended analog input (tempera-ture sensor output)ADINTERREFVOLT: Extended analog input (internal ref-erence voltage)

O uint16_t * const buffer; Pointer to the area where the results of conversion are stored

Page 323: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 323 of 375Oct 01, 2016

Sets compare level.

[Syntax]

Remark n is the unit number.

[Argument(s)]

[Return value]

None.

R_S12ADn_Set_CompareValue

void R_S12ADn_Set_CompareValue ( ad_channel_t reg_value0, rad_channel_t reg_value1 );

I/O Argument Description

I ad_chanel_t reg_value0 Register value set to the compare revel register 0

I ad_chanel_t reg_value1 Register value set to the compare revel register 1

Page 324: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 324 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the compare interrupt.

Remark This API function is called to run the interrupt processing for the compare interrupt.

[Syntax]

Remark n is the unit number.

[Argument(s)]

None.

[Return value]

None.

r_s12adn_compare_interrupt

void r_s12adn_compare_interrupt ( void );

Page 325: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 325 of 375Oct 01, 2016

3.2.31 D/A converter (DA)

Below is a list of API functions output by the Code Generator for D/A converter use.

Table 3.31 API Functions: [D/A Converter]

API Function Name Function

R_DA_Create Performs initialization necessary to control the D/A converter.

R_DA_Create_UserInit Performs user-defined initialization relating to the D/A converter.

R_DAm_Start Starts D/A conversion.

R_DAm_Stop Ends D/A conversion.

R_DAm_Set_ConversionValue Sets the data for D/A conversion.

Page 326: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 326 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the D/A converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DA_Create

void R_DA_Create ( void );

Page 327: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 327 of 375Oct 01, 2016

Performs user-defined initialization relating to the D/A converter.

Remark This API function is called as the R_DA_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DA_Create_UserInit

void R_DA_Create_UserInit ( void );

Page 328: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 328 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts D/A conversion.

[Syntax]

Remark m is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DAm_Start

void R_DAm_Start ( void );

Page 329: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 329 of 375Oct 01, 2016

Ends D/A conversion.

[Syntax]

Remark m is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DAm_Stop

void R_DAm_Stop ( void );

Page 330: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 330 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the data for D/A conversion.

[Syntax]

Remark m is the channel number.

[Argument(s)]

[Return value]

None.

R_DAm_Set_ConversionValue

#include "r_cg_macrodriver.h"void R_DAm_Set_ConversionValue ( uint16_t reg_value );

I/O Argument Description

I uint16_t reg_value; Data for D/A conversion

Page 331: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 331 of 375Oct 01, 2016

3.2.32 12-bit converter (R12DA)

Below is a list of API functions output by the Code Generator for 12-bit D/A converter use.

Table 3.32 API Functions: [12-Bit D/A Converter]

API Function Name Function

R_R12DA_Create Performs initialization necessary to control the 12-bit D/A converter.

R_DA_Create_UserInit Performs user-defined initialization relating to the 12-bit D/A converter.

R_R12DAn_Start Starts D/A conversion.

R_R12DAn_Stop Ends D/A conversion.

R_R12DAn_Start Starts synchronous D/A conversion.

R_R12DAn_Stop Ends synchronous D/A conversion.

R_R12DAn_Set_ConversionValue Sets the data for D/A conversion.

Page 332: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 332 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 12-bit D/A converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_R12DA_Create

void R_R12DA_Create ( void );

Page 333: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 333 of 375Oct 01, 2016

Performs user-defined initialization relating to the 12-bit D/A converter.

Remark This API function is called as the R_R12DA_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DA_Create_UserInit

void R_R12DA_Create_UserInit ( void );

Page 334: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 334 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts 12-bit D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_R12DAn_Start

void R_R12DAn_Start ( void );

Page 335: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 335 of 375Oct 01, 2016

Ends 12-bit D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_R12DAn_Stop

void R_R12DAn_Stop ( void );

Page 336: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 336 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts synchronous 12-bit D/A conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_R12DA_sync_Start

void R_R12DA_sync_Start ( void );

Page 337: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 337 of 375Oct 01, 2016

Ends synchronous 12-bit D/A conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_R12DA_sync_Stop

void R_R12DA_sync_Stop ( void );

Page 338: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 338 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the data for 12-bit D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_R12DAn_Set_ConversionValue

void R_R12DAn_Set_ConversionValue ( uint16_t reg_value );

I/O Argument Description

I uint16_t reg_value; Data for 12-bit D/A conversion

Page 339: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 339 of 375Oct 01, 2016

3.2.33 Comparator B (CMPB)

Below is a list of API functions output by the Code Generator for Comparator B use.

Table 3.33 API Functions: [Comparator B]

API Function Name Function

R_CMPB_Create Performs initialization necessary to control the Comparator B.

R_CMPB_Create_UserInit Performs user-defined initialization relating to the Comparator B.

r_cmpb_cmpbn_interrupt Performs processing in response to the comparator B interrupt.

R_CMPBn_Start Starts comparison for analog input voltage.

R_CMPBn_Stop Ends comparison for analog input voltage.

Page 340: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 340 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the Comparator B.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CMPB_Create

void R_CMPB_Create ( void );

Page 341: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 341 of 375Oct 01, 2016

Performs user-defined initialization relating to the Comparator B.

Remark This API function is called as the R_CMPB_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CMPB_Create_UserInit

void R_CMPB_Create_UserInit ( void );

Page 342: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 342 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the comparator B interrupt.

Remark This API function is called to run interrupt processing for the comparator Bn interrupt, which is generated when the comparison result changes at this time.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmpb_cmpbn_interrupt

void r_cmpb_cmpbn_interrupt ( void );

Page 343: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 343 of 375Oct 01, 2016

Starts comparison for analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMPBn_Start

void R_CMPBn_Start ( void );

Page 344: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 344 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Ends comparison for analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMPBn_Stop

void R_CMPBn_Stop ( void );

Page 345: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 345 of 375Oct 01, 2016

3.2.34 Data operation circuit (DOC)

Below is a list of API functions output by the Code Generator for data operation circuit.

Table 3.34 API Functions: [Data Operation Circuit]

API Function Name Function

R_DOC_Create Performs initialization necessary to control the data operation circuit.

R_DOC_Create_UserInit Performs user-defined initialization relating to the data operation circuit.

r_doc_dopcf_interrupt Performs processing in response to the data operation circuit interrupt.

R_DOC_SetMode Sets the operating mode and the initial value of the reference value for use by the data operation circuit.

R_DOC_WriteData Sets the input value (value for comparison with, addition to, or subtraction from the reference value) for use by the data operation circuit.

R_DOC_GetResult Gets the result of operation.

R_DOC_ClearFlag Clears the data operation circuit flag.

Page 346: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 346 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the data operation circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_Create

void R_DOC_Create ( void );

Page 347: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 347 of 375Oct 01, 2016

Performs user-defined initialization relating to the data operation circuit.

Remark This API function is called as the R_DOC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_Create_UserInit

void R_DOC_Create_UserInit ( void );

Page 348: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 348 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the data operation circuit interrupt.

Remark This API function is called to run interrupt processing for the data operation circuit interrupt, which is gen-erated when the result of data comparison satisfies the condition for detection, the result of addition is greater than 0xFFFF, or the result of subtraction is less than 0x00.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_doc_dopcf_interrupt

static void r_doc_dopcf_interrupt ( void );

Page 349: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 349 of 375Oct 01, 2016

Sets the operating mode and the initial value of the reference value for use by the data operation circuit.

Remarks 1. When COMPARE_MISMATCH or COMPARE_MATCH (data comparison mode) is specified as the mode of operation, the 16-bit reference value is stored in the DOC data setting register (DODSR).

Remarks 2. When ADDITION (data addition mode) or SUBTRACTION (data subtraction mode) is specified for the mode (operation mode), the 16-bit value is stored in the DOC data setting register (DODSR) as the initial value.

[Syntax]

[Argument(s)]

[Return value]

None.

R_DOC_SetMode

#include "r_cg_macrodriver.h"#include "r_cg_doc.h"void R_DOC_SetMode ( doc_mode_t mode, uint16_t value );

I/O Argument Description

I doc_mode_t mode; Operating modes (including the condition for detection)COMPARE_MISMATCH: Data comparison mode (mismatch)COMPARE_MATCH: Data comparison mode (match)ADDITION: Data addition modeSUBTRACTION: Data subtraction mode

I uint16_t value; Initial value of the reference value for use by the DOC

Page 350: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 350 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the value for comparison with, addition to, or subtraction from the reference value.

[Syntax]

[Argument(s)]

[Return value]

None.

R_DOC_WriteData

#include "r_cg_macrodriver.h"void R_DOC_WriteData ( uint16_t data );

I/O Argument Description

I uint16_t data; Input data for use in operation

Page 351: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 351 of 375Oct 01, 2016

Gets the result of operation.

[Syntax]

[Argument(s)]

[Return value]

None.

R_DOC_GetResult

#include "r_cg_macrodriver"void R_DOC_GetResult ( uint16_t * const data );

I/O Argument Description

O uint16_t * const data; Pointer to the location where the result of operation is to be stored

Page 352: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 352 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Clears the data operation circuit flag.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_ClearFlag

void R_DOC_ClearFlag ( void );

Page 353: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 353 of 375Oct 01, 2016

3.2.35 Low power timer (LPT)

Below is a list of API functions output by the Code Generator for low power timer use.

Table 3.35 API Functions: [Low power timer]

API Function Name Function

R_LPT_Create Performs initialization necessary to control the low power timer.

R_LPT_Create_UserInit Performs user-defined initialization relating to the low power timer.

R_LPT_Start Starts counting by a low power timer.

R_LPT_Stop Ends counting by a low power timer.

Page 354: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 354 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the low power timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPT_Create

void R_LPT_Create ( void );

Page 355: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 355 of 375Oct 01, 2016

Performs user-defined initialization relating to the low power timer.

Remark This API function is called as the R_LPT_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPT_Create_UserInit

void R_LPT_Create_UserInit ( void );

Page 356: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 356 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts counting by a low power timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPT_Start

void R_LPT_Start ( void );

Page 357: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 357 of 375Oct 01, 2016

Ends counting by a low power timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LPT_Stop

void R_LPT_Stop ( void );

Page 358: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 358 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.36 Comparator C (CMPC)

Below is a list of API functions output by the Code Generator for Comparator B use.

Table 3.36 API Functions: [Comparator B]

API Function Name Function

R_CMPC_Create Performs initialization necessary to control the Comparator C.

R_CMPC_Create_UserInit Performs user-defined initialization relating to the Comparator C.

r_cmpc_cmpcn_interrupt Performs processing in response to the comparator C interrupt.

R_CMPCn_Start Starts comparison for analog input voltage.

R_CMPCn_Stop Ends comparison for analog input voltage.

Page 359: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 359 of 375Oct 01, 2016

Performs initialization necessary to control the Comparator C.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CMPC_Create

void R_CMPC_Create ( void );

Page 360: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 360 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the Comparator C.

Remark This API function is called as the R_CMPC_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CMPC_Create_UserInit

void R_CMPC_Create_UserInit ( void );

Page 361: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 361 of 375Oct 01, 2016

Performs processing in response to the comparator C interrupt.

Remark This API function is called to run interrupt processing for the comparator Cn interrupt, which is generated when the comparison result changes at this time.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_cmpc_cmpcn_interrupt

void r_cmpc_cmpcn_interrupt ( void );

Page 362: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 362 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Starts comparison for analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMPCn_Start

void R_CMPCn_Start ( void );

Page 363: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool 3. API FUNCTIONS

R20UT3103EJ0130 Rev.1.30 Page 363 of 375Oct 01, 2016

Ends comparison for analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CMPCn_Stop

void R_CMPCn_Stop ( void );

Page 364: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 364 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

3.2.37 LCD controller / driver (LCD)

Below is a list of API functions output by the Code Generator for LCD controller / driver use.

Table 3.37 API Functions: [LCD controller / driver]

API Function Name Function

R_LCD_Create Performs initialization necessary to control the LCD controller / driver.

R_LCD_Create_UserInit Performs user-defined initialization relating to the LCD controller / driver.

R_LCD_Start Sets the LCD controller / driver to display on status.

R_LCD_Stop Sets the LCD controller / driver to display off status.

R_LCD_Voltage_On Enables operation of internal voltage boost circuit and capacitor split circuit.

R_LCD_Voltage_Off Disables operation of internal voltage boost circuit and capacitor split circuit.

Page 365: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 365 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the LCD controller / driver.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Create

void R_LCD_Create ( void );

Page 366: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 366 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the LCD controller / driver.

Remark This API function is called as the R_LCD_Create callback routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Create_UserInit

void R_LCD_Create_UserInit ( void );

Page 367: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 367 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the LCD controller / driver to display on status.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Start

void R_LCD_Start ( void );

Page 368: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 368 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Sets the LCD controller / driver to display off status.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Stop

void R_LCD_Stop ( void );

Page 369: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 369 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Enables operation of internal voltage boost circuit and capacitor split circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Voltage_On

void R_LCD_Voltage_On ( void );

Page 370: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

R20UT3103EJ0130 Rev.1.30 Page 370 of 375Oct 01, 2016

CS+ Code Generator Tool 3. API FUNCTIONS

Disables operation of internal voltage boost circuit and capacitor split circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Voltage_Off

void R_LCD_Voltage_Off ( void );

Page 371: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

Revision Record

Rev. Date Description

Page Summary

1.00 Aug 01, 2014 - First Edition issued

1.10 Jun 27, 2014 All RX64M supported

1.20 Aug 01, 2014 All Comparator B supported

All R_LPC_AllModuleStop → R_LPC_AllModuleClockStop

3.2.1 Common

19 Remark changed.

23 Remark changed

3.2.21 Compare match timer W (CMTW)

175, 180 output capture interrupt → output compare interrupt

3.2.22 Realtime clock (RTC)

183 Realtime clock (RTCA) → Realtime clock (RTC)

1.30 Oct 01, 2016 All RX65N / RX651 supported

All Low power timer supported

All Comparator C supported

All LCD controller / driver supported

3.2.1 Common

22 PowerON_Reset_PC added

23 r_privileged_exception added

24 r_floatingpoint_exception added

25 r_access_exception added

29 Remark changed

3.2.4 lock frequency accuracy measurement circuit (CAC)

51 r_cac_ovrf_interrupt → r_cac_ovff_interrupt

3.2.9 Data transfer controller (DTC)

99 Remark changed

100 Remark changed

3.2.10 Event link controller (ELC)

104 Remark changed

3.2.12 Multi-function timer pulse unit 2 (MTU2)

117 r_mtu2_cj_tgimn_interrupt added

119 r_mtu2_cj_tcivn_interrupt added

Page 372: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

1.30 Oct 01, 2016 3.2.13 Multi-function timer pulse unit 3 (MTU3)

127 r_mtu3_cj_tgimn_interrupt added

129 r_mtu3_cj_tcivn_interrupt added

3.2.14 Port output enable 2 (POE2)

139 R_POE2_Set_HiZ_MTUn added

140 R_POE2_Clear_HiZ_MTUn added

3.2.15 Port output enable 3 (POE3)

147 R_POE3_Set_HiZ_MTUn added

148 R_POE3_Clear_HiZ_MTUn added

149 R_POE3_Set_HiZ_GPTn added

150 R_POE3_Clear_HiZ_GPTn added

3.2.23 Watchdog timer (WDT)

224 r_wdt_nmi_interrupt added

3.2.29 CRC Calculator (CRC)

311 R_CRC_SetCRC32 added

312 R_CRC_SetCRC32C added

Rev. Date Description

Page Summary

Page 373: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool User's Manual:RX API Reference

Publication Date: Rev.1.00 Aug 01, 2014Rev.1.30 Oct 01, 2016

Published by: Renesas Electronics Corporation

Page 374: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

http://www.renesas.comRefer to "http://www.renesas.com/" for the latest and detailed information.

Renesas Electronics America Inc.2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A.Tel: +1-408-588-6000, Fax: +1-408-588-6130

Renesas Electronics Canada Limited9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3Tel: +1-905-237-2004

Renesas Electronics Europe LimitedDukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.KTel: +44-1628-585-100, Fax: +44-1628-585-900

Renesas Electronics Europe GmbHArcadiastrasse 10, 40472 Düsseldorf, GermanyTel: +49-211-6503-0, Fax: +49-211-6503-1327

Renesas Electronics (China) Co., Ltd.Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.ChinaTel: +86-10-8235-1155, Fax: +86-10-8235-7679

Renesas Electronics (Shanghai) Co., Ltd.Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333Tel: +86-21-2226-0888, Fax: +86-21-2226-0999

Renesas Electronics Hong Kong LimitedUnit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong KongTel: +852-2265-6688, Fax: +852 2886-9022

Renesas Electronics Taiwan Co., Ltd.13F, No. 363, Fu Shing North Road, Taipei 10543, TaiwanTel: +886-2-8175-9600, Fax: +886 2-8175-9670

Renesas Electronics Singapore Pte. Ltd.80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949Tel: +65-6213-0200, Fax: +65-6213-0300

Renesas Electronics Malaysia Sdn.Bhd.Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, MalaysiaTel: +60-3-7955-9390, Fax: +60-3-7955-9510

Renesas Electronics India Pvt. Ltd.No.777C, 100 Feet Road, HALII Stage, Indiranagar, Bangalore, IndiaTel: +91-80-67208700, Fax: +91-80-67208777

Renesas Electronics Korea Co., Ltd.12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, KoreaTel: +82-2-558-3737, Fax: +82-2-558-5141

SALES OFFICES

© 2016 Renesas Electronics Corporation. All rights reserved.

Colophon 4.0

Page 375: CS+ Code Generator Tool - Renesas Electronics...R20UT3103EJ0130 Rev.1.30 Page 6 of 375 Oct 01, 2016 CS+ Code Generator Tool 1. GENERAL 1. GENERAL Code Generator Tool is a software

CS+ Code Generator Tool

R20UT3103EJ0130