e studio Code Generator - renesas.com

651
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). e 2 studio Code Generator Integrated Development Environment User's Manual: RL78 API Reference Target Device RL78 Family Rev.1.05 Feb 2018

Transcript of e studio Code Generator - renesas.com

Page 1: e studio Code Generator - renesas.com

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).

e2 studio Code GeneratorIntegrated Development Environment

User's Manual: RL78 API Reference

Target Device

RL78 Family

Rev.1.05 Feb 2018

Page 2: e studio Code Generator - renesas.com

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 or any other use of the circuits, software, and information in the design of your product or system. Renesas Electronics disclaims any and all liability for any losses and damages incurred by you or third parties arising from the use of these circuits, software, or information.

2. Renesas Electronics hereby expressly disclaims any warranties against and liability for infringement or any other claims involving 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, including but not limited to, the product data, drawings, charts, programs, algorithms, and application examples.

3. 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 shall not alter, modify, copy, or reverse engineer any Renesas Electronics product, whether in whole or in part. Renesas Electronics disclaims any and all liability for any losses or damages incurred by you or third parties arising from such alteration, modification, copying or reverse engineering.

5. Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The intended 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; industrial robots; etc. “High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control (traffic lights); large-scale communication

equipment; key financial terminal systems; safety control equipment; etc. Unless expressly designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not intended or 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 damage (space system; undersea repeaters; nuclear power control systems; aircraft control systems; key plant systems; military equipment; etc.). Renesas Electronics disclaims any and all liability for any damages or losses incurred by you or any third parties arising from the use of any Renesas Electronics product that is inconsistent with any Renesas Electronics data sheet, user’s manual or other Renesas Electronics document.

6. When using Renesas Electronics products, refer to the latest product information (data sheets, user’s manuals, application notes, “General Notes for Handling and Using Semiconductor Devices” in the reliability handbook, etc.), and ensure that usage conditions are within the ranges specified by Renesas Electronics with respect to maximum ratings, operating power supply voltage range, heat dissipation characteristics, installation, etc. Renesas Electronics disclaims any and all liability for any malfunctions, failure or accident arising out of the use of Renesas Electronics products outside of such specified ranges.

7. Although Renesas Electronics endeavors to improve the quality and reliability of Renesas Electronics products, semiconductor products have specific characteristics, such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Unless designated as a high reliability product or a product for harsh environments in a Renesas Electronics data sheet or other Renesas Electronics document, Renesas Electronics products are not subject to radiation resistance design. You are responsible for implementing safety measures to guard against the possibility of bodily injury, injury or damage caused by fire, and/or danger to the public in the event of a failure or malfunction of Renesas Electronics products, 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 and impractical, you are responsible for evaluating 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. You are responsible for carefully and sufficiently investigating applicable laws and regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive, and using Renesas Electronics products in compliance with all these applicable laws and regulations. Renesas Electronics disclaims any and all liability for damages or losses occurring as a result of your noncompliance with applicable laws and regulations.

9. Renesas Electronics products and technologies shall 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 shall comply with any applicable export control laws and regulations promulgated and administered by the governments of any countries asserting jurisdiction over the parties or transactions.

10. It is the responsibility of the buyer or distributor of Renesas Electronics products, or any other party who distributes, disposes of, or otherwise sells or transfers the product to a third party, to notify such third party in advance of the contents and conditions set forth in this document.

11. This document shall not be reprinted, 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.

(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its directly or indirectly controlled subsidiaries.

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

(Rev.4.0-1 November 2017)

Page 3: e studio Code Generator - renesas.com

How to Use This Manual

Readers The target readers of this manual are the application system engineers who use the Code Generator and need to understand its function.

Purpose The purpose of this manual is to explain the user for understanding and using the Code Generator functions.

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: e studio Code Generator - renesas.com

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 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.1 Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2 Function Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22

3.2.1 Common . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24

3.2.2 Clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29

3.2.3 Port functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 43

3.2.4 High-speed on-chip Oscillator clock Frequency Correction function . . . . . . . . . . . . . . . . . . . . . . . . . . . . 46

3.2.5 Timer array unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 52

3.2.6 Timer RJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 67

3.2.7 Timer RD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 82

3.2.8 Timer RG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 102

3.2.9 Timer RX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 110

3.2.10 16-bit timer KB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 118

3.2.11 16-bit timer KC0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 131

3.2.12 16-bit timer KB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 138

3.2.13 Real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 162

3.2.14 Subsystem clock frequency measurement circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 200

3.2.15 12-bit interval timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 207

3.2.16 8-bit interval timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 215

3.2.17 16-bit wakeup timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 223

3.2.18 Clock output/buzzer output controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 230

3.2.19 Watchdog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 236

3.2.20 24-bit DS A/D converter with programmable gain instrumentation amplifier . . . . . . . . . . . . . . . . . . . . . 241

3.2.21 A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 254

3.2.22 Configurable amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 270

3.2.23 Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 276

3.2.24 24-bitDS A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 283

3.2.25 D/A converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 296

3.2.26 Programmable gain amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 308

3.2.27 Comparator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 315

3.2.28 Comparator/ProgrammableGainAmplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 323

Page 5: e studio Code Generator - renesas.com

3.2.29 Serial array unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 334

3.2.30 Serial array unit 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 374

3.2.31 Asynchronous serial interface LIN-UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 387

3.2.32 Serial interface IICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 406

3.2.33 LCD controller/driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 429

3.2.34 Sound generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 440

3.2.35 DMA controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 446

3.2.36 Data transfer controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 455

3.2.37 Event link controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 463

3.2.38 Interrupt functions. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 467

3.2.39 Key interrupt function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 483

3.2.40 Voltage detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 489

3.2.41 Battery backup function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 510

3.2.42 Oscillation stop detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 516

3.2.43 SPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 524

3.2.44 Operational amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 533

3.2.45 Data operation circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 542

3.2.46 32-bit Multiply-accumulator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 552

3.2.47 12-bit A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 562

3.2.48 12-bit D/A converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 575

3.2.49 Operational amplifier and Analog switch . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 582

3.2.50 Voltage reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 591

3.2.51 Sampling output timer detector. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 596

3.2.52 External signal sampler . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 605

3.2.53 Serial interface UARTMG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 612

3.2.54 Amplifier unit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 627

3.2.55 Data flash libraries . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 636

Revision Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . C - 1

Page 6: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 6 of 642Feb 01, 2018

e2 studio 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

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: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 7 of 642Feb 01, 2018

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 Out-put(*1)

Common r_main.c or r_cg_main.c

mainR_MAIN_UserInit

AA

r_systeminit.c or r_cg_systeminit.c

hdwinitR_Systeminit

AA

r_cg_macrodriver.h - -

r_cg_userdefine.h - -

Clock generator r_cg_cgc.c R_CGC_CreateR_CGC_Set_ClockModeR_CGC_RAMECC_StartR_CGC_RAMECC_StopR_CGC_StackPointer_StartR_CGC_StackPointer_StopR_CGC_ClockMonitor_StartR_CGC_ClockMonitor_Stop

AMAAAAAA

r_cg_cgc_user.c R_CGC_Create_UserInitr_cgc_ram_ecc_interruptr_cgc_stackpointer_interruptr_cgc_clockmonitor_interruptR_CGC_Get_ResetSource

MAAAA

r_cg_cgc.h - -

Port functions r_cg_port.c R_PORT_Create A

r_cg_port_user.c R_PORT_Create_UserInit M

r_cg_port.h - -

High-speed on-chip Oscillator clock Fre-quency Correction function

r_cg_hofc.c R_HOFC_CreateR_HOFC_StartR_HOFC_Stop

AAA

r_cg_hofc_user.c R_HOFC_Create_UserInitr_hofc_interrupt

MA

r_cg_hofc.h - -

Page 8: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 8 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

Timer array unit r_cg_timer.c or r_cg_tau.c

R_TAUm_CreateR_TAUm_Channeln_StartR_TAUm_Channeln_Higher8bits_StartR_TAUm_Channeln_Lower8bits_StartR_TAUm_Channeln_StopR_TAUm_Channeln_Higher8bits_StopR_TAUm_Channeln_Lower8bits_StopR_TAUm_ResetR_TAUm_Set_PowerOffR_TAUm_Channeln_Get_PulseWidthR_TAUm_Channeln_Set_SoftwareTriggerOn

AAAAAAAMAAA

r_cg_timer_user.c or r_cg_tau_user.c

R_TAUm_Create_UserInitr_taum_channeln_interruptr_taum_channeln_higher8bits_interrupt

MAA

r_cg_timer.h or r_cg_tau.h

- -

Timer RJ r_cg_timer.c orr_cg_tmrj.c

R_TMR_RJn_CreateR_TMR_RJn_StartR_TMR_RJn_StopR_TMR_RJn_Set_PowerOffR_TMR_RJn_Get_PulseWidthR_TMRJn_CreateR_TMRJn_StartR_TMRJn_StopR_TMRJn_Set_PowerOffR_TMRJn_Get_PulseWidth

AAAAAAAAMM

r_cg_timer_user.c orr_cg_tmrj_user.c

R_TMR_RJn_Create_UserInitr_tmr_rjn_interruptR_TMRJn_Create_UserInitr_tmrjn_interrupt

MAMA

r_cg_timer.h orr_cg_tmrj.h

- -

Timer RD r_cg_timer.c orr_cg_tmrd.c

R_TMR_RDn_CreateR_TMR_RDn_StartR_TMR_RDn_StopR_TMR_RDn_Set_PowerOffR_TMR_RDn_ForcedOutput_StartR_TMR_RDn_ForcedOutput_StopR_TMR_RDn_Get_PulseWidthR_TMRDn_CreateR_TMRDn_StartR_TMRDn_StopR_TMRDn_Set_PowerOffR_TMRDn_ForcedOutput_StartR_TMRDn_ForcedOutput_StopR_TMRDn_Get_PulseWidthR_TMRD_Set_PowerOff

AAAMMMAAAAMMMM

r_cg_timer_user.c orr_cg_tmrd_user.c

R_TMR_RDn_Create_UserInitr_tmr_rdn_interruptR_TMRDn_Create_UserInitr_tmrdn_interrupt

MAMA

r_cg_timer.h orr_cg_tmrd.h

- -

Peripheral Function File Name API Function Name Out-put(*1)

Page 9: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 9 of 642Feb 01, 2018

Timer RG r_cg_timer.c R_TMR_RG0_CreateR_TMR_RG0_StartR_TMR_RG0_StopR_TMR_RG0_Set_PowerOffR_TMR_RG0_Get_PulseWidth

AAAMA

r_cg_timer_user.c R_TMR_RG0_Create_UserInitr_tmr_rg0_interrupt

MA

r_cg_timer.h - -

Timer RX r_cg_tmrx.c R_TMRX_CreateR_TMRX_StartR_TMRX_StopR_TMRX_Set_PowerOffR_TMRX_Get_BufferValue

AAAAM

r_cg_tmrx_user.c R_TMRX_Create_UserInitr_tmrx_interrupt

MA

r_cg_tmrx.h - -

16-bit timer KB r_cg_timer.c or r_cg_tmkb.c

R_TMR_KB_CreateR_TMR_KBm_StartR_TMR_KBm_StopR_TMR_KBm_Set_PowerOffR_TMR_KBmn_ForcedOutput_StartR_TMR_KBmn_ForcedOutput_StopR_TMR_KBm_BatchOverwriteRequestOnR_TMR_KBm_ForcedOutput_mn_StartR_TMR_KBm_ForcedOutput_mn_StopR_TMR_KBm_Reset

AAAMAAAAAM

r_cg_timer_user.c or r_cg_tmkb_user.c

R_TMR_KBm_Create_UserInitr_tmr_kbm_interrupt

MA

r_cg_timer.h or r_cg_tmkb.h

- -

16-bit timer KC0 r_cg_timer.c R_TMR_KC0_CreateR_TMR_KC0_StartR_TMR_KC0_StopR_TMR_KC0_Set_PowerOff

AAAM

r_cg_timer_user.c R_TMR_KC0_Create_UserInitr_tmr_kc0_interrupt

MA

r_cg_timer.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 10: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 10 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

16-bit timer KB2 r_cg_kb2.c R_KB2m_CreateR_KB2m_StartR_KB2m_StopR_KB2m_Set_PowerOffR_KB2m_Simultaneous_StartR_KB2m_Simultaneous_StopR_KB2m_Synchronous_StartR_KB2m_Synchronous_StopR_KB2m_TKBOn0_Forced_Output_Stop_Function1_StartR_KB2m_TKBOn0_Forced_Output_Stop_Function1_StopR_KB2m_TKBOn1_Forced_Output_Stop_Function1_StartR_KB2m_TKBOn1_Forced_Output_Stop_Function1_StopR_KB2m_TKBOn0_DitheringFunction_StartR_KB2m_TKBOn0_DitheringFunction_StopR_KB2m_TKBOn1_DitheringFunction_StartR_KB2m_TKBOn1_DitheringFunction_StopR_KB2m_TKBOn0_SmoothStartFunction_StartR_KB2m_TKBOn0_SmoothStartFunction_StopR_KB2m_TKBOn1_SmoothStartFunction_StartR_KB2m_TKBOn1_SmoothStartFunction_StopR_KB2m_Set_BatchOverwriteRequestOn

AAAMAAAAAAAAAAAAAAAAA

r_cg_kb2_user.c R_KB2m_Create_UserInitr_kb2m_interrupt

MA

r_cg_kb2.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 11: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 11 of 642Feb 01, 2018

Real-time clock r_cg_rtc.c R_RTC_CreateR_RTC_StartR_RTC_StopR_RTC_Set_PowerOffR_RTC_Set_HourSystemR_RTC_Set_CounterValueR_RTC_Set_CalendarCounterValueR_RTC_Set_BinaryCounterValueR_RTC_Get_CounterValueR_RTC_Get_CalendarCounterValueR_RTC_Get_BinaryCounterValueR_RTC_Set_ConstPeriodInterruptOnR_RTC_Set_ConstPeriodInterruptOffR_RTC_Set_AlarmOnR_RTC_Set_CalendarAlarmOnR_RTC_Set_BinaryAlarmOnR_RTC_Set_AlarmOffR_RTC_Set_AlarmValueR_RTC_Set_CalendarAlarmValueR_RTC_Set_BinaryAlarmValueR_RTC_Get_AlarmValueR_RTC_Get_CalendarAlarmValueR_RTC_Get_BinaryAlarmValueR_RTC_Set_RTC1HZOnR_RTC_Set_RTC1HZOffR_RTC_Set_RTCOUTOnR_RTC_Set_RTCOUTOff

AAAAMAAAAAAAAAAAAAAAAAAAAAA

r_cg_rtc_user.c R_RTC_Create_UserInitr_rtc_interruptr_rtc_callback_constperiodr_rtc_callback_alarmr_rtc_alarminterruptr_rtc_periodicinterruptr_rtc_callback_periodic

MAAAAAA

r_cg_rtc.h - -

Subsystem clock frequency measure-ment circuit

r_cg_fmc.c R_FMC_CreateR_FMC_StartR_FMC_StopR_FMC_Set_PowerOff

AAAM

r_cg_fmc_user.c R_FMC_Create_UserInitr_fmc_interrupt

MA

r_cg_fmc.h - -

12-bit interval timer r_cg_it.c R_IT_CreateR_IT_StartR_IT_StopR_IT_ResetR_IT_Set_PowerOff

AAAMM

r_cg_it_user.c R_IT_Create_UserInitr_it_interrupt

MA

r_cg_it.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 12: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 12 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

8-bit interval timer r_cg_it8bit.c R_IT8bitm_Channeln_CreateR_IT8bitm_Channeln_StartR_IT8bitm_Channeln_StopR_IT8bitm_Channeln_Set_PowerOffR_IT8bitm_Set_PowerOff

AAAMM

r_cg_it8bit_user.c R_IT8bitm_Channeln_Create_UserInitr_it8bitm_channeln_interrupt

MA

r_cg_it8bit.h - -

16-bit wakeup timer r_cg_timer.c R_WUTM_CreateR_WUTM_StartR_WUTM_StopR_WUTM_Set_PowerOff

AAAM

r_cg_timer_user.c R_WUTM_Create_UserInitr_wutm_interrupt

MA

r_cg_timer.h - -

Clock output/buzzer output controller

r_cg_pclbuz.c R_PCLBUZn_CreateR_PCLBUZn_StartR_PCLBUZn_StopR_PCLBUZ_Set_PowerOff

AAAM

r_cg_pclbuz_user.c R_PCLBUZn_Create_UserInit M

r_cg_pclbuz.h - -

Watchdog timer r_cg_wdt.c R_WDT_CreateR_WDT_Restart

AA

r_cg_wdt_user.c R_WDT_Create_UserInitr_wdt_interrupt

MA

r_cg_wdt.h - -

24-bit DS A/D con-verter with program-mable gain instrumentation amplifier

r_cg_pga_dsad.c R_PGA_DSAD_CreateR_PGA_DSAD_StartR_PGA_DSAD_StopR_PGA_DSAD_Set_PowerOffR_PGA_DSAD_Get_AverageResultR_PGA_DSAD_Get_ResultR_PGA_DSAD_CAMP_OffsetTrimming

AAAMAAA

r_cg_pga_dsad_user.c R_PGA_DSAD_Create_UserInitr_pga_dsad_interrupt_conversionr_pga_dsad_interrupt_scanr_pga_dsad_conversion_interruptr_pga_dsad_scan_interrupt

MAAAA

r_cg_pga_dsad.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 13: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 13 of 642Feb 01, 2018

A/D converter r_cg_adc.c R_ADC_CreateR_ADC_Set_OperationOnR_ADC_Set_OperationOffR_ADC_StartR_ADC_StopR_ADC_ResetR_ADC_Set_PowerOffR_ADC_Set_ADChannelR_ADC_Set_SnoozeOnR_ADC_Set_SnoozeOffR_ADC_Set_TestChannelR_ADC_Get_ResultR_ADC_Get_Result_8bit

AAAAAMMMMMMAA

r_cg_adc_user.c R_ADC_Create_UserInitr_adc_interrupt

MA

r_cg_adc.h - -

Configurable ampli-fier

r_cg_camp.c R_CAMP_CreateR_CAMPn_StartR_CAMPn_StopR_CAMP_Set_PowerOff

AAAM

r_cg_camp_user.c R_CAMP_Create_UserInit M

r_cg_camp.h - -

Temperature sensor r_cg_tmps.c R_TMPS_CreateR_TMPS_StartR_TMPS_StopR_TMPS_ResetR_TMPS_Set_PowerOff

AAAMM

r_cg_tmps_user.c R_TMPS_Create_UserInit M

r_cg_tmps.h - -

24-bitDS A/D con-verter

r_cg_dsadc.c R_DSADC_CreateR_DSADC_Set_OperationOnR_DSADC_Set_OperationOffR_DSADC_StartR_DSADC_StopR_DSADC_ResetR_DSADC_Set_PowerOffR_DSADC_Channeln_Get_ResultR_DSADC_Channeln_Get_Result_16bit

AAAAAMMAA

r_cg_dsadc_user.c R_DSADC_Create_UserInitr_dsadc_interruptr_dsadzcn_interrupt

MAA

r_cg_dsadc.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 14: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 14 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

D/A converter r_cg_dac.c R_DAC_CreateR_DACn_StartR_DACn_StopR_DAC_Set_PowerOffR_DACn_Set_ConversionValueR_DAC_Change_OutputVoltage_8bitR_DAC_Change_OutputVoltageR_DACn_CreateR_DAC_Reset

AAAMAAAAA

r_cg_dac_user.c R_DAC_Create_UserInitR_DACn_Create_UserInit

MM

r_cg_dac.h - -

Programmable gain amplifier

r_cg_pga.c R_PGA_CreateR_PGA_StartR_PGA_StopR_PGA_ResetR_PGA_Set_PowerOff

AAAMM

r_cg_pga_user.c R_PGA_Create_UserInit M

r_cg_pga.h - -

Comparator r_cg_comp.c R_COMP_CreateR_COMPn_StartR_COMPn_StopR_COMP_ResetR_COMP_Set_PowerOff

AAAMM

r_cg_comp_user.c R_COMP_Create_UserInitr_compn_interrupt

MA

r_cg_comp.h - -

Comparator/Pro-grammableGain-Amplifier

r_cg_comppga.c R_COMPPGA_CreateR_COMPPGA_Set_PowerOffR_COMPn_StartR_COMPn_StopR_PGA_StartR_PGA_StopR_PWMOPT_StartR_PWMOPT_Stop

AMAAAAAA

r_cg_comppga_user.c R_COMP_Create_UserInitr_compn_interruptR_COMPPGA_Create_UserInitr_compn_interrupt

MAMA

r_cg_comppga.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 15: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 15 of 642Feb 01, 2018

Serial array unit r_cg_serial.c or r_cg_sau.c

R_SAUm_CreateR_SAUm_ResetR_SAUm_Set_PowerOffR_SAUm_Set_SnoozeOnR_SAUm_Set_SnoozeOffR_UARTn_CreateR_UARTn_StartR_UARTn_StopR_UARTn_SendR_UARTn_ReceiveR_CSImn_CreateR_CSImn_StartR_CSImn_StopR_CSImn_SendR_CSImn_ReceiveR_CSImn_Send_ReceiveR_IICmn_CreateR_IICmn_StartConditionR_IICmn_StopConditionR_IICmn_StopR_IICmn_Master_SendR_IICmn_Master_Receive

AMMMMAAAAAAAAAAAAAAAAA

r_cg_serial_user.c or r_cg_sau_user.c

R_SAUm_Create_UserInitr_uartn_interrupt_sendr_uartn_interrupt_receiver_uartn_interrupt_errorr_uartn_callback_sendendr_uartn_callback_receiveendr_uartn_callback_errorr_uartn_callback_softwareoverrunr_csimn_interruptr_csimn_callback_sendendr_csimn_callback_receiveendr_csimn_callback_errorr_iicmn_interruptr_iicmn_callback_master_sendendr_iicmn_callback_master_receiveendr_iicmn_callback_master_error

MAAAAAAAAAAAAAAA

r_cg_serial.h or r_cg_sau.h

- -

Serial array unit 4 r_cg_serial.c R_DALIn_CreateR_DALIn_StartR_DALIn_StopR_DALIn_SendR_DALIn_Receive

AAAAA

r_cg_serial_user.c r_dalin_interrupt_sendr_dalin_interrupt_receiver_dalin_interrupt_errorr_dalin_callback_sendendr_dalin_callback_receiveendr_dalin_callback_errorr_dalin_callback_softwareoverrun

AAAAAAA

r_cg_serial.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 16: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 16 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

Asynchronous serial interface LIN-UART

r_cg_serial.c R_UARTFn_CreateR_UARTFn_StartR_UARTFn_StopR_UARTFn_Set_PowerOffR_UARTFn_SendR_UARTFn_ReceiveR_UARTFn_Set_DataComparisonOnR_UARTFn_Set_DataComparisonOff

AAAMAAAA

r_cg_serial_user.c R_UARTFn_Create_UserInitr_uartfn_interrupt_sendr_uartfn_interrupt_receiver_uartfn_interrupt_errorr_uartfn_callback_sendendr_uartfn_callback_receiveendr_uartfn_callback_errorr_uartfn_callback_softwareoverrunr_uartfn_callback_expbitdetectr_uartfn_callback_idmatch

MAAAAAAAAA

r_cg_serial.h - -

Serial interface IICA r_cg_serial.c or r_cg_iica.c

R_IICAn_CreateR_IICAn_StopConditionR_IICAn_StopR_IICAn_ResetR_IICAn_Set_PowerOffR_IICAn_Master_SendR_IICAn_Master_ReceiveR_IICAn_Slave_SendR_IICAn_Slave_ReceiveR_IICAn_Set_SnoozeOnR_IICAn_Set_SnoozeOffR_IICAn_Set_WakeupOnR_IICAn_Set_WakeupOff

AMAMMAAAAAAAA

r_cg_serial_user.c or r_cg_iica_user.c

R_IICAn_Create_UserInitr_iican_interruptr_iican_callback_master_sendendr_iican_callback_master_receiveendr_iican_callback_master_errorr_iican_callback_slave_sendendr_iican_callback_slave_receiveendr_iican_callback_slave_errorr_iican_callback_getstopcondition

MAAAAAAAM

r_cg_serial.h or r_cg_iica.h

- -

Peripheral Function File Name API Function Name Out-put(*1)

Page 17: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 17 of 642Feb 01, 2018

LCD controller/driver

r_cg_lcd.c R_LCD_CreateR_LCD_StartR_LCD_StopR_LCD_Set_VoltageOnR_LCD_Set_VoltageOffR_LCD_Set_PowerOffR_LCD_VoltageOnR_LCD_VoltageOff

AAAAAAAA

r_cg_lcd_user.c R_LCD_Create_UserInitr_lcd_interrupt

MA

r_cg_lcd.h - -

Sound generator r_cg_sg.c R_SG_CreateR_SG_StartR_SG_Stop

AAA

r_cg_sg_user.c R_SG_Create_UserInitr_sg_interrupt

MA

r_cg_sg.h - -

DMA controller r_cg_dmac.c R_DMACn_CreateR_DMAC_CreateR_DMACn_StartR_DMACn_StopR_DMACn_Set_SoftwareTriggerOn

AAAAA

r_cg_dmac_user.c R_DMACn_Create_UserInitR_DMAC_Create_UserInitr_dmacn_interrupt

MMA

r_cg_dmac.h - -

Data transfer con-troller

r_cg_dtc.c R_DTC_CreateR_DTCn_StartR_DTCn_StopR_DTC_Set_PowerOffR_DTCDn_StartR_DTCDn_Stop

AAAMAA

r_cg_dtc_user.c R_DTC_Create_UserInit M

r_cg_dtc.h - -

Event link controller r_cg_elc.c R_ELC_CreateR_ELC_Stop

AA

r_cg_elc_user.c R_ELC_Create_UserInit M

r_cg_elc.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 18: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 18 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

Interrupt functions r_cg_intc.c R_INTC_CreateR_INTCn_StartR_INTCn_StopR_INTCLRn_StartR_INTCLRn_StopR_INTRTCICn_StartR_INTRTCICn_StopR_INTFO_StartR_INTFO_StopR_INTFO_ClearFlag

AAAAAAAAAA

r_cg_intc_user.c R_INTC_Create_UserInitr_intcn_interruptr_intclrn_interruptr_intrtcicn_interruptr_intfo_interrupt

MAAAA

r_cg_intc.h - -

Key interrupt func-tion

r_cg_intc.c or r_cg_key.c

R_KEY_CreateR_KEY_StartR_KEY_Stop

AAA

r_cg_intc_user.c or r_cg_key_user.c

R_KEY_Create_UserInitr_key_interrupt

MA

r_cg_intc.h or r_cg_key.h

- -

Voltage detector r_cg_lvd.c R_LVD_CreateR_LVD_InterruptMode_StartR_LVD_Start_VDDR_LVD_Start_VBATR_LVD_Start_VRTCR_LVD_Start_EXLVDR_LVD_Stop_VDDR_LVD_Stop_VBATR_LVD_Start_VRTCR_LVD_Stop_EXLVDR_LVI_CreateR_LVI_InterruptMode_Start

AAAAAAAAAAAA

r_cg_lvd_user.c R_LVD_Create_UserInitr_lvd_interruptr_lvd_vddinterruptr_lvd_vbatinterruptr_lvd_vrtcinterruptr_lvd_exlvdinterruptR_LVI_Create_UserInitr_lvi_interrupt

MAAAAAMA

r_cg_lvd.h - -

Battery backup function

r_cg_bup.c R_BUP_CreateR_BUP_StartR_BUP_Stop

AAA

r_cg_bup_user.c R_BUP_Create_UserInitr_bup_interrupt

MA

r_cg_bup.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 19: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 19 of 642Feb 01, 2018

Oscillation stop detector

r_cg_osdc.c R_OSDC_CreateR_OSDC_StartR_OSDC_StopR_OSDC_Set_PowerOffR_OSDC_Reset

AAAMM

r_cg_osdc_user.c R_OSDC_Create_UserInitr_osdc_interrupt

MA

r_cg_osdc.h - -

SPI interface r_cg_saic.c orr_cg_spi.c

R_SAIC_CreateR_SAIC_WriteR_SAIC_ReadR_SPI_CreateR_SPI_WriteR_SPI_Read

AAMAAA

r_cg_saic_user.c orr_cg_spi_user.c

R_SAIC_Create_UserInitR_SPI_Create_UserInit

MM

r_cg_saic.h orr_cg_spi.h

- -

Operational ampli-fier

r_cg_opamp.c R_OPAMP_CreateR_OPAMP_Set_ReferenceCurcuitOnR_OPAMP_Set_ReferenceCircuitOffR_OPAMPn_StartR_OPAMPn_StopR_OPAMPn_Set_PrechargeOnR_OPAMPn_Set_PrechargeOff

AAAAAMM

r_cg_saic_user.c R_OPAMP_Create_UserInit M

r_cg_saic.h - -

Data operation cir-cuit

r_cg_doc.c R_DOC_CreateR_DOC_SetModeR_DOC_WriteDataR_DOC_GetResultR_DOC_ClearFlagR_DOC_Set_PowerOffR_DOC_Reset

AAAAAMM

r_cg_doc_user.c R_DOC_Create_UserInitr_doc_interrupt

MA

r_cg_doc.h - -

32-bit Multiply-accumulator

r_cg_mac32bit.c R_MAC32Bit_CreateR_MAC32Bit_ResetR_MAC32Bit_Set_PowerOffR_MAC32bit_MULUnsignedR_MAC32Bit_MULSignedR_MAC32Bit_MACUnsignedR_MAC32Bit_MACSigned

AMMMMMM

r_cg_mac32bit_user.c R_MAC32Bit_Create_UserInitr_mac32bit_interrupt_flow

MA

r_cg_mac32bit.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 20: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 20 of 642Feb 01, 2018

e2 studio Code Generator Tool 2. OUTPUT FILES

12-bit A/D converter r_cg_12adc.c R_12ADC_CreateR_12ADC_StartR_12ADC_StopR_12ADC_Get_ValueResultR_12ADC_Set_ADChannelR_12ADC_TemperatureSensorOutput_OnR_12ADC_TemperatureSensorOutput_OffR_12ADC_InternalReferenceVoltage_OnR_12ADC_InternalReferenceVoltage_OffR_12ADC_Set_PowerOff

AAAAMMMMMM

r_cg_12adc_user.c R_12ADC_Create_UserInitr_12adc_interrupt

MA

r_cg_12adc.h - -

12-bit D/A converter r_cg_12da.c R_12DA_CreateR_12DAn_StartR_12DAn_StopR_12DA_Set_PowerOffR_12DAn_Set_ConversionValue

AAAMA

r_cg_12da_user.c R_12DA_Create_UserInit M

r_cg_12da.h - -

Operational ampli-fier and Analog switch

r_cg_ampansw.c R_AMPANSW_CreateR_OPAMPm_Set_ReferenceCurcuitOnR_OPAMPm_Set_ReferenceCircuitOffR_OPAMPm_StartR_OPAMPm_StopR_ANSW_ChargePumpm_OnR_ANSW_ChargePumpm_Off

AAAAAAA

r_cg_ampansw_user.c R_AMPANSW_Create_UserInit M

r_cg_ampansw.h - -

Voltage reference r_cg_vr.c R_VR_CreateR_VR_StartR_VR_Stop

AAA

r_cg_vr_user.c R_VR_Create_UserInit M

r_cg_vr.h - -

Sampling output timer detector

r_cg_smotd.c R_SMOTD_CreateR_SMOTD_StartR_SMOTD_StopR_SMOTD_Set_PowerOff

AAAM

r_cg_smotd_user.c R_SMOTD_Create_UserInitr_smotd_counterA_interruptr_smotd_counterB_interruptr_smotd_smpn_interrupt

MAAA

r_cg_smotd.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 21: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 2. OUTPUT FILES

R20UT3127EJ0105 Rev.1.05 Page 21 of 642Feb 01, 2018

*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.

External signal sampler

r_cg_exsd.c R_EXSD_CreateR_EXSD_StartR_EXSD_StopR_EXSD_Set_PowerOff

AAAM

r_cg_exsd_user.c R_EXSD_Create_UserInitr_exsd_interrupt

MA

r_cg_exsd.h - -

Serial interface UARTMG

r_cg_uartmg.c R_UARTMGn_CreateR_UARTMGn_StartR_UARTMGn_StopR_UARTMGn_Set_PowerOffR_UARTMGn_SendR_UARTMGn_Receive

AAAMAA

r_cg_uartmg_user.c R_UARTMGn_Create_UserInitr_uartmgn_interrupt_sendr_uartmgn_interrupt_receiver_uartmgn_interrupt_errorr_uartmgn_callback_sendendr_uartn_callback_receiveendr_uartmgn_callback_errorr_uartmgn_callback_softwareoverrun

MAAAAAAA

r_cg_uartmg.h - -

Amplifier unit r_cg_amp.c R_AMP_CreateR_AMP_Set_PowerOnR_AMP_Set_PowerOffR_PGA1_StartR_OPAMPn_StopR_AMPn_StartR_AMPn_Stop

AAMAAAA

r_cg_amp_user.c R_AMP_Create_UserInit M

r_cg_amp.h - -

Data flash libraries r_cg_pfdl.c R_FDL_CreateR_FDL_OpenR_FDL_CloseR_FDL_WriteR_FDL_ReadR_FDL_Erase

AAAAAA

r_cg_pfdl.h - -

Peripheral Function File Name API Function Name Out-put(*1)

Page 22: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 22 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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.

(1)

(2)

(3)

(4)

(5)

I/O Argument Description

DescriptionMacro

...

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

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

.........

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

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

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

.........

[Syntax]

[Argument(s)]

[Return value]

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

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

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

Page 23: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 23 of 642Feb 01, 2018

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

(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

I/O Argument Description

(a) (b) (c)

Macro Description

(a) (b)

Page 24: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 24 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.1 Common

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

Table 3.1 API Functions: [Common]

API Function Name Function

hdwinit Performs initialization necessary to control the various hardwares.This API is automatically called from the startup routine of Renesas-made compiler.

R_Systeminit Performs initialization necessary to control the various peripheral functions.

main This is a main function.

R_MAIN_UserInit Performs user-defined initialization.

Page 25: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 25 of 642Feb 01, 2018

Performs initialization necessary to control the various hardwares.

Remark Call this API function from the startup routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

hdwinit

void hdwinit ( void );

Page 26: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 26 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the various peripheral functions.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_Systeminit

void R_Systeminit ( void );

Page 27: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 27 of 642Feb 01, 2018

This is a main function.

Remark Call this API function from the startup routine.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

main

void main ( void );

Page 28: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 28 of 642Feb 01, 2018

e2 studio 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 29: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 29 of 642Feb 01, 2018

3.2.2 Clock generator

Below is a list of API functions output by the Code Generator for clock generator (include reset function, on-chip debug function, etc.) use.

Table 3.2 API Functions: [Clock Generator]

API Function Name Function

R_CGC_Create Performs initialization required to control the clock generator (include reset function, on-chip debug function, etc.).

R_CGC_Create_UserInit Performs user-defined initialization relating to the clock generator (include reset function, on-chip debug function, etc.).

r_cgc_ram_ecc_interrupt Performs processing in response to the RAM 1-bit correction/2-bit error detection interrupt INTRAM.

r_cgc_stackpointer_interrupt Performs processing in response to the stackpointer overflow/underflow interrupt INTSPM.

r_cgc_clockmonitor_interrupt Performs processing in response to the clock monitor interrupt INTCLM.

R_CGC_Get_ResetSource Performs processing in response to RESET signal.

R_CGC_Set_ClockMode Changes the CPU clock/peripheral hardware clock.

R_CGC_RAMECC_Start Starts the RAM-ECC function.

R_CGC_RAMECC_Stop Ends the RAM-ECC function.

R_CGC_StackPointer_Start Starts the CPU stack pointer monitor function.

R_CGC_StackPointer_Stop Ends the CPU stack pointer monitor function.

R_CGC_ClockMonitor_Start Starts the clock monitor.

R_CGC_ClockMonitor_Stop Ends the clock monitor.

Page 30: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 30 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization required to control the clock generator (include reset function, on-chip debug function, etc.).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_Create

void R_CGC_Create ( void );

Page 31: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 31 of 642Feb 01, 2018

Performs user-defined initialization relating to the clock generator (include reset function, on-chip debug function, etc.).

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 32: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 32 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the RAM 1-bit correction/2-bit error detection interrupt INTRAM.

Remark This API function is called as the interrupt process corresponding to the RAM 1-bit correction/2-bit error detection interrupt INTRAM.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

r_cgc_ram_ecc_interrupt

__interrupt static void r_cgc_ram_ecc_interrupt ( void );

static void __near r_cgc_ram_ecc_interrupt ( void );

Page 33: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 33 of 642Feb 01, 2018

Performs processing in response to the stack pointer overflow/underflow interrupt INTSPM.

Remark This API function is called as the interrupt process corresponding to the stack pointer overflow/underflow interrupt INTSPM.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_cgc_stackpointer_interrupt

__interrupt static void r_cgc_stackpointer_interrupt ( void );

static void __near r_cgc_stackpointer_interrupt ( void );

Page 34: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 34 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the clock monitor interrupt INTCLM.

Remark This API function is called as the interrupt process corresponding to the clock monitor interrupt INTCLM.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_cgc_clockmonitor_interrupt

__interrupt static void r_cgc_clockmonitor_interrupt ( void );

static void __near r_cgc_clockmonitor_interrupt ( void );

Page 35: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 35 of 642Feb 01, 2018

Performs processing in response to RESET signal.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_Get_ResetSource

void R_CGC_Get_ResetSource ( void );

Page 36: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 36 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Changes the CPU clock/peripheral hardware clock.

[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 generator typeHIOCLK: High-speed onchip oscillatorSYSX1CLK: X1 clockSYSEXTCLK: External main system clockSUBXT1CLK: XT1 clockSUBEXTCLK: External subsystem clock

Macro Description

MD_OK Normal completion

MD_ERROR1 Exit with error (abend)

MD_ERROR2 Exit with error (abend)

MD_ERROR3 Exit with error (abend)

MD_ERROR4 Exit with error (abend)

MD_ARGERROR Invalid argument specification

Page 37: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 37 of 642Feb 01, 2018

Starts the RAM-ECC function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_RAMECC_Start

void R_CGC_RAMECC_Start ( void );

Page 38: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 38 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the RAM-ECC function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_RAMECC_Stop

void R_CGC_RAMECC_Stop ( void );

Page 39: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 39 of 642Feb 01, 2018

Starts the CPU stack pointer function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_StackPointer_Start

void R_CGC_StackPointer_Start ( void );

Page 40: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 40 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the CPU stack pointer function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_StackPointer_Stop

void R_CGC_StackPointer_Stop ( void );

Page 41: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 41 of 642Feb 01, 2018

Starts the clock monitor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_ClockMonitor_Start

void R_CGC_ClockMonitor_Start ( void );

Page 42: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 42 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the clock monitor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CGC_ClockMonitor_Stop

void R_CGC_ClockMonitor_Stop ( void );

Page 43: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 43 of 642Feb 01, 2018

3.2.3 Port functions

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

Table 3.3 API Functions: [Port Functions]

API Function Name Function

R_PORT_Create Performs initialization necessary to control the port functions.

R_PORT_Create_UserInit Performs user-defined initialization relating to the port functions.

Page 44: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 44 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the port functions.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PORT_Create

void R_PORT_Create ( void );

Page 45: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 45 of 642Feb 01, 2018

Performs user-defined initialization relating to the port functions.

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 46: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 46 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.4 High-speed on-chip Oscillator clock Frequency Correction function

Below is a list of API functions output by the Code Generator for the High-speed on-chip Oscillator clock Frequency Cor-rection function use.

Table 3.4 API Functions: [High-speed on-chip Oscillator clock Frequency Correction function]/

API Function Name Function

R_HOFC_Create Performs initialization necessary to control the High-speed on-chip Oscillator clock Frequency Correction function.

R_HOFC_Create_UserInit Performs user-defined initialization relating to the High-speed on-chip Oscillator clock Frequency Correction function.

r_hofc_interrupt Performs processing in response to the timer interrupt.

R_HOFC_Start Starts the count for the High-speed on-chip Oscillator clock Frequency Correction function.

R_HOFC_Stop Ends the count for the High-speed on-chip Oscillator clock Frequency Correction function.

Page 47: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 47 of 642Feb 01, 2018

Performs initialization necessary to control the High-speed on-chip Oscillator clock Frequency Correction function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_HOFC_Create

void R_HOFC_Create ( void );

Page 48: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 48 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the High-speed on-chip Oscillator clock Frequency Correction function.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_HOFC_Create_UserInit

void R_HOFC_Create_UserInit ( void );

Page 49: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 49 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the High-speed on-chip Oscillator clock Frequency Correction function interrupt INTCR.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_hofc_interrupt

__interrupt static void r_hofc_interrupt ( void );

static void __near r_hofc_interrupt ( void );

Page 50: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 50 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for the High-speed on-chip Oscillator clock Frequency Correction function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_HOFC_Start

void R_HOFC_Start ( void );

Page 51: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 51 of 642Feb 01, 2018

Ends the count for the High-speed on-chip Oscillator clock Frequency Correction function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_HOFC_Stop

void R_HOFC_Stop ( void );

Page 52: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 52 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.5 Timer array unit

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

Table 3.5 API Functions: [Timer Array Unit]

API Function Name Function

R_TAUm_Create Performs initialization necessary to control the timer array unit.

R_TAUm_Create_UserInit Performs user-defined initialization relating to the timer array unit.

r_taum_channeln_interrupt Performs processing in response to the timer interrupt INTTMmn.

r_taum_channeln_higher8bits_interrupt Performs processing in response to the timer interrupt INTTMmnH.

R_TAUm_Channeln_Start Starts the count for channel n.

R_TAUm_Channeln_Higher8bits_Start Starts the count (higher 8-bit) for channel n.

R_TAUm_Channeln_Lower8bits_Start Starts the count (lower 8-bit) for channel n.

R_TAUm_Channeln_Stop Ends the count for channel n.

R_TAUm_Channeln_Higher8bits_Stop Ends the count (higher 8-bit) for channel n.

R_TAUm_Channeln_Lower8bits_Stop Ends the count (lower 8-bit) for channel n.

R_TAUm_Reset Reset the timer array unit.

R_TAUm_Set_PowerOff Halts the clock supplied to the timer array unit.

R_TAUm_Channeln_Get_PulseWidth Captures the high/low-level width measured between pulses of the sig-nal (pulses) input to the TImn pin.

R_TAUm_Channeln_Set_SoftwareTriggerOn

Generates the trigger (software trigger) for one-shot pulse output.

Page 53: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 53 of 642Feb 01, 2018

Performs initialization necessary to control the timer array unit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Create

void R_TAUm_Create ( void );

Page 54: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 54 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the timer array unit.

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

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Create_UserInit

void R_TAUm_Create_UserInit ( void );

Page 55: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 55 of 642Feb 01, 2018

Performs processing in response to the timer interrupt INTTMmn.

Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTMmn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_taum_channeln_interrupt

__interrupt static void r_taum_channeln_interrupt ( void );

static void __near r_taum_channeln_interrupt ( void );

Page 56: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 56 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the timer interrupt INTTMmnH.

Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTMmnH.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_taum_channeln_higher8bits_interrupt

__interrupt static void r_taum_channeln_higher8bits_interrupt ( void );

static void __near r_taum_channeln_higher8bits_interrupt ( void );

Page 57: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 57 of 642Feb 01, 2018

Starts the count for channel n.

Remark The time from the call to this API function to the start of counting depends on the type of the function in question (e.g. interval timer, square-wave output, or external event counter).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Start

void R_TAUm_Channeln_Start ( void );

Page 58: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 58 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count (higher 8-bit) for channel n.

Remark This API function can only be called when the timer array unit is used as a 8-bit timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Higher8bits_Start

void R_TAUm_Channeln_Higher8bits_Start ( void );

Page 59: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 59 of 642Feb 01, 2018

Starts the count (lower 8-bit) for channel n.

Remarks 1. This API function can only be called when the timer array unit is used as a 8-bit timer.

Remarks 2. The time from the call to this API function to the start of counting depends on the type of the function in question (e.g. interval timer, external event counter, or delay counter).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Lower8bits_Start

void R_TAUm_Channeln_Lower8bits_Start ( void );

Page 60: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 60 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count for channel n.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Stop

void R_TAUm_Channeln_Stop ( void );

Page 61: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 61 of 642Feb 01, 2018

Ends the count (higher 8-bit) for channel n.

Remark This API function can only be called when the timer array unit is used as a 8-bit timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Higher8bits_Stop

void R_TAUm_Channeln_Higher8bits_Stop ( void );

Page 62: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 62 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count (lower 8-bit) for channel n.

Remark This API function can only be called when the timer array unit is used as a 8-bit timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Lower8bits_Stop

void R_TAUm_Channeln_Lower8bits_Stop ( void );

Page 63: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 63 of 642Feb 01, 2018

Reset the timer array unit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Reset

void R_TAUm_Reset ( void );

Page 64: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 64 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the timer array unit.

Remark Calling this API function changes the timer array unit to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Set_PowerOff

void R_TAUm_Set_PowerOff ( void );

Page 65: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 65 of 642Feb 01, 2018

Captures the high/low-level width measured between pulses of the signal (pulses) input to the TImn pin.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

None.

R_TAUm_Channeln_Get_PulseWidth

#include "r_cg_macrodriver.h"void R_TAUm_Channeln_Get_PulseWidth ( uint32_t * const width );

I/O Argument Description

O uint32_t * const width; Pointer to an area to store the measurement width (0x0 to 0x1FFFF)

Page 66: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 66 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Generates the trigger (software trigger) for one-shot pulse output.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TAUm_Channeln_Set_SoftwareTriggerOn

void R_TAUm_Channeln_Set_SoftwareTriggerOn ( void );

Page 67: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 67 of 642Feb 01, 2018

3.2.6 Timer RJ

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

Table 3.6 API Functions: [Timer RJ]

API Function Name Function

R_TMR_RJn_Create Performs initialization necessary to control the 16-bit timer RJ0.

R_TMR_RJn_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RJ0.

r_tmr_rjn_interrupt Performs processing in response to the timer interrupt.

R_TMR_RJn_Start Starts the count for 16-bit timer RJ0.

R_TMR_RJn_Stop Ends the count for 16-bit timer RJ0.

R_TMR_RJn_Set_PowerOff Halts the clock supplied to the 16-bit timer RJ0.

R_TMR_RJn_Get_PulseWidth Reads the pulse width of the 16-bit timer RJ0.

R_TMRJn_Create Performs initialization necessary to control the 16-bit timer RJ0.

R_TMRJn_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RJ0.

r_tmrjn_interrupt Performs processing in response to the timer interrupt.

R_TMRJn_Start Starts the count for 16-bit timer RJ0.

R_TMRJn_Stop Ends the count for 16-bit timer RJ0.

R_TMRJn_Set_PowerOff Halts the clock supplied to the 16-bit timer RJ0.

R_TMRJn_Get_PulseWidth Reads the pulse width of the 16-bit timer RJ0.

Page 68: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 68 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 16-bit timer RJn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RJn_Create

void R_TMR_RJn_Create ( void );

Page 69: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 69 of 642Feb 01, 2018

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

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RJn_Create_UserInit

void R_TMR_RJn_Create_UserInit ( void );

Page 70: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 70 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmr_rjn_interrupt

__interrupt static void r_tmr_rjn_interrupt ( void );

static void __near r_tmr_rjn_interrupt ( void );

Page 71: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 71 of 642Feb 01, 2018

Starts the count for 16-bit timer RJn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RJn_Start

void R_TMR_RJn_Start ( void );

Page 72: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 72 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count for 16-bit timer RJn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RJn_Stop

void R_TMR_RJn_Stop ( void );

Page 73: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 73 of 642Feb 01, 2018

Halts the clock supplied to the 16-bit timer RJn.

Remark Calling this API function changes the 16-bit timer RJn to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RJn_Set_PowerOff

void R_TMR_RJn_Set_PowerOff ( void );

Page 74: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 74 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the pulse width of the 16-bit timer RJn.

Remarks 1. This API function can only be called when the 16-bit timer RJn is being used for pulse width measurement mode / pulse period measurement mode.

Remarks 2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not be read correctly.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_TMR_RJn_Get_PulseWidth

#include "r_cg_macrodriver.h"void R_TMR_RJn_Get_PulseWidth ( uint32_t * const active_width );

I/O Argument Description

O uint32_t * const active_width; Pointer to an area storing the active level width that was read from the TRJnIO pin

Page 75: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 75 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timer RJn.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRJn_Create

void R_TMRJn_Create ( void );

Page 76: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 76 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRJn_Create_UserInit

void R_TMRJn_Create_UserInit ( void );

Page 77: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 77 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmrjn_interrupt

__interrupt static void r_tmrjn_interrupt ( void );

static void __near r_tmrjn_interrupt ( void );

Page 78: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 78 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer RJn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRJn_Start

void R_TMRJn_Start ( void );

Page 79: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 79 of 642Feb 01, 2018

Ends the count for 16-bit timer RJn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRJn_Stop

void R_TMRJn_Stop ( void );

Page 80: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 80 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer RJn.

Remark Calling this API function changes the 16-bit timer RJn to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRJn_Set_PowerOff

void R_TMRJn_Set_PowerOff ( void );

Page 81: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 81 of 642Feb 01, 2018

Reads the pulse width of the 16-bit timer RJn.

Remarks 1. This API function can only be called when the 16-bit timer RJn is being used for pulse width measurement mode / pulse period measurement mode.

Remarks 2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not be read correctly.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_TMRJn_Get_PulseWidth

#include "r_cg_macrodriver.h"void R_TMRJn_Get_PulseWidth ( uint32_t * const active_width );

I/O Argument Description

O uint32_t * const active_width; Pointer to an area storing the active level width that was read from the TRJnIO pin

Page 82: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 82 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.7 Timer RD

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

Table 3.7 API Functions: [Timer RD]

API Function Name Function

R_TMR_RDn_Create Performs initialization necessary to control the 16-bit timer RDn.

R_TMR_RDn_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RDn.

r_tmr_rdn_interrupt Performs processing in response to the timer interrupt.

R_TMR_RDn_Start Starts the count for 16-bit timer RDn.

R_TMR_RDn_Stop Ends the count for 16-bit timer RDn.

R_TMR_RDn_Set_PowerOff Halts the clock supplied to the 16-bit timer RDn.

R_TMR_RDn_ForcedOutput_Start Starts the pulse output forced cutoff for 16-bit timer RDn,

R_TMR_RDn_ForcedOutput_Stop Ends the pulse output forced cutoff for 16-bit timer RDn.

R_TMR_RDn_Get_PulseWidth Reads the pulse width of the 16-bit timer RDn.

R_TMRDn_Create Performs initialization necessary to control the 16-bit timer RDn.

R_TMRDn_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RDn.

r_tmrdn_interrupt Performs processing in response to the timer interrupt.

R_TMRDn_Start Starts the count for 16-bit timer RDn.

R_TMRDn_Stop Ends the count for 16-bit timer RDn.

R_TMRDn_Set_PowerOff Halts the clock supplied to the 16-bit timer RDn.

R_TMRDn_ForcedOutput_Start Starts the pulse output forced cutoff for 16-bit timer RDn,

R_TMRDn_ForcedOutput_Stop Ends the pulse output forced cutoff for 16-bit timer RDn.

R_TMRDn_Get_PulseWidth Reads the pulse width of the 16-bit timer RDn.

R_TMRD_Set_PowerOff Halts the clock supplied to the 16-bit timer RD.

Page 83: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 83 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_Create

void R_TMR_RDn_Create ( void );

Page 84: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 84 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_Create_UserInit

void R_TMR_RDn_Create_UserInit ( void );

Page 85: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 85 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark [n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmr_rdn_interrupt

__interrupt static void r_tmr_rdn_interrupt ( void );

static void __near r_tmr_rdn_interrupt ( void );

Page 86: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 86 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_Start

void R_TMR_RDn_Start ( void );

Page 87: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 87 of 642Feb 01, 2018

Ends the count for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_Stop

void R_TMR_RDn_Stop ( void );

Page 88: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 88 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer RDn.

Remark Calling this API function changes the 16-bit timer RDn to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_Set_PowerOff

void R_TMR_RDn_Set_PowerOff ( void );

Page 89: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 89 of 642Feb 01, 2018

Starts the pulse output forced cutoff for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_ForcedOutput_Start

void R_TMR_RDn_ForcedOutput_Start ( void );

Page 90: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 90 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the pulse output forced cutoff for 16-bit timer RDn.

Remark This API function can only be called when the 16-bit timer RDn is the count to stopped (the TSTART bit in the timer RD start register (TRDSTR) is 0).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_RDn_ForcedOutput_Stop

void R_TMR_RDn_ForcedOutput_Stop ( void );

Page 91: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 91 of 642Feb 01, 2018

Reads the pulse width of the 16-bit timer RDn.

Remarks 1. This API function can only be called when the 16-bit timer RDn is being used for input capture function.

Remarks 2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not be read correctly.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_TMR_RDn_Get_PulseWidth

#include "r_cg_macrodriver.h"#include "r_cg_timer.h"MD_STATUS R_TMR_RDn_Get_PulseWidth ( uint32_t * const active_width, uint32_t * const inactive_width, timer_channel_t channel );

I/O Argument Description

O uint32_t * const active_width;

Pointer to an area storing the active level width that was read

O uint32_t * const inactive_width;

Pointer to an area storing the inactive level width that was read

I timer_channel_t channel; Pin to readTMCHANNELA: TRDIOAn pinTMCHANNELB: TRDIOBn pinTMCHANNELC: TRDIOCn pinTMCHANNELD: TRDIODn pin

Macro Description

MD_OK Normal completion

Page 92: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 92 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_Create

void R_TMRDn_Create ( void );

Page 93: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 93 of 642Feb 01, 2018

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

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_Create_UserInit

void R_TMRDn_Create_UserInit ( void );

Page 94: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 94 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark [n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_tmrdn_interrupt

__interrupt static void r_tmrdn_interrupt ( void );

static void __near r_tmrdn_interrupt ( void );

Page 95: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 95 of 642Feb 01, 2018

Starts the count for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_Start

void R_TMRDn_Start ( void );

Page 96: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 96 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_Stop

void R_TMRDn_Stop ( void );

Page 97: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 97 of 642Feb 01, 2018

Halts the clock supplied to the 16-bit timer RDn.

Remark Calling this API function changes the 16-bit timer RDn to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_Set_PowerOff

void R_TMRDn_Set_PowerOff ( void );

Page 98: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 98 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the pulse output forced cutoff for 16-bit timer RDn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_ForcedOutput_Start

void R_TMRDn_ForcedOutput_Start ( void );

Page 99: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 99 of 642Feb 01, 2018

Ends the pulse output forced cutoff for 16-bit timer RDn.

Remark This API function can only be called when the 16-bit timer RDn is the count to stopped (the TSTART bit in the timer RD start register (TRDSTR) is 0).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMRDn_ForcedOutput_Stop

void R_TMRDn_ForcedOutput_Stop ( void );

Page 100: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 100 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the pulse width of the 16-bit timer RDn.

Remarks 1. This API function can only be called when the 16-bit timer RDn is being used for input capture function.

Remarks 2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not be read correctly.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_TMRDn_Get_PulseWidth

#include "r_cg_macrodriver.h"#include "r_cg_timer.h"MD_STATUS R_TMRDn_Get_PulseWidth ( uint32_t * const active_width, uint32_t * const inactive_width, timer_channel_t channel );

I/O Argument Description

O uint32_t * const active_width;

Pointer to an area storing the active level width that was read

O uint32_t * const inactive_width;

Pointer to an area storing the inactive level width that was read

I timer_channel_t channel; Pin to readTMCHANNELA: TRDIOAn pinTMCHANNELB: TRDIOBn pinTMCHANNELC: TRDIOCn pinTMCHANNELD: TRDIODn pin

Macro Description

MD_OK Normal completion

Page 101: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 101 of 642Feb 01, 2018

Halts the clock supplied to the 16-bit timer RD.

Remark Calling this API function changes the 16-bit timer RDn to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRD_Set_PowerOff

void R_TMRD_Set_PowerOff ( void );

Page 102: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 102 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.8 Timer RG

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

Table 3.8 API Functions: [Timer RG]

API Function Name Function

R_TMR_RG0_Create Performs initialization necessary to control the 16-bit timer RG0.

R_TMR_RG0_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RG0.

r_tmr_rg0_interrupt Performs processing in response to the timer interrupt.

R_TMR_RG0_Start Starts the count for 16-bit timer RG0.

R_TMR_RG0_Stop Ends the count for 16-bit timer RG0.

R_TMR_RG0_Set_PowerOff Halts the clock supplied to the 16-bit timer RG0.

R_TMR_RG0_Get_PulseWidth Reads the pulse width of the 16-bit timer RG0.

Page 103: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 103 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timer RG0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_RG0_Create

void R_TMR_RG0_Create ( void );

Page 104: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 104 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_RG0_Create_UserInit

void R_TMR_RG0_Create_UserInit ( void );

Page 105: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 105 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_tmr_rg0_interrupt

__interrupt static void r_tmr_rg0_interrupt ( void );

static void __near r_tmr_rg0_interrupt ( void );

Page 106: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 106 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer RG0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_RG0_Start

void R_TMR_RG0_Start ( void );

Page 107: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 107 of 642Feb 01, 2018

Ends the count for 16-bit timer RG0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_RG0_Stop

void R_TMR_RG0_Stop ( void );

Page 108: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 108 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer RG0.

Remark Calling this API function changes the 16-bit timer RG0 to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_RG0_Set_PowerOff

void R_TMR_RG0_Set_PowerOff ( void );

Page 109: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 109 of 642Feb 01, 2018

Reads the pulse width of the 16-bit timer RG0.

Remarks 1. This API function can only be called when the 16-bit timer RG0 is being used for input capture function.

Remarks 2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not be read correctly.

[Syntax]

[Argument(s)]

[Return value]

R_TMR_RG0_Get_PulseWidth

#include "r_cg_macrodriver.h"#include "r_cg_timer.h"MD_STATUS R_TMR_RG0_Get_PulseWidth ( uint32_t * const active_width, uint32_t * const inactive_width, timer_channel_t channel );

I/O Argument Description

O uint32_t * const active_width;

Pointer to an area storing the active level width that was read from the TRGIOA pin

O uint32_t * const inactive_width;

Pointer to an area storing the inactive level width that was read from the TRGIOA pin

I timer_channel_t channel; Pin to readTMCHANNELA: TRGIOA0 pinTMCHANNELB: TRGIOB0 pin

Macro Description

MD_OK Normal completion

Page 110: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 110 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.9 Timer RX

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

Table 3.9 API Functions: [Timer RX]

API Function Name Function

R_TMRX_Create Performs initialization necessary to control the 16-bit timer RX.

R_TMRX_Create_UserInit Performs user-defined initialization relating to the 16-bit timer RX.

r_tmrx_interrupt Performs processing in response to the timer interrupt.

R_TMRX_Start Starts the count for 16-bit timer RX.

R_TMRX_Stop Ends the count for 16-bit timer RX.

R_TMRX_Set_PowerOff Halts the clock supplied to the 16-bit timer RX.

R_TMRX_Get_BufferValue Reads the buffer value of TRX resister(16-bit timer RX).

Page 111: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 111 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timer RX.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRX_Create

void R_TMRX_Create ( void );

Page 112: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 112 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRX_Create_UserInit

void R_TMRX_Create_UserInit ( void );

Page 113: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 113 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_tmrx_interrupt

__interrupt static void r_tmrx_interrupt ( void );

static void __near r_tmrx_interrupt ( void );

Page 114: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 114 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer RX.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRX_Start

void R_TMRX_Start ( void );

Page 115: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 115 of 642Feb 01, 2018

Ends the count for 16-bit timer RX.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRX_Stop

void R_TMRX_Stop ( void );

Page 116: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 116 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer RX.

Remark Calling this API function changes the 16-bit timer RX to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMRX_Set_PowerOff

void R_TMRX_Set_PowerOff ( void );

Page 117: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 117 of 642Feb 01, 2018

Reads the buffer value of TRX register (16-bit timer RX).

[Syntax]

[Argument(s)]

[Return value]

なし

R_TMRX_Get_BufferValue

#include "r_cg_macrodriver.h"void R_TMRX_Get_BufferValue ( uint32_t * const value );

I/O Argument Description

O uint32_t * const value;

Pointer to an area storing the buffer resister value of TRX resister

Page 118: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 118 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.10 16-bit timer KB

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

Table 3.10 API Functions: [16-bit Timers KB]

API Function Name Function

R_TMR_KB_Create Performs initialization necessary to control the 16-bit timer KB.

R_TMR_KBm_Create_UserInit Performs user-defined initialization relating to the 16-bit timer KB.

r_tmr_kbm_interrupt Performs processing in response to the timer interrupt.

R_TMR_KBm_Start Starts the count for 16-bit timer KB.

R_TMR_KBm_Stop Ends the count for 16-bit timer KB.

R_TMR_KBm_Set_PowerOff Halts the clock supplied to the 16-bit timer KB.

R_TMR_KBmn_ForcedOutput_Start Enables input of the trigger signal used for the forced output stop func-tion.

R_TMR_KBmn_ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop func-tion.

R_TMR_KBm_BatchOverwriteRequestOn

Enables batch overwriting of the compare register.

R_TMR_KBm_ForcedOutput_mn_Start Enables input of the trigger signal used for the forced output stop func-tion.

R_TMR_KBm_ForcedOutput_mn_Stop Disables input of the trigger signal used for the forced output stop func-tion.

R_TMR_KBm_Reset Reset the 16-bit timer KB.

Page 119: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 119 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timers KB.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KB_Create

void R_TMR_KB_Create ( void );

Page 120: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 120 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_Create_UserInit

void R_TMR_KBm_Create_UserInit ( void );

Page 121: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 121 of 642Feb 01, 2018

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

r_tmr_kbm_interrupt

__interrupt static void r_tmr_kbm_interrupt ( void );

static void __near r_tmr_kbm_interrupt ( void );

Page 122: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 122 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer KB.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_Start

void R_TMR_KBm_Start ( void );

Page 123: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 123 of 642Feb 01, 2018

Ends the count for 16-bit timer KB.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_Stop

void R_TMR_KBm_Stop ( void );

Page 124: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 124 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer KB.

Remark Calling this API function changes the 16-bit timer KB to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_Set_PowerOff

void R_TMR_KBm_Set_PowerOff ( void );

Page 125: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 125 of 642Feb 01, 2018

Enables input of the trigger signal used for the forced output stop function.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBmn_ForcedOutput_Start

void R_TMR_KBmn_ForcedOutput_Start ( void );

Page 126: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 126 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables input of the trigger signal used for the forced output stop function.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBmn_ForcedOutput_Stop

void R_TMR_KBmn_ForcedOutput_Stop ( void );

Page 127: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 127 of 642Feb 01, 2018

Enables batch overwriting of the compare register.

Remark The timing for batch-overwriting the content of the compare register is when a count value and a value set in the compare register are matched or an external trigger is generated after calling this API function.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_BatchOverwriteRequestOn

void R_TMR_KBm_BatchOverwriteRequestOn ( void );

Page 128: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 128 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables input of the trigger signal used for the forced output stop function.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_ForcedOutput_mn_Start

void R_TMR_KBm_ForcedOutput_mn_Start ( void );

Page 129: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 129 of 642Feb 01, 2018

Disables input of the trigger signal used for the forced output stop function.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_ForcedOutput_mn_Stop

void R_TMR_KBm_ForcedOutput_mn_Stop ( void );

Page 130: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 130 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset the 16-bit timers KB.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_TMR_KBm_Reset

void R_TMR_KBm_Reset ( void );

Page 131: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 131 of 642Feb 01, 2018

3.2.11 16-bit timer KC0

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

Table 3.11 API Functions: [16-bit Timer KC0]

API Function Name Function

R_TMR_KC0_Create Performs initialization necessary to control the 16-bit timer KC0.

R_TMR_KC0_Create_UserInit Performs user-defined initialization relating to the 16-bit timer KC0.

r_tmr_kc0_interrupt Performs processing in response to the timer interrupt.

R_TMR_KC0_Start Starts the count for 16-bit timer KC0.

R_TMR_KC0_Stop Ends the count for 16-bit timer KC0.

R_TMR_KC0_Set_PowerOff Halts the clock supplied to the 16-bit timer KC0.

Page 132: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 132 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the the 16-bit timer KC0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KC0_Create

void R_TMR_KC0_Create ( void );

Page 133: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 133 of 642Feb 01, 2018

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

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KC0_Create_UserInit

void R_TMR_KC0_Create_UserInit ( void );

Page 134: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 134 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_tmr_kc0_interrupt

__interrupt static void r_tmr_kc0_interrupt ( void );

static void __near r_tmr_kc0_interrupt ( void );

Page 135: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 135 of 642Feb 01, 2018

Starts the count for 16-bit timer KC0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KC0_Start

void R_TMR_KC0_Start ( void );

Page 136: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 136 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count for 16-bit timer KC0.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KC0_Stop

void R_TMR_KC0_Stop ( void );

Page 137: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 137 of 642Feb 01, 2018

Halts the clock supplied to the 16-bit timer KC0.

Remark Calling this API function changes the 16-bit timer KC0 to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMR_KC0_Set_PowerOff

void R_TMR_KC0_Set_PowerOff ( void );

Page 138: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 138 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.12 16-bit timer KB2

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

Table 3.12 API Functions: [16-bit Timer KB2]

API Function Name Function

R_KB2m_Create Performs initialization necessary to control the 16-bit timer KB2.

R_KB2m_Create_UserInit Performs user-defined initialization relating to the 16-bit timer KB2.

r_kb2m_interrupt Performs processing in response to the timer interrupt INTTKB2m.

R_KB2m_Start Starts the count for 16-bit timer KB2.

R_KB2m_Stop Ends the count for 16-bit timer KB2.

R_KB2m_Set_PowerOff Halts the clock supplied to the 16-bit timer KB2.

R_KB2m_Simultaneous_Start Starts the simultaneous start/stop mode.

R_KB2m_Simultaneous_Stop Ends the simultaneous start/stop mode.

R_KB2m_Synchronous_Start Starts the timer start/clear mode.

R_KB2m_Synchronous_Stop Ends the timer start/clear mode.

R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start

Starts forced output stop function 1 for timer output TKBOn0.

R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop

Ends forced output stop function 1 for timer output TKBOn0.

R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start

Starts forced output stop function 2 for timer output TKBOn1.

R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop

Starts forced output stop function 2 for timer output TKBOn1.

R_KB2m_TKBOn0_DitheringFunction_Start

Starts dithering function for timer output TKBOn0.

R_KB2m_TKBOn0_DitheringFunction_Stop

Ends dithering function for timer output TKBOn0.

R_KB2m_TKBOn1_DitheringFunction_Start

Starts dithering function for timer output TKBOn1.

R_KB2m_TKBOn1_DitheringFunction_Stop

Ends dithering function for timer output TKBOn1.

R_KB2m_TKBOn0_SmoothStartFunction_Start

Starts smooth start function for timer output TKBOn0.

R_KB2m_TKBOn0_SmoothStartFunction_Stop

Ends smooth start function for timer output TKBOn0.

R_KB2m_TKBOn1_SmoothStartFunction_Start

Starts smooth start function for timer output TKBOn1.

R_KB2m_TKBOn1_SmoothStartFunction_Stop

Ends smooth start function for timer output TKBOn1.

R_KB2m_Set_BatchOverwriteRequestOn Enables batch overwriting of the compare register.

Page 139: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 139 of 642Feb 01, 2018

Performs initialization necessary to control the 16-bit timer KB2.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Create

void R_KB2m_Create ( void );

Page 140: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 140 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Create_UserInit

void R_KB2m_Create_UserInit ( void );

Page 141: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 141 of 642Feb 01, 2018

Performs processing in response to the timer interrupt INTTKB2m.

Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTKB2m.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

r_kb2m_interrupt

__interrupt static void r_kb2m_interrupt ( void );

static void __near r_kb2m_interrupt ( void );

Page 142: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 142 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the count for 16-bit timer KB2.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Start

void R_KB2m_Start ( void );

Page 143: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 143 of 642Feb 01, 2018

Ends the count for 16-bit timer KB2.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Stop

void R_KB2m_Stop ( void );

Page 144: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 144 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 16-bit timer KB2.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Set_PowerOff

void R_KB2m_Set_PowerOff ( void );

Page 145: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 145 of 642Feb 01, 2018

Starts the simultaneous start/stop mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Simultaneous_Start

void R_KB2m_Simultaneous_Start ( void );

Page 146: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 146 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the simultaneous start/stop mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Simultaneous_Stop

void R_KB2m_Simultaneous_Stop ( void );

Page 147: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 147 of 642Feb 01, 2018

Starts the timer start/clear mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Synchronous_Start

void R_KB2m_Synchronous_Start ( void );

Page 148: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 148 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the timer start/clear mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Synchronous_Stop

void R_KB2m_Synchronous_Stop ( void );

Page 149: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 149 of 642Feb 01, 2018

Starts forced output stop function 1 for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start

void R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start ( void );

Page 150: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 150 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends forced output stop function 1 for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop

void R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop ( void );

Page 151: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 151 of 642Feb 01, 2018

Starts forced output stop function 2 for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start

void R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start ( void );

Page 152: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 152 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends forced output stop function 2 for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop

void R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop ( void );

Page 153: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 153 of 642Feb 01, 2018

Starts dithering function for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_DitheringFunction_Start

void R_KB2m_TKBOn0_DitheringFunction_Start ( void );

Page 154: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 154 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends dithering function for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_DitheringFunction_Stop

void R_KB2m_TKBOn0_DitheringFunction_Stop ( void );

Page 155: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 155 of 642Feb 01, 2018

Starts dithering function for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_DitheringFunction_Start

void R_KB2m_TKBOn1_DitheringFunction_Start ( void );

Page 156: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 156 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends dithering function for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_DitheringFunction_Stop

void R_KB2m_TKBOn1_DitheringFunction_Stop ( void );

Page 157: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 157 of 642Feb 01, 2018

Starts smooth start function for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_SmoothStartFunction_Start

void R_KB2m_TKBOn0_SmoothStartFunction_Start ( void );

Page 158: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 158 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends smooth start function for timer output TKBOn0.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn0_SmoothStartFunction_Stop

void R_KB2m_TKBOn0_SmoothStartFunction_Stop ( void );

Page 159: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 159 of 642Feb 01, 2018

Starts smooth start function for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_SmoothStartFunction_Start

void R_KB2m_TKBOn1_SmoothStartFunction_Start ( void );

Page 160: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 160 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends smooth start function for timer output TKBOn1.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_TKBOn1_SmoothStartFunction_Stop

void R_KB2m_TKBOn1_SmoothStartFunction_Stop ( void );

Page 161: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 161 of 642Feb 01, 2018

Enables batch overwriting of the compare register.

Remark The timing for batch-overwriting the content of the compare register is when a count value and a value set in the compare register are matched or an external trigger is generated after calling this API function.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_KB2m_Set_BatchOverwriteRequestOn

void R_KB2m_Set_BatchOverwriteRequestOn ( void );

Page 162: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 162 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.13 Real-time clock

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

Table 3.13 API Functions: [Real-time Clock]

API Function Name Function

R_RTC_Create Performs initialization necessary to control the real-time clock.

R_RTC_Create_UserInit Performs user-defined initialization relating to the real-time clock.

r_rtc_interrupt Performs processing in response to the real-time clock interrupt INTRTC.

R_RTC_Start Starts the count of the real-time clock (year, month, weekday, day, hour, minute, second).

R_RTC_Stop Ends the count of the real-time clock (year, month, weekday, day, hour, minute, second).

R_RTC_Set_PowerOff Halts the clock supplied to the real-time clock.

R_RTC_Set_HourSystem Sets the clock type (12-hour or 24-hour clock) of the real-time clock.

R_RTC_Set_CounterValue Sets the counter value of the real-time clock.

R_RTC_Set_CalendarCounterValue Sets the counter value of the real-time clock.(in the case of the calendar mode setting)

R_RTC_Set_BinaryCounterValue Sets the counter value of the real-time clock.(in the case of the binary mode setting)

R_RTC_Get_CounterValue Reads the counter value of the real-time clock.

R_RTC_Get_CalendarCounterValue Reads the counter value of the real-time clock.(in the case of the calen-dar mode setting)

R_RTC_Get_BinaryCounterValue Reads the counter value of the real-time clock.(in the case of the binary mode setting)

R_RTC_Set_ConstPeriodInterruptOn Sets the cycle of the interrupts INTRTC, then starts the cyclic interrupt function.

R_RTC_Set_ConstPeriodInterruptOff Ends the cyclic interrupt function.

r_rtc_callback_constperiod Performs processing in response to the cyclic interrupt INTRTC.

R_RTC_Set_AlarmOn Starts the alarm interrupt function.

R_RTC_Set_CalendarAlarmOn Starts the alarm interrupt function.(in the case of the calendar mode set-ting)

R_RTC_Set_BinaryAlarmOn Starts the alarm interrupt function.(in the case of the binary mode set-ting)

R_RTC_Set_AlarmOff Ends the alarm interrupt function.

R_RTC_Set_AlarmValue Sets the alarm conditions (weekday, hour, minute).

R_RTC_Set_CalendarAlarmValue Sets the alarm conditions (year, month, weekday, day, hour, minute, sec-ond).(in the case of the calendar mode setting)

R_RTC_Set_BinaryAlarmValue Sets the alarm conditions.(in the case of the binary mode setting)

R_RTC_Get_AlarmValue Reads the alarm conditions (weekday, hour, minute).

R_RTC_Get_CalendarAlarmValue Reads the alarm conditions (year, month, weekday, day, hour, minute, second).(in the case of the calendar mode setting)

Page 163: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 163 of 642Feb 01, 2018

R_RTC_Get_BinaryAlarmValue Reads the alarm conditions.(in the case of the binary mode setting)

r_rtc_callback_alarm Performs processing in response to the alarm interrupt INTRTC.

R_RTC_Set_RTC1HZOn Enables output of the correction clock (1 Hz) to the RTC1HZ pin.

R_RTC_Set_RTC1HZOff Disables output of the correction clock (1 Hz) to the RTC1HZ pin.

R_RTC_Set_RTCOUTOn Enables output of the RTCOUT.

R_RTC_Set_RTCOUTOff Disables output of the RTCOUT.

r_rtc_alarminterrupt Performs processing in response to the alarm interrupt INTRTCALM.

r_rtc_periodicinterrupt Performs processing in response to the periodic interrupt INTRTCPRD.

r_rtc_callback_periodic Performs processing in response to the cyclic interrupt INTRTC.

API Function Name Function

Page 164: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 164 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the real-time clock.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Create

void R_RTC_Create ( void );

Page 165: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 165 of 642Feb 01, 2018

Performs user-defined initialization relating to the real-time 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 166: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 166 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the real-time clock interrupt INTRTC.

Remark This API function is called as the interrupt process corresponding to the real-time clock interrupt INTRTC.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_rtc_interrupt

__interrupt static void r_rtc_interrupt ( void );

static void __near r_rtc_interrupt ( void );

Page 167: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 167 of 642Feb 01, 2018

Starts the count of the real-time clock (year, month, weekday, day, hour, minute, second).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Start

void R_RTC_Start ( void );

Page 168: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 168 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count of the real-time clock (year, month, weekday, day, hour, minute, second).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Stop

void R_RTC_Stop ( void );

Page 169: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 169 of 642Feb 01, 2018

Halts the clock supplied to the real-time clock.

Remarks 1. Calling this API function changes the real-time clock to reset status.For this reason, writes to the control registers after this API function is called are ignored.

Remarks 2. This API function stops the clock supply to the real-time clock, by operating the RTCEN bit of peripheral enable register n.For this reason, this API function also stops the clock supply to other peripheral devices sharing the RTCEN bit (e.g. interval timer).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_PowerOff

void R_RTC_Set_PowerOff ( void );

Page 170: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 170 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets the clock type (12-hour or 24-hour clock) of the real-time clock.

[Syntax]

[Argument(s)]

[Return value]

Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in the header file "r_cg_rtc.h" larger.

R_RTC_Set_HourSystem

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Set_HourSystem ( rtc_hour_system_t hour_system );

I/O Argument Description

I rtc_hour_system_t hour_system; Clock typeHOUR12: 12-hour clockHOUR24: 24-hour clock

Macro Description

MD_OK Normal completion

MD_BUSY1 Executing count process (before change to setting)

MD_BUSY2 Stopping count process (after change to setting)

MD_ARGERROR Invalid argument specification

Page 171: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 171 of 642Feb 01, 2018

Sets the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.

[Syntax]

[Argument(s)]

Remark Below is an example of the structure rtc_counter_value_t (counter value) for the real-time clock.

[Return value]

Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in the header file "r_cg_rtc.h" larger.

R_RTC_Set_CounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Set_CounterValue ( rtc_counter_value_t counter_write_val );

I/O Argument Description

I rtc_counter_value_t counter_write_val;

Counter value

typedef struct { uint8_t sec; /* Second */ uint8_t min; /* Minute */ uint8_t hour; /* Hour */ uint8_t day; /* Day */ uint8_t week; /* Weekday (0: Sunday, 6: Saturday) */ uint8_t month; /* Month */ uint16_t year; /* Year */} rtc_counter_value_t;

Macro Description

MD_OK Normal completion

MD_BUSY1 Executing count process (before change to setting)

MD_BUSY2 Stopping count process (after change to setting)

Page 172: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 172 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets the counter value of the real-time clock.(in the case of the calendar mode setting)

[Syntax]

[Argument(s)]

Remark See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.

[Return value]

Remark If MD_BUSY1 is returned, it may be because the counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in the header file "r_cg_rtc.h" larger.

R_RTC_Set_CalendarCounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Set_CalendarCounterValue ( rtc_counter_value_t counter_write_val );

I/O Argument Description

I rtc_counter_value_t counter_write_val;

Counter value

Macro Description

MD_OK Normal completion

MD_BUSY1 Executing count process (before change to setting)

Page 173: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 173 of 642Feb 01, 2018

Sets the counter value of the real-time clock.(in the case of the binary mode setting)

[Syntax]

[Argument(s)]

Remark See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.

[Return value]

Remark If MD_BUSY1 is returned, it may be because the counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in the header file "r_cg_rtc.h" larger.

R_RTC_Set_BinaryCounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Set_BinaryCounterValue ( uint32_t counter_write_val );

I/O Argument Description

I uint32_t counter_write_val;

Counter value

Macro Description

MD_OK Normal completion

MD_BUSY1 Executing count process (before change to setting)

Page 174: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 174 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.

[Syntax]

[Argument(s)]

Remark See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.

[Return value]

Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in the header file "r_cg_rtc.h" larger.

R_RTC_Get_CounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Get_CounterValue ( rtc_counter_value_t * const counter_read_val );

I/O Argument Description

O rtc_counter_value_t * const counter_read_val;

Pointer to structure in which to store the counter value being read

Macro Description

MD_OK Normal completion

MD_BUSY1 Executing count process (before reading)

MD_BUSY2 Stopping count process (after reading)

Page 175: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 175 of 642Feb 01, 2018

Reads the counter value of the real-time clock.(in the case of the calendar mode setting)

[Syntax]

[Argument(s)]

Remark See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.

[Return value]

R_RTC_Get_CalendarCounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Get_CalendarCounterValue ( rtc_counter_value_t * const counter_read_val );

I/O Argument Description

O rtc_counter_value_t * const counter_read_val;

Pointer to structure in which to store the counter value being read

Macro Description

MD_OK Normal completion

MD_ERROR Read failure

Page 176: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 176 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the counter value of the real-time clock.(in the case of the binary mode setting)

[Syntax]

[Argument(s)]

[Return value]

R_RTC_Get_BinaryCounterValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"MD_STATUS R_RTC_Get_BinaryCounterValue ( uint32_t * const counter_read_val );

I/O Argument Description

O uint32_t * const counter_read_val;

Pointer to structure in which to store the counter value being read

Macro Description

MD_OK Normal completion

MD_ERROR Read failure

Page 177: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 177 of 642Feb 01, 2018

Sets the cycle of the interrupts INTRTC, then starts the cyclic interrupt function.

[Syntax]

[Argument(s)]

[Return value]

R_RTC_Set_ConstPeriodInterruptOn

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

I/O Argument Description

I rtc_int_period_t period; Interrupt INTRTC cycleHALFSEC: 0.5 secondsONESEC: 1 secondONEMIN: 1 minuteONEHOUR: 1 hourONEDAY: 1 dayONEMONTH: 1 month

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 178: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 178 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the cyclic interrupt function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_ConstPeriodInterruptOff

void R_RTC_Set_ConstPeriodInterruptOff ( void );

Page 179: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 179 of 642Feb 01, 2018

Performs processing in response to the cyclic interrupt INTRTC.

Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the cyclic interrupt INTRTC.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_callback_constperiod

static void r_rtc_callback_constperiod ( void );

Page 180: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 180 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the alarm interrupt function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_AlarmOn

void R_RTC_Set_AlarmOn ( void );

Page 181: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 181 of 642Feb 01, 2018

Starts the alarm interrupt function.(in the case of the calendar mode setting)

[Syntax]

[Argument(s)]

Remark Below is shown the structure enb_set.

[Return value]

None.

R_RTC_Set_CalendarAlarmOn

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Set_CalendarAlarmOn ( uint8_t enb_set );

I/O Argument Description

I uint8_t enb_set; Alarm enable

3567 04 2 1

1: Sectond

1: Hour

1: Month1: Year

0: Fixed

1: Minute

1: Weekend1: Day

Page 182: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 182 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the alarm interrupt function.(in the case of the binary mode setting)

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_BinaryAlarmOn

void R_RTC_Set_BinaryAlarmOn ( void );

Page 183: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 183 of 642Feb 01, 2018

Ends the alarm interrupt function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_AlarmOff

void R_RTC_Set_AlarmOff ( void );

Page 184: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 184 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets the alarm conditions (weekday, hour, minute).

[Syntax]

[Argument(s)]

Remark Below is shown the structure rtc_alarm_value_t (alarm conditions).(The structure is different according to the device.)

- alarmws (Second)Below are shown the meanings of each bit of the structure member alarmws.

- alarmwm (Minute)Below are shown the meanings of each bit of the structure member alarmwm.

R_RTC_Set_AlarmValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Set_AlarmValue ( rtc_alarm_value_t alarm_val );

I/O Argument Description

I rtc_alarm_value_t alarm_val; Alarm conditions (weekday, hour, minute)

typedef struct { uint8_t sec; /* Second */ uint8_t min; /* Minute */ uint8_t hour; /* Hour */ uint8_t week; /* Weekday (0: Sunday, 6: Saturday) */ uint8_t day; /* Day */ uint8_t month; /* Month */ uint16_t year; /* Year */} rtc_alarm_value_t;

BCD code (second: digit 10)

0

BCD code (second: digit 1)

347

0: Fixed

BCD code (minute: digit 10)

0

BCD code (minute: digit 1)

347

0: Fixed

Page 185: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 185 of 642Feb 01, 2018

- alarmwh (Hour)Below are shown the meanings of each bit of the structure member alarmwh.If the real-time clock is set to the 12-hour clock, then bit 5 has the following meaning.

0: AM1: PM

- alarmww (Weekday)Below are shown the meanings of each bit of the structure member alarmww.

- alarmwd (Day)Below are shown the meanings of each bit of the structure member alarmwd.

- alarmwmn (Month)Below are shown the meanings of each bit of the structure member alarmwmn.

BCD code (hour: digit 10)BCD code (hour: digit 1)

567 034

00: Fixed

3567 04 2 1

1: Sunday

1: Tuesday

1: Friday1: Saturday

0: Fixed

1: Monday

1: Wednesday1: Thursday

BCD code (day: digit 10)BCD code (day: digit 1)

567 034

00: Fixed

7 6 0

BCD code (month: digit 1)

4 3

0: FixedBCD code (month: digit 10))

5

Page 186: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 186 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

- alarmwy (Year)Below are shown the meanings of each bit of the structure member alarmwmn.

[Return value]

None.

0

BCD code (year: digit 1)

4 37

BCD code (year: digit 10)

815

0: Fixed

Page 187: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 187 of 642Feb 01, 2018

Sets the alarm conditions (year, month, weekday, day, hour, minute, second).(in the case of the calendar mode setting)

[Syntax]

Remark See R_RTC_Set_AlarmValue for details about rtc_alarm_value_t (alarm conditions).

[Argument(s)]

[Return value]

None.

R_RTC_Set_CalendarAlarmValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Set_CalendarAlarmValue ( rtc_alarm_value_t alarm_val );

I/O Argument Description

I rtc_alarm_value_t alarm_val; Alarm conditions (second, minute, hour, weekday, day, month, year)

Page 188: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 188 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets the alarm conditions.(in the case of the binary mode setting)

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Set_BinaryAlarmValue

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

I/O Argument Description

I uint32_t alarm_enable; Alarm enable(Set the value to the Binary Counter Alarm Enable Register)

uint32_t alarm_val Alarm conditions (count value)(Set the value to the Binary Counter Alarm Register)

Page 189: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 189 of 642Feb 01, 2018

Reads the alarm conditions (weekday, hour, minute).

[Syntax]

Remark See R_RTC_Set_AlarmValue for details about rtc_alarm_value_t (alarm conditions).

[Argument(s)]

[Return value]

None.

R_RTC_Get_AlarmValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Get_AlarmValue ( rtc_alarm_value_t * const alarm_val );

I/O Argument Description

O rtc_alarm_value_t * const alarm_val;

Pointer to structure in which to store the conditions being read

Page 190: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 190 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the alarm conditions (year, month, weekday, day, hour, minute, second).(in the case of the calendar mode set-ting)

[Syntax]

Remark See R_RTC_Set_AlarmValue for details about rtc_alarm_value_t (alarm conditions).

[Argument(s)]

[Return value]

None.

R_RTC_Get_CalendarAlarmValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Get_CalendarAlarmValue ( rtc_alarm_value_t * const alarm_val );

I/O Argument Description

O rtc_alarm_value_t * const alarm_val;

Pointer to structure in which to store the conditions being read

Page 191: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 191 of 642Feb 01, 2018

Reads the alarm conditions (weekday, hour, minute).(in the case of the binary mode setting)

[Syntax]

[Argument(s)]

[Return value]

None.

R_RTC_Get_BinaryAlarmValue

#include "r_cg_macrodriver.h"#include "r_cg_rtc.h"void R_RTC_Get_BinaryAlarmValue ( uint32_t * const alarm_enable, uint32_t * constalarm_val );

I/O Argument Description

O uint32_t * const alarm_enable Pointer to structure in which to store the alarm enable value being read

O uint32_t * const alarm_val Pointer to structure in which to store the conditions being read

Page 192: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 192 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the alarm interrupt INTRTC.

Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the alarm interrupt INTRTC.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_callback_alarm

static void r_rtc_callback_alarm ( void );

Page 193: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 193 of 642Feb 01, 2018

Enables output of the correction clock (1 Hz) to the RTC1HZ pin.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_RTC1HZOn

void R_RTC_Set_RTC1HZOn ( void );

Page 194: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 194 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables output of the correction clock (1 Hz) to the RTC1HZ pin.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_RTC1HZOff

void R_RTC_Set_RTC1HZOff ( void );

Page 195: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 195 of 642Feb 01, 2018

Enables output of the RTCOUT.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_RTCOUTOn

void R_RTC_Set_RTCOUTOn ( void );

Page 196: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 196 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables output of the RTCOUT.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_RTC_Set_RTCOUTOff

void R_RTC_Set_RTCOUTOff ( void );

Page 197: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 197 of 642Feb 01, 2018

Performs processing in response to the alarm interrupt INTRTCALM.

Remark This API function is called as the interrupt process corresponding to the alarm interrupt INTRTCALM.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_rtc_alarminterrupt

__interrupt static void r_rtc_alarminterrupt ( void );

static void __near r_rtc_alarminterrupt ( void );

Page 198: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 198 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the periodic interrupt INTRTCPRD.

Remark This API function is called as the interrupt process corresponding to the periodic interrupt INTRTCPRD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_rtc_periodicinterrupt

__interrupt static void r_rtc_periodicinterrupt ( void );

static void __near r_rtc_periodicinterrupt ( void );

Page 199: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 199 of 642Feb 01, 2018

Performs processing in response to the cyclic interrupt INTRTC.

Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the cyclic interrupt INTRTC.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

r_rtc_callback_periodic

static void r_rtc_callback_periodic ( void );

Page 200: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 200 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.14 Subsystem clock frequency measurement circuit

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

Table 3.14 API Functions: [Subsystem Clock Frequency Measurement Circuit]

API Function Name Function

R_FMC_Create Performs initialization necessary to control the subsystem clock frequency measurement circuit.

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

r_fmc_interrupt Performs processing in response to the end of frequency measurement interrupt INTFM.

R_FMC_Start Starts measurement of the frequency that uses the subsystem clock fre-quency measurement circuit.

R_FMC_Stop Ends measurement of the frequency that uses the subsystem clock fre-quency measurement circuit.

R_FMC_Set_PowerOff Halts the clock supplied to the subsystem clock frequency measurement circuit.

Page 201: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 201 of 642Feb 01, 2018

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FMC_Create

void R_FMC_Create ( void );

Page 202: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 202 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FMC_Create_UserInit

void R_FMC_Create_UserInit ( void );

Page 203: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 203 of 642Feb 01, 2018

Performs processing in response to the end of frequency measurement interrupt INTFM.

Remark This API function is called as the interrupt process corresponding to the end of frequency measurement interrupt INTFM.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_fmc_interrupt

__interrupt static void r_fmc_interrupt ( void );

static void __near r_fmc_interrupt ( void );

Page 204: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 204 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts measurement of the frequency that uses the subsystem clock frequency measurement circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FMC_Start

void R_FMC_Start ( void );

Page 205: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 205 of 642Feb 01, 2018

Ends measurement of the frequency that uses the subsystem clock frequency measurement circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FMC_Stop

void R_FMC_Stop ( void );

Page 206: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 206 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the subsystem clock frequency measurement circuit.

Remark Calling this API function changes the subsystem clock frequency measurement circuit to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FMC_Set_PowerOff

void R_FMC_Set_PowerOff ( void );

Page 207: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 207 of 642Feb 01, 2018

3.2.15 12-bit interval timer

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

Table 3.15 API Functions: [12-Bit Interval Timer]

API Function Name Function

R_IT_Create Performs initialization necessary to control the 12-bit interval timer.

R_IT_Create_UserInit Performs user-defined initialization relating to the 12-bit interval timer.

r_it_interrupt Performs processing in response to the 12-bit interval timer interrupt INTIT.

R_IT_Start Starts the count of the 12-bit interval timer.

R_IT_Stop Ends the count of the 12-bit interval timer.

R_IT_Reset Reset the 12-bit interval timer.

R_IT_Set_PowerOff Halts the clock supplied to the 12-bit interval timer.

Page 208: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 208 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 12-bit interval timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Create

void R_IT_Create ( void );

Page 209: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 209 of 642Feb 01, 2018

Performs user-defined initialization relating to the 12-bit interval timer.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Create_UserInit

void R_IT_Create_UserInit ( void );

Page 210: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 210 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the 12-bit interval timer interrupt INTIT.

Remark This API function is called as the interrupt process corresponding to the 12-bit interval timer interrupt INTIT.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_it_interrupt

__interrupt static void r_it_interrupt ( void );

static void __near r_it_interrupt ( void );

Page 211: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 211 of 642Feb 01, 2018

Starts the count of the 12-bit interval timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Start

void R_IT_Start ( void );

Page 212: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 212 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count of the 12-bit interval timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Stop

void R_IT_Stop ( void );

Page 213: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 213 of 642Feb 01, 2018

Reset the 12-bit interval timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Reset

void R_IT_Reset ( void );

Page 214: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 214 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 12-bit interval timer.

Remarks 1. Calling this API function changes the 12-bit interval timer to reset status.For this reason, writes to the control registers after this API function is called are ignored.

Remarks 2. This API function stops the clock supply to the 12-bit interval timer, by operating the RTCEN bit of periph-eral enable register n.For this reason, this API function also stops the clock supply to other peripheral devices sharing the RTCEN bit (e.g. real-timer clock).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IT_Set_PowerOff

void R_IT_Set_PowerOff ( void );

Page 215: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 215 of 642Feb 01, 2018

3.2.16 8-bit interval timer

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

Table 3.16 API Functions: [8-Bit Interval Timer]

API Function Name Function

R_IT8bitm_Channeln_Create Performs initialization necessary to control the 8-bit interval timer.

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

r_it8bitm_channeln_interrupt Performs processing in response to the 8-bit interval timer interrupt

INTITn0 or INTITn1.

R_IT8bitm_Channeln_Start Starts the count of the 8-bit interval timer.

R_IT8bitm_Channeln_Stop Ends the count of the 8-bit interval timer.

R_IT8bitm_Channeln_Set_PowerOff Halts the clock supplied to the 8-bit interval timer.

R_IT8bitm_Set_PowerOff Halts the clock supplied to the 8-bit interval timer.

Page 216: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 216 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 8-bit interval timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Channeln_Create

void R_IT8bitm_Channeln_Create ( void );

Page 217: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 217 of 642Feb 01, 2018

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

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

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Channeln_Create_UserInit

void R_IT8bitm_Channeln_Create_UserInit ( void );

Page 218: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 218 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the 8-bit interval timer interrupt INTITn0 or INTITn1.

Remark This API function is called as the interrupt process corresponding to the 8-bit interval timer interrupt INTITn0 or INTITn1.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_it8bitm_channeln_interrupt

__interrupt static void r_it8bitm_channeln_interrupt ( void );

static void __near r_it8bitm_channeln_interrupt ( void );

Page 219: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 219 of 642Feb 01, 2018

Starts the count of the 8-bit interval timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Channeln_Start

void R_IT8bitm_Channeln_Start ( void );

Page 220: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 220 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count of the 8-bit interval timer.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Channeln_Stop

void R_IT8bitm_Channeln_Stop ( void );

Page 221: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 221 of 642Feb 01, 2018

Halts the clock supplied to the 8-bit interval timer.

Remark Calling this API function changes the 8-bit interval timer to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Channeln_Set_PowerOff

void R_IT8bitm_Channeln_Set_PowerOff ( void );

Page 222: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 222 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 8-bit interval timer.

Remark Calling this API function changes the 8-bit interval timer to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_IT8bitm_Set_PowerOff

void R_IT8bitm_Set_PowerOff ( void );

Page 223: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 223 of 642Feb 01, 2018

3.2.17 16-bit wakeup timer

Below is a list of API functions output by the Code Generator for 16-bit wakeup timer (WUTM) use.

Table 3.17 API Functions: [16-bit Wakeup Timer]

API Function Name Function

R_WUTM_Create Performs initialization necessary to control the 16-bit wakeup timer.

R_WUTM_Create_UserInit Performs user-defined initialization relating to the 16-bit wakeup timer.

r_wutm_interrupt Performs processing in response to the timer interrupt.

R_WUTM_Start Starts the count for 16-bit wakeup timer.

R_WUTM_Stop Ends the count for 16-bit wakeup timer.

R_WUTM_Set_PowerOff Halts the clock supplied to the 16-bit wakeup timer.

Page 224: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 224 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 16-bit wakeup timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WUTM_Create

void R_WUTM_Create ( void );

Page 225: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 225 of 642Feb 01, 2018

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

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WUTM_Create_UserInit

void R_WUTM_Create_UserInit ( void );

Page 226: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 226 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the timer interrupt.

Remark This API function is called as the interrupt process corresponding to the timer interrupt.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_wutm_interrupt

__interrupt static void r_wutm_interrupt ( void );

static void __near r_wutm_interrupt ( void );

Page 227: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 227 of 642Feb 01, 2018

Starts the count for 16-bit wakeup timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WUTM_Start

void R_WUTM_Start ( void );

Page 228: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 228 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the count for 16-bit wakeup timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WUTM_Stop

void R_WUTM_Stop ( void );

Page 229: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 229 of 642Feb 01, 2018

Halts the clock supplied to the 16-bit wakeup timer.

Remark Calling this API function changes the 16-bit wakeup timer to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WUTM_Set_PowerOff

void R_WUTM_Set_PowerOff ( void );

Page 230: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 230 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.18 Clock output/buzzer output controller

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

Table 3.18 API Functions: [Clock Output/Buzzer Output Controller]

API Function Name Function

R_PCLBUZn_Create Performs initialization necessary to control the clock/buzzer output controller.

R_PCLBUZn_Create_UserInit Performs user-defined initialization relating to the clock/buzzer output controller.

R_PCLBUZn_Start Starts clock/buzzer output.

R_PCLBUZn_Stop Ends clock/buzzer output.

R_PCLBUZ_Set_PowerOff Halts the clock supplied to the clock/buzzer output controller.

Page 231: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 231 of 642Feb 01, 2018

Performs initialization necessary to control the clock/buzzer output controller.

[Syntax]

Remark n is the output pin.

[Argument(s)]

None.

[Return value]

None.

R_PCLBUZn_Create

void R_PCLBUZn_Create ( void );

Page 232: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 232 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the clock/buzzer output controller.

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

[Syntax]

Remark n is the output pin.

[Argument(s)]

None.

[Return value]

None.

R_PCLBUZn_Create_UserInit

void R_PCLBUZn_Create_UserInit ( void );

Page 233: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 233 of 642Feb 01, 2018

Starts clock/buzzer output.

[Syntax]

Remark n is the output pin.

[Argument(s)]

None.

[Return value]

None.

R_PCLBUZn_Start

void R_PCLBUZn_Start ( void );

Page 234: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 234 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends clock/buzzer output.

[Syntax]

Remark n is the output pin.

[Argument(s)]

None.

[Return value]

None.

R_PCLBUZn_Stop

void R_PCLBUZn_Stop ( void );

Page 235: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 235 of 642Feb 01, 2018

Halts the clock supplied to the clock/buzzer output controller.

Remarks 1. Calling this API function changes the clock/buzzer output controller to reset status.For this reason, writes to the control registers after this API function is called are ignored.

Remarks 2. This API function stops the clock supply to the clock/buzzer output controller, by operating the RTCEN bit of peripheral enable register n.For this reason, this API function also stops the clock supply to other peripheral devices sharing the RTCEN bit (e.g. real-time clock).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PCLBUZ_Set_PowerOff

void R_PCLBUZ_Set_PowerOff ( void );

Page 236: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 236 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.19 Watchdog timer

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

Table 3.19 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_interrupt Performs processing in response to the interval interrupt INTWDTI.

R_WDT_Restart Clears the watchdog timer counter and resumes counting.

Page 237: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 237 of 642Feb 01, 2018

Performs initialization necessary to control the watchdog timer.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_WDT_Create

void R_WDT_Create ( void );

Page 238: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 238 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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 239: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 239 of 642Feb 01, 2018

Performs processing in response to the interval interrupt INTWDTI.

Remark This API function is called as the interrupt process corresponding to the interval interrupt INTWDTI.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_wdt_interrupt

__interrupt static void r_wdt_interrupt ( void );

static void __near r_wdt_interrupt ( void );

Page 240: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 240 of 642Feb 01, 2018

e2 studio 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 241: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 241 of 642Feb 01, 2018

3.2.20 24-bit DS A/D converter with programmable gain instrumentation amplifier

Below is a list of API functions output by the Code Generator for 24-bit ΔΣ A/D converter with programmable gain instru-mentation amplifier use.

Table 3.20 API Functions: [24-bit ΔΣ A/D converter with programmable gain instrumentation amplifier]

API Function Name Function

R_PGA_DSAD_Create Performs initialization necessary to control the 24-bit ΔΣ A/D converter with programmable gain instrumentation amplifier.

R_PGA_DSAD_Create_UserInit Performs user-defined initialization relating to the 24-bit ΔΣ A/D con-verter with programmable gain instrumentation amplifier.

r_pga_dsad_interrupt_conversion Performs processing in response to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

r_pga_dsad_interrupt_scan Performs processing in response to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

R_PGA_DSAD_Start Starts A/D conversion.

R_PGA_DSAD_Stop Ends A/D conversion.

R_PGA_DSAD_Set_PowerOff Halts the clock supplied to the 24-bit ΔΣ A/D converter with programma-ble gain instrumentation amplifier.

R_PGA_DSAD_Get_AverageResult Reads the results of A/D conversion.(mean value)

R_PGA_DSAD_Get_Result Reads the results of A/D conversion.

R_PGA_DSAD_CAMP_OffsetTrimming Connects the configurable amplifier to the 24-bit ΔΣ A/D converter and trims the offset.

r_pga_dsad_conversion_interrupt Performs processing in response to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

r_pga_dsad_scan_interrupt Performs processing in response to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

Page 242: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 242 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 24-bit ΔΣ A/D converter with programmable gain instrumentation amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_Create

void R_PGA_DSAD_Create ( void );

Page 243: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 243 of 642Feb 01, 2018

Performs user-defined initialization relating to the 24-bit ΔΣ A/D converter with programmable gain instrumentation amplifier.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_Create_UserInit

void R_PGA_DSAD_Create_UserInit ( void );

Page 244: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 244 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

Remark This API function is called as the interrupt process corresponding to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

[Syntax]

CA78K0R Compiler_conversion

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_pga_dsad_interrupt_conversion

__interrupt static void r_pga_dsad_interrupt_conversion ( void );

static void __near r_pga_dsad_interrupt_conversion ( void );

Page 245: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 245 of 642Feb 01, 2018

Performs processing in response to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

Remark This API function is called as the interrupt process corresponding to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

[Syntax]

CA78K0R Compiler_conversion

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_pga_dsad_interrupt_scan

__interrupt static void r_pga_dsad_interrupt_scan ( void );

static void __near r_pga_dsad_interrupt_scan ( void );

Page 246: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 246 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts A/D conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_Start

void R_PGA_DSAD_Start ( void );

Page 247: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 247 of 642Feb 01, 2018

Ends A/D conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_Stop

void R_PGA_DSAD_Stop ( void );

Page 248: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 248 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 24-bit ΔΣ A/D converter with programmable gain instrumentation amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_Set_PowerOff

void R_PGA_DSAD_Set_PowerOff ( void );

Page 249: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 249 of 642Feb 01, 2018

Reads the average results of A/D conversion.(mean value)

[Syntax]

[Argument(s)]

[Return value]

None.

R_PGA_DSAD_Get_AverageResult

#include "r_cg_macrodriver.h"void R_PGA_DSAD_Get_AverageResult ( uint16_t * const bufferH, uint16_t * const bufferL );

I/O Argument Description

O uint16_t * const bufferH; Pointer to area in which to store read results of A/D conversion(DSADMVM resister and DSADMVH resister)

O uint16_t * const bufferL; Pointer to area in which to store read results of A/D conversion(DSADMVC resister and DSADMVL resister)

Page 250: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 250 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the results of A/D conversion.

[Syntax]

[Argument(s)]

[Return value]

None.

R_PGA_DSAD_Get_Result

#include "r_cg_macrodriver.h"void R_PGA_DSAD_Get_Result ( uint16_t * const bufferH, uint16_t * const bufferL );

I/O Argument Description

O uint16_t * const bufferH; Pointer to area in which to store the results of A/D conversion(DSADCRM resister and DSADCRH resister)

O uint16_t * const bufferL; Pointer to area in which to store the results of A/D conversion(DSADCRC resister and DSADCRL resister)

Page 251: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 251 of 642Feb 01, 2018

Connects the configurable amplifier to the 24-bit ΔΣ A/D converter and trims the offset.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_DSAD_CAMP_OffsetTrimming

void R_PGA_DSAD_CAMP_OffsetTrimming ( void );

Page 252: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 252 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

Remark This API function is called as the interrupt process corresponding to the 24-bit ΔΣ A/D conversion end interrupt INTDSAD.

[Syntax]

CA78K0R Compiler_conversion

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_pga_dsad_conversion_interrupt

__interrupt static void r_pga_dsad_conversion_interrupt ( void );

static void __near r_pga_dsad_conversion_interrupt ( void );

Page 253: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 253 of 642Feb 01, 2018

Performs processing in response to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

Remark This API function is called as the interrupt process corresponding to the 24-bit ΔΣ A/D scan end interrupt INTDSADS.

[Syntax]

CA78K0R Compiler_conversion

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_pga_dsad_scan_interrupt

__interrupt static void r_pga_dsad_scan_interrupt ( void );

static void __near r_pga_dsad_scan_interrupt ( void );

Page 254: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 254 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.21 A/D converter

Below is a list of API functions output by the Code Generator for A/D converter use.

Table 3.21 API Functions: [A/D Converter]

API Function Name Function

R_ADC_Create Performs initialization necessary to control the A/D converter.

R_ADC_Create_UserInit Performs user-defined initialization relating to the A/D converter.

r_adc_interrupt Performs processing in response to the A/D conversion end interrupt INTAD.

R_ADC_Set_OperationOn Enables operation of voltage converter.

R_ADC_Set_OperationOff Disables operation of voltage converter.

R_ADC_Start Starts A/D conversion.

R_ADC_Stop Ends A/D conversion.

R_ADC_Reset Reset A/D conversion.

R_ADC_Set_PowerOff Halts the clock supplied to the A/D converter.

R_ADC_Set_ADChannel Configures the analog voltage input pin for A/D conversion.

R_ADC_Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode.

R_ADC_Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode.

R_ADC_Set_TestChannel Sets the operation mode of A/D converter.

R_ADC_Get_Result Reads the results of A/D conversion (10 bits).

R_ADC_Get_Result_8bit Reads the results of A/D conversion (8 bits; most significant 8 bits of 10-bit resolution).

Page 255: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 255 of 642Feb 01, 2018

Performs initialization necessary to control the A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Create

void R_ADC_Create ( void );

Page 256: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 256 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the A/D converter.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Create_UserInit

void R_ADC_Create_UserInit ( void );

Page 257: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 257 of 642Feb 01, 2018

Performs processing in response to the A/D conversion end interrupt INTAD.

Remark This API function is called as the interrupt process corresponding to the A/D conversion end interrupt INTAD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_adc_interrupt

__interrupt static void r_adc_interrupt ( void );

static void __near r_adc_interrupt ( void );

Page 258: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 258 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of voltage converter.

Remarks 1. About 1 microsecond of stabilization time is required when changing the voltage converter from operation stopped to operation enabled status.Consequently, about 1 micro second must be left free between the call to this API function and the call to R_ADC_Start.

Remarks 2. On the [A/D Converter], in the [Comparator operation setting] area, if "Operation" is selected, then the voltage converter will be switched to "always on".There is thus no need to call this API function in this case.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Set_OperationOn

void R_ADC_Set_OperationOn ( void );

Page 259: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 259 of 642Feb 01, 2018

Disables operation of voltage converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Set_OperationOff

void R_ADC_Set_OperationOff ( void );

Page 260: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 260 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts A/D conversion.

Remark About 1 micro second of stabilization time is required when changing the voltage converter from opera-tion stopped to operation enabled status.Consequently, about 1 micro second must be left free between the call to R_ADC_Set_OperationOn and the call to this API function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Start

void R_ADC_Start ( void );

Page 261: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 261 of 642Feb 01, 2018

Ends A/D conversion.

Remark The voltage converter continues to operate after the process of this API function completes.Consequently, to stop the operation of the voltage converter, you must call R_ADC_Set_OperationOff after the process of this API function completes.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Stop

void R_ADC_Stop ( void );

Page 262: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 262 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset A/D conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Reset

void R_ADC_Reset ( void );

Page 263: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 263 of 642Feb 01, 2018

Halts the clock supplied to the A/D converter.

Remark Calling this API function changes the A/D converter to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Set_PowerOff

void R_ADC_Set_PowerOff ( void );

Page 264: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 264 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Configures the analog voltage input pin for A/D conversion.

Remark The value specified in argument channel is set to analog input channel specification register (ADS).

[Syntax]

[Argument(s)]

Remark See the header file r_cg_adc.h for details about the analog voltage input pin ADCHANNELn.

[Return value]

R_ADC_Set_ADChannel

#include "r_cg_macrodriver.h"#include "r_cg_adc.h"MD_STATUS R_ADC_Set_ADChannel ( ad_channel_t channel );

I/O Argument Description

I ad_channel_t channel; Analog voltage input pinADCHANNELn: Input pin

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 265: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 265 of 642Feb 01, 2018

Enables the switch from STOP mode to SNOOZE mode.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Set_SnoozeOn

void R_ADC_Set_SnoozeOn ( void );

Page 266: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 266 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables the switch from STOP mode to SNOOZE mode.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ADC_Set_SnoozeOff

void R_ADC_Set_SnoozeOff ( void );

Page 267: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 267 of 642Feb 01, 2018

Sets the operation mode of A/D converter.

[Syntax]

[Argument(s)]

[Return value]

R_ADC_Set_TestChannel

#include "r_cg_macrodriver.h"#include "r_cg_adc.h"MD_STATUS R_ADC_Set_TestChannel ( test_channel_t channel );

I/O Argument Description

I test_channel_t channel; Operation mode of A/D converterADNORMALINPUT: Normal mode (Normal A/D conver-sion)ADAVREFM: Test mode (AVREFM input)ADAVREFP: Test mode (AVREFP input)

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 268: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 268 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the results of A/D conversion (10 bits).

[Syntax]

[Argument(s)]

[Return value]

None.

R_ADC_Get_Result

#include "r_cg_macrodriver.h"void R_ADC_Get_Result ( uint16_t * const buffer );

I/O Argument Description

O uint16_t * const buffer; Pointer to area in which to store read results of A/D conversion

Page 269: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 269 of 642Feb 01, 2018

Reads the results of A/D conversion (8 bits; most significant 8 bits of 10-bit resolution).

[Syntax]

[Argument(s)]

Remark Below is an example of the results of A/D conversion to be stored in buffer.

[Return value]

None.

R_ADC_Get_Result_8bit

#include "r_cg_macrodriver.h"void R_ADC_Get_Result_8bit ( uint8_t * const buffer );

I/O Argument Description

O uint8_t * const buffer; Pointer to area in which to store the results of A/D conversion

15 8 7 0B1B2B3B4B5B6B7B8B10 B9

Results of A/D conversion to be stored in buffer

Page 270: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 270 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.22 Configurable amplifier

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

Table 3.22 API Functions: [Configurable amplifier]

API Function Name Function

R_CAMP_Create Performs initialization necessary to control the configurable amplifier.

R_CAMP_Create_UserInit Performs user-defined initialization relating to the configurableamplifier.

R_CAMPn_Start Turns on the power of the configurable amplifier(AMPn).

R_CAMPn_Stop Turns off the power of the configurable amplifier(AMPn).

R_CAMP_Set_PowerOff Halts the clock supplied to the configurable amplifier.

Page 271: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 271 of 642Feb 01, 2018

Performs initialization necessary to control the configurable amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAMP_Create

void R_CAMP_Create ( void );

Page 272: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 272 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the configurable amplifier.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAMP_Create_UserInit

void R_CAMP_Create_UserInit ( void );

Page 273: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 273 of 642Feb 01, 2018

Turns on the power of the configurable amplifier(AMPn).

[Syntax]

Remark n is the channel number.ye

[Argument(s)]

None.

[Return value]

None.

R_CAMPn_Start

void R_CAMPn_Start ( void );

Page 274: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 274 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Turns off the power of the configurable amplifier(AMPn).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CAMPn_Stop

void R_CAMPn_Stop ( void );

Page 275: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 275 of 642Feb 01, 2018

Halts the clock supplied to the configurable amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_CAMP_Set_PowerOff

void R_CAMP_Set_PowerOff ( void );

Page 276: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 276 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.23 Temperature sensor

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

Table 3.23 API Functions: [Temperature Sensor]

API Function Name Function

R_TMPS_Create Performs initialization necessary to control the temperature sensor.

R_TMPS_Create_UserInit Performs user-defined initialization relating to the temperature sensor.

R_TMPS_Start Starts measurement of the temperature that uses the temperature sen-sor.

R_TMPS_Stop Ends measurement of the temperature that uses the temperature sen-sor.

R_TMPS_Reset Reset the temperature sensor.

R_TMPS_Set_PowerOff Halts the clock supplied to the temperature sensor.

Page 277: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 277 of 642Feb 01, 2018

Performs initialization necessary to control the temperature sensor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Create

void R_TMPS_Create ( void );

Page 278: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 278 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the temperature sensor.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Create_UserInit

void R_TMPS_Create_UserInit ( void );

Page 279: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 279 of 642Feb 01, 2018

Starts measurement of the temperature that uses the temperature sensor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Start

void R_TMPS_Start ( void );

Page 280: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 280 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends measurement of the temperature that uses the temperature sensor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Stop

void R_TMPS_Stop ( void );

Page 281: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 281 of 642Feb 01, 2018

Reset the temperature sensor.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Reset

void R_TMPS_Reset ( void );

Page 282: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 282 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the temperature sensor.

Remark Calling this API function changes the temperature sensor to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_TMPS_Set_PowerOff

void R_TMPS_Set_PowerOff ( void );

Page 283: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 283 of 642Feb 01, 2018

3.2.24 24-bitDS A/D converter

Below is a list of API functions output by the Code Generator for 24-bit A/D converter use.

Table 3.24 API Functions: [24-bit A/D Converter]

API Function Name Function

R_DSADC_Create Performs initialization necessary to control the 24-bit A/D converter.

R_DSADC_Create_UserInit Performs user-defined initialization relating to the 24-bit A/D con-verter.

r_dsadc_interrupt Performs processing in response to the A/D conversion end interrupt INTDSAD.

r_dsadzcn_interrupt Performs processing in response to the zero-cross detection interrupt INTDSADZCn.

R_DSADC_Set_OperationOn Enables operation of 24-bit A/D converter.

R_DSADC_Set_OperationOff Disables operation of 24-bit A/D converter.

R_DSADC_Start Starts A/D conversion.

R_DSADC_Stop Ends A/D conversion.

R_DSADC_Reset Reset the 24-bit A/D converter.

R_DSADC_Set_PowerOff Performs electric charge reset for the 24-bit A/D converter.

R_DSADC_Channeln_Get_Result Reads the results of A/D conversion (24 bits).

R_DSADC_Channeln_Get_Result_16bit Reads the results of A/D conversion (16 bits; most significant 16 bits of 24-bit resolution).

Page 284: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 284 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the 24-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Create

void R_DSADC_Create ( void );

Page 285: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 285 of 642Feb 01, 2018

Performs user-defined initialization relating to the 24-bit A/D converter.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Create_UserInit

void R_DSADC_Create_UserInit ( void );

Page 286: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 286 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the A/D conversion end interrupt INTDSAD.

Remark This API function is called as the interrupt process corresponding to the A/D conversion end interrupt INTDSAD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_dsadc_interrupt

__interrupt static void r_dsadc_interrupt ( void );

static void __near r_dsadc_interrupt ( void );

Page 287: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 287 of 642Feb 01, 2018

Performs processing in response to the zero-cross detection interrupt INTDSADZCn.

Remark This API function is called as the interrupt process corresponding to the zero-cross detection interrupt INTDSADZCn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_dsadzcn_interrupt

__interrupt static void r_dsadzcn_interrupt ( void );

static void __near r_dsadzcn_interrupt ( void );

Page 288: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 288 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of 24-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Set_OperationOn

void R_DSADC_Set_OperationOn ( void );

Page 289: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 289 of 642Feb 01, 2018

Disables operation of 24-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Set_OperationOff

void R_DSADC_Set_OperationOff ( void );

Page 290: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 290 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts A/D conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Start

void R_DSADC_Start ( void );

Page 291: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 291 of 642Feb 01, 2018

Ends A/D conversion.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Stop

void R_DSADC_Stop ( void );

Page 292: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 292 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset the 24-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Reset

void R_DSADC_Reset ( void );

Page 293: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 293 of 642Feb 01, 2018

Performs electric charge reset for the 24-bit A/D converter.

Remark About 1.4 microseconds of stabilization time is required when electric charge reset is performed for the 24-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DSADC_Set_PowerOff

void R_DSADC_Set_PowerOff ( void );

Page 294: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 294 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the results of A/D conversion (24 bits).

Remark The result of A/D conversion (24 bits) by this API function must be read within the maximum pending time of the A/D conversion result register n after A/D conversion end interrupt INTDSAD is generated.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_DSADC_Channeln_Get_Result

#include "r_cg_macrodriver.h"void R_DSADC_Channeln_Get_Result ( uint32_t * const buffer );

I/O Argument Description

O uint32_t * const buffer; Pointer to area in which to store read results of A/D conversion

Page 295: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 295 of 642Feb 01, 2018

Reads the results of A/D conversion (16 bits; most significant 16 bits of 24-bit resolution).

Remark The result of A/D conversion by this API function must be read within the maximum pending time of the A/D conversion result register n after A/D conversion end interrupt INTDSAD is generated.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_DSADC_Channeln_Get_Result_16bit

#include "r_cg_macrodriver.h"void R_DSADC_Channeln_Get_Result_16bit ( uint16_t * const buffer );

I/O Argument Description

O uint16_t * const buffer; Pointer to area in which to store the results of A/D conversion

Page 296: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 296 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.25 D/A converter

Below is a list of API functions output by the Code Generator for D/A converter use.

Table 3.25 API Functions: [D/A Converter]

API Function Name Function

R_DAC_Create Performs initialization necessary to control the D/A converter.

R_DAC_Create_UserInit Performs user-defined initialization relating to the D/A converter.

R_DACn_Start Starts D/A conversion.

R_DACn_Stop Ends D/A conversion.

R_DAC_Set_PowerOff Halts the clock supplied to the D/A converter.

R_DACn_Set_ConversionValue Sets the analog voltage output to the ANOn pin.

R_DAC_Change_OutputVoltage_8bit

Changes the output voltage of D/A converter.(8bit mode)

R_DAC_Change_OutputVoltage Changes the output voltage of D/A converter.(12bit mode)

R_DACn_Create Performs initialization necessary to control the D/A converter.

R_DAC_Reset Reset the D/A converter.

R_DACn_Create_UserInit Performs user-defined initialization relating to the D/A converter.

Page 297: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 297 of 642Feb 01, 2018

Performs initialization necessary to control the D/A converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DAC_Create

void R_DAC_Create ( void );

Page 298: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 298 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the D/A converter.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DAC_Create_UserInit

void R_DAC_Create_UserInit ( void );

Page 299: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 299 of 642Feb 01, 2018

Starts D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DACn_Start

void R_DACn_Start ( void );

Page 300: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 300 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DACn_Stop

void R_DACn_Stop ( void );

Page 301: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 301 of 642Feb 01, 2018

Halts the clock supplied to the D/A converter.

Remark Calling this API function changes the D/A converter to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DAC_Set_PowerOff

void R_DAC_Set_PowerOff ( void );

Page 302: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 302 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets the analog voltage output to the ANOn pin.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_DACn_Set_ConversionValue

#include "r_cg_macrodriver.h"void R_DACn_Set_ConversionValue ( uint8_t reg_value );

I/O Argument Description

I uint8_t reg_value; D/A conversion value (0x0 to 0xFF)

Page 303: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 303 of 642Feb 01, 2018

Changes the output voltage of D/A converter.(8bit mode)

[Syntax]

[Argument(s)]

[Return value]

None.

R_DAC_Change_OutputVoltage_8bit

#include "r_cg_macrodriver.h"void R_DAC_Change_OutputVoltage_8bit ( uint8_t outputVoltage );

I/O Argument Description

I uint8_t outputVoltage; output Voltage (Low 8bit)

Page 304: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 304 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Changes the output voltage of D/A converter.(12bit mode)

[Syntax]

[Argument(s)]

[Return value]

None.

R_DAC_Change_OutputVoltage

#include "r_cg_macrodriver.h"void R_DAC_Change_OutputVoltage ( uint16_t outputVoltage );

I/O Argument Description

I uint16_t outputVoltage; output Voltage (Low 12bit)

Page 305: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 305 of 642Feb 01, 2018

Performs initialization necessary to control the D/A converter.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DACn_Create

#include "r_cg_macrodriver.h"void R_DACn_Create ( void );

Page 306: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 306 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset the D/A converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DAC_Reset

void R_DAC_Reset ( void );

Page 307: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 307 of 642Feb 01, 2018

Performs user-defined initialization relating to the D/A converter.

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DACn_Create_UserInit

void R_DACn_Create_UserInit ( void );

Page 308: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 308 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.26 Programmable gain amplifier

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

Table 3.26 API Functions: [Programmable Gain Amplifier]

API Function Name Function

R_PGA_Create Performs initialization necessary to control the programmable gain amplifier.

R_PGA_Create_UserInit Performs user-defined initialization relating to the programmable gain amplifier.

R_PGA_Start Starts the operation of programmable gain amplifier.

R_PGA_Stop Ends the operation of programmable gain amplifier.

R_PGA_Reset Reset the programmable gain amplifier.

R_PGA_Set_PowerOff Halts the clock supplied to the programmable gain amplifier.

Page 309: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 309 of 642Feb 01, 2018

Performs initialization necessary to control the programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Create

void R_PGA_Create ( void );

Page 310: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 310 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the programmable gain amplifier.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Create_UserInit

void R_PGA_Create_UserInit ( void );

Page 311: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 311 of 642Feb 01, 2018

Starts the operation of programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Start

void R_PGA_Start ( void );

Page 312: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 312 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends the operation of programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Stop

void R_PGA_Stop ( void );

Page 313: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 313 of 642Feb 01, 2018

Reset the operation of programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Reset

void R_PGA_Reset ( void );

Page 314: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 314 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the programmable gain amplifier.

Remark Calling this API function changes the comparator to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Set_PowerOff

void R_PGA_Set_PowerOff ( void );

Page 315: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 315 of 642Feb 01, 2018

3.2.27 Comparator

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

Table 3.27 API Functions: [Comparator]

API Function Name Function

R_COMP_Create Performs initialization necessary to control the comparator.

R_COMP_Create_UserInit Performs user-defined initialization relating to the comparator.

r_compn_interrupt Performs processing in response to the comparator interrupt INTCMPn.

R_COMPn_Start Begins comparison of reference input voltage and analog input volt-age.

R_COMPn_Stop Stops comparison of reference input voltage and analog input voltage.

R_COMP_Reset Reset the comparator.

R_COMP_Set_PowerOff Halts the clock supplied to the comparator.

Page 316: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 316 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the comparator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMP_Create

void R_COMP_Create ( void );

Page 317: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 317 of 642Feb 01, 2018

Performs user-defined initialization relating to the comparator.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMP_Create_UserInit

void R_COMP_Create_UserInit ( void );

Page 318: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 318 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the comparator interrupt INTCMPn.

Remark This API function is called as the interrupt process corresponding to the comparator interrupt INTCMPn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_compn_interrupt

__interrupt static void r_compn_interrupt ( void );

static void __near r_compn_interrupt ( void );

Page 319: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 319 of 642Feb 01, 2018

Begins comparison of reference input voltage and analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_COMPn_Start

void R_COMPn_Start ( void );

Page 320: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 320 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Stops comparison of reference input voltage and analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_COMPn_Stop

void R_COMPn_Stop ( void );

Page 321: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 321 of 642Feb 01, 2018

Reset the comparator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMP_Reset

void R_COMP_Reset ( void );

Page 322: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 322 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the comparator.

Remark Calling this API function changes the comparator to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMP_Set_PowerOff

void R_COMP_Set_PowerOff ( void );

Page 323: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 323 of 642Feb 01, 2018

3.2.28 Comparator/ProgrammableGainAmplifier

Below is a list of API functions output by the Code Generator for comparator/programmable gain amplifier use.

Table 3.28 API Functions: [Comparator/ProgrammableGainAmplifier]

API Function Name Function

R_COMPPGA_Create Performs initialization necessary to control the comparator/program-mable gain amplifier.

R_COMPPGA_Set_PowerOff Halts the clock supplied to the comparator/programmable gain ampli-fier.

R_COMPPGA_Create_UserInit Performs user-defined initialization relating to the comparator/pro-grammable gain amplifier.

r_compn_interrupt Performs processing in response to the comparator interrupt INTCMPn.

R_COMPn_Start Begins comparison of reference input voltage and analog input volt-age.

R_COMPn_Stop Stops comparison of reference input voltage and analog input voltage.

R_PGA_Start Starts the operation of programmable gain amplifier.

R_PGA_Stop Ends the operation of programmable gain amplifier.

R_PWMOPT_Start Supplies the clock to the 6-phase PWM option.In addition, sets the operation mode of the 6-phase PWM option.

R_PWMOPT_Stop Halts the clock supplied to the 6-phase PWM option.

Page 324: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 324 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the comparator/programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMPPGA_Create

void R_COMPPGA_Create ( void );

Page 325: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 325 of 642Feb 01, 2018

Halts the clock supplied to the comparator/programmable gain amplifier.

Remark Calling this API function changes the comparator/programmable gain amplifier to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMPPGA_Set_PowerOff

void R_COMPPGA_Set_PowerOff ( void );

Page 326: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 326 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the comparator/programmable gain amplifier.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_COMPPGA_Create_UserInit

void R_COMPPGA_Create_UserInit ( void );

Page 327: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 327 of 642Feb 01, 2018

Performs processing in response to the comparator interrupt INTCMPn.

Remark This API function is called as the interrupt process corresponding to the comparator interrupt INTCMPn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_compn_interrupt

__interrupt static void r_compn_interrupt ( void );

static void __near r_compn_interrupt ( void );

Page 328: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 328 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Begins comparison of reference input voltage and analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_COMPn_Start

void R_COMPn_Start ( void );

Page 329: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 329 of 642Feb 01, 2018

Stops comparison of reference input voltage and analog input voltage.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_COMPn_Stop

void R_COMPn_Stop ( void );

Page 330: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 330 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the operation of programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Start

void R_PGA_Start ( void );

Page 331: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 331 of 642Feb 01, 2018

Ends the operation of programmable gain amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA_Stop

void R_PGA_Stop ( void );

Page 332: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 332 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Supplies the clock to the 6-phase PWM option.In addition, sets the operation mode of the 6-phase PWM option.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PWMOPT_Start

void R_PWMOPT_Start ( void );

Page 333: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 333 of 642Feb 01, 2018

Halts the clock supplied to the 6-phase PWM option.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PWMOPT_Stop

void R_PWMOPT_Stop ( void );

Page 334: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 334 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.29 Serial array unit

Below is a list of API functions output by the Code Generator for serial array unit use.

Table 3.29 API Functions: [Serial Array Unit]

API Function Name Function

R_SAUm_Create Performs initialization necessary to control the serial array unit.

R_SAUm_Create_UserInit Performs user-defined initialization related to the serial array unit.

R_SAUm_Reset Reset the serial array unit.

R_SAUm_Set_PowerOff Halts the clock supplied to the serial array unit.

R_SAUm_Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode.

R_SAUm_Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode.

R_UARTn_Create Performs initialization necessary to perform the UART communication.

r_uartn_interrupt_send Performs processing in response to the UART transmission end inter-rupt INTSTn.

r_uartn_interrupt_receive Performs processing in response to the UART reception end interrupt INTSRn.

r_uartn_interrupt_error Performs processing in response to the reception error interrupt INTSREn.

R_UARTn_Start Sets UART communication to standby mode.

R_UARTn_Stop Ends UART communication.

R_UARTn_Send Starts UART data transmission.

R_UARTn_Receive Starts UART data reception.

r_uartn_callback_sendend Performs processing in response to the UART transmission end inter-rupt INTSTn.

r_uartn_callback_receiveend Performs processing in response to the UART reception end interrupt INTSRn.

r_uartn_callback_error Performs processing in response to the UART reception error interrupt INTSREn.

r_uartn_callback_softwareoverrun Performs processing in response to detection of overrun error.

R_CSImn_Create Performs initialization necessary to perform the 3-wire serial I/O communication.

r_csimn_interrupt Performs processing in response to the CSI communication end inter-rupt INTCSImn.

R_CSImn_Start Sets 3-wire serial I/O communication to standby mode.

R_CSImn_Stop Ends 3-wire serial I/O communication.

R_CSImn_Send Starts CSI data transmission.

R_CSImn_Receive Starts CSI data reception.

R_CSImn_Send_Receive Starts CSI data transmission/reception.

r_csimn_callback_sendend Performs processing in response to the CSI transmission end interrupt INTCSImn.

Page 335: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 335 of 642Feb 01, 2018

r_csimn_callback_receiveend Performs processing in response to the CSI reception end interrupt INTCSImn.

r_csimn_callback_error Performs processing in response to the CSI reception error interrupt INTSREn.

R_IICmn_Create Performs initialization necessary to perform the simplified IIC communication.

r_iicmn_interrupt Performs processing in response to the simple IIC communication end interrupt INTIICmn.

R_IICmn_StartCondition Generates start conditions.

R_IICmn_StopCondition Generates stop conditions.

R_IICmn_Stop Ends simplified IIC communication.

R_IICmn_Master_Send Starts simple IIC master transmission.

R_IICmn_Master_Receive Starts simple IIC master reception.

r_iicmn_callback_master_sendend Performs processing in response to the simple IICmn master transmission end interrupt INTIICmn.

r_iicmn_callback_master_receiveend Performs processing in response to the simple IICmn master reception end interrupt INTIICmn.

r_iicmn_callback_master_error Performs processing in response to detection of parity error (ACK error).

API Function Name Function

Page 336: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 336 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the serial array unit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Create

void R_SAUm_Create ( void );

Page 337: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 337 of 642Feb 01, 2018

Performs user-defined initialization related to the serial array unit.

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

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Create_UserInit

void R_SAUm_Create_UserInit ( void );

Page 338: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 338 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset the serial array unit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Reset

void R_SAUm_Reset ( void );

Page 339: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 339 of 642Feb 01, 2018

Halts the clock supplied to the serial array unit.

Remark Calling this API function changes the serial array unit to reset status.For this reason, writes to the control registers (e.g. serial clock select register n: SPSn) after this API function is called are ignored.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Set_PowerOff

void R_SAUm_Set_PowerOff ( void );

Page 340: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 340 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables the switch from STOP mode to SNOOZE mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Set_SnoozeOn

void R_SAUm_Set_SnoozeOn ( void );

Page 341: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 341 of 642Feb 01, 2018

Disables the switch from STOP mode to SNOOZE mode.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_SAUm_Set_SnoozeOff

void R_SAUm_Set_SnoozeOff ( void );

Page 342: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 342 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to perform the UART communication.

Remark This API function is used as an internal function of R_SAUm_Create.For this reason, there is normally no need to call it from a user program.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTn_Create

void R_UARTn_Create ( void );

Page 343: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 343 of 642Feb 01, 2018

Performs processing in response to the UART transmission end interrupt INTSTn.

Remark This API function is called as the interrupt process corresponding to the UART transmission end interrupt INTSTn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark [n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_interrupt_send

__interrupt static void r_uartn_interrupt_send ( void );

static void __near r_uartn_interrupt_send ( void );

Page 344: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 344 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the UART reception end interrupt INTSRn.

Remark This API function is called as the interrupt process corresponding to the UART reception end interrupt INTSRn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_interrupt_receive

__interrupt static void r_uartn_interrupt_receive ( void );

static void __near r_uartn_interrupt_receive ( void );

Page 345: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 345 of 642Feb 01, 2018

Performs processing in response to the reception error interrupt INTSREn.

Remark This API function is called as the interrupt process corresponding to the reception error interrupt INTSREn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark [n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_interrupt_error

__interrupt static void r_uartn_interrupt_error ( void );

static void __near r_uartn_interrupt_error ( void );

Page 346: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 346 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets UART communication to standby mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTn_Start

void R_UARTn_Start ( void );

Page 347: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 347 of 642Feb 01, 2018

Ends UART communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTn_Stop

void R_UARTn_Stop ( void );

Page 348: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 348 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts UART data transmission.

Remarks 1. This API function repeats the byte-level UART transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a UART transmission, R_UARTn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTn_Send

#include "r_cg_macrodriver.h"MD_STATUS R_UARTn_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 specification

Page 349: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 349 of 642Feb 01, 2018

Starts UART data reception.

Remarks 1. This API function performs byte-level UART 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. Actual UART reception starts after this API function is called, and R_UARTn_Start is then called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTn_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_UARTn_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 received data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 350: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 350 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the UART transmission end interrupt INTSTn.

Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_send corre-sponding to the UART transmission end interrupt INTSTn (performed when number of transmission data specified by R_UARTn_Send argument tx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_callback_sendend

static void r_uartn_callback_sendend ( void );

Page 351: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 351 of 642Feb 01, 2018

Performs processing in response to the UART reception end interrupt INTSRn.

Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_receive corre-sponding to the UART reception end interrupt INTSRn (performed when number of received data speci-fied by R_UARTn_Receive argument rx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_callback_receiveend

static void r_uartn_callback_receiveend ( void );

Page 352: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 352 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the UART reception error interrupt INTSREn.

Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error correspond-ing to the UART reception error interrupt INTSREn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_uartn_callback_error

#include "r_cg_macrodriver.h"static void r_uartn_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Trigger for UART reception error interrupt00000xx1B: Overrun error00000x1xB: Parity error000001xxB: Framing error

Page 353: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 353 of 642Feb 01, 2018

Performs processing in response to detection of overrun error.

Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_receive corre-sponding to the UART reception end interrupt INTSRn (process performed when the amount of data received is greater than the argument rx_num specified for R_UARTn_Receive).

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_uartn_callback_softwareoverrun

#include "r_cg_macrodriver.h"static void r_uartn_callback_softwareoverrun ( uint16_t rx_data );

I/O Argument Description

O uint16_t rx_data; Receive data (greater than the argument rx_num specified for R_UARTn_Receive)

Page 354: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 354 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to perform the 3-wire serial I/O communication.

Remark This API function is used as an internal function of R_SAUm_Create.For this reason, there is normally no need to call it from a user program.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CSImn_Create

void R_CSImn_Create ( void );

Page 355: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 355 of 642Feb 01, 2018

Performs processing in response to the CSI communication end interrupt INTCSImn.

Remark This API function is called as the interrupt process corresponding to the CSI communication end interrupt INTCSImn.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_csimn_interrupt

__interrupt static void r_csimn_interrupt ( void );

Page 356: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 356 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets 3-wire serial I/O communication to standby mode.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CSImn_Start

void R_CSImn_Start ( void );

Page 357: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 357 of 642Feb 01, 2018

Ends 3-wire serial I/O communication.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_CSImn_Stop

void R_CSImn_Stop ( void );

Page 358: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 358 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts CSI data transmission.

Remarks 1. This API function repeats the byte-level CSI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a CSI transmission, R_CSImn_Start must be called before this API function is called.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

R_CSImn_Send

#include "r_cg_macrodriver.h"MD_STATUS R_CSImn_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 specification

Page 359: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 359 of 642Feb 01, 2018

Starts CSI data reception.

Remarks 1. This API function performs byte-level CSI 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 CSI reception, R_CSImn_Start must be called before this API function is called.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

R_CSImn_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_CSImn_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 received data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 360: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 360 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts CSI data transmission/reception.

Remarks 1. This API function repeats the byte-level CSI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. This API function performs byte-level CSI reception the number of times specified by the argument tx_num, and stores the data in the buffer specified by the argument rx_buf.

Remarks 3. When performing a CSI reception, R_CSImn_Start must be called before this API function is called.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

R_CSImn_Send_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_CSImn_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 received data

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 361: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 361 of 642Feb 01, 2018

Performs processing in response to the CSI transmission end interrupt INTCSImn.

Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to the CSI transmission end interrupt INTCSImn (performed when number of transmission data specified by R_CSImn_Send or R_CSImn_Send_Receive argument tx_num has been completed).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_csimn_callback_sendend

static void r_csimn_callback_sendend ( void );

Page 362: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 362 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the CSI reception end interrupt INTCSImn.

Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to the CSI reception end interrupt INTCSImn (performed when number of received data specified by R_CSImn_Receive or R_CSImn_Send_Receive argument rx_num has been completed).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_csimn_callback_receiveend

static void r_csimn_callback_receiveend ( void );

Page 363: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 363 of 642Feb 01, 2018

Performs processing in response to the CSI reception error interrupt INTSREn.

Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error correspond-ing to the CSI reception error interrupt INTSREn.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

None.

r_csimn_callback_error

#include "r_cg_macrodriver.h"static void r_csimn_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Trigger for CSI reception error interrupt00000xx1B: Overrun error

Page 364: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 364 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to perform the simplified IIC communication.

Remark This API function is used as an internal function of R_SAUm_Create.For this reason, there is normally no need to call it from a user program.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICmn_Create

void R_IICmn_Create ( void );

Page 365: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 365 of 642Feb 01, 2018

Performs processing in response to the simple IIC communication end interrupt INTIICmn.

Remark This API function is called as the interrupt process corresponding to the simple IIC communication end interrupt INTIICmn.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iicmn_interrupt

__interrupt static void r_iicmn_interrupt ( void );

Page 366: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 366 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Generates start conditions.

Remark This API function is used as an internal function of R_IICmn_Master_Send and R_IICmn_Master_Receive.For this reason, there is normally no need to call it from a user program.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICmn_StartCondition

void R_IICmn_StartCondition ( void );

Page 367: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 367 of 642Feb 01, 2018

Generates stop conditions.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICmn_StopCondition

void R_IICmn_StopCondition ( void );

Page 368: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 368 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends simple IIC communication.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICmn_Stop

void R_IICmn_Stop ( void );

Page 369: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 369 of 642Feb 01, 2018

Starts simple IIC master transmission.

Remark This API function repeats the byte-level simple IIC master transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

Remark Below is shown the format for specifying device address adr.

[Return value]

None.

R_IICmn_Master_Send

#include "r_cg_macrodriver.h"void R_IICmn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num );

I/O Argument Description

I uint8_t adr; Device 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

7

Device address

Device typeSlave address

B0B1B2B3B4B5B6B70

Page 370: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 370 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts simple IIC master reception.

Remark This API function performs byte-level simple IIC master reception the number of times specified by the argument rx_num, and stores the data in the buffer specified by the argument rx_buf.

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

Remark Below is shown the format for specifying device address adr.

[Return value]

None.

R_IICmn_Master_Receive

#include "r_cg_macrodriver.h"void R_IICmn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num );

I/O Argument Description

I uint8_t adr; Device address

O uint8_t * const rx_buf; Pointer to a buffer to store the received data

I uint16_t rx_num; Total amount of data to receive

7

Device address

Device typeSlave address

B0B1B2B3B4B5B6B70

Page 371: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 371 of 642Feb 01, 2018

Performs processing in response to the simple IICmn master transmission end interrupt INTIICmn.

Remark This API function is called as the callback routine of interrupt process r_iicmn_interrupt corresponding to the simple IICmn master transmission end interrupt INTIICmn (performed when number of transmission data specified by R_IICmn_Master_Send argument tx_num has been completed).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iicmn_callback_master_sendend

static void r_iicmn_callback_master_sendend ( void );

Page 372: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 372 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the simple IICmn master reception end interrupt INTIICmn.

Remark This API function is called as the callback routine of interrupt process r_iicmn_interrupt corresponding to the simple IICmn master reception end interrupt INTIICmn (performed when number of received data specified by R_IICmn_Master_Receive argument rx_num has been completed).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iicmn_callback_master_receiveend

static void r_iicmn_callback_master_receiveend ( void );

Page 373: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 373 of 642Feb 01, 2018

Performs processing in response to detection of parity error (ACK error).

[Syntax]

Remark m is the unit number, and n is the channel number.

[Argument(s)]

[Return value]

None.

r_iicmn_callback_master_error

#include "r_cg_macrodriver.h"static void r_iicmn_callback_master_error ( MD_STATUS flag );

I/O Argument Description

O MD_STATUS flag; Cause of communication errorMD_NACK: Acknowledge not detected

Page 374: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 374 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.30 Serial array unit 4

Below is a list of API functions output by the Code Generator for serial array unit 4 (DALI/UART4) use.

Table 3.30 API Functions: [Serial Array Unit 4]

API Function Name Function

R_DALIn_Create Performs initialization necessary to control the serial array unit 4 (DALI/UART4).

r_dalin_interrupt_send Performs processing in response to the DALI transmission end interrupt INTSTDLn.

r_dalin_interrupt_receive Performs processing in response to the DALI reception end interrupt INTSRDLn.

r_dalin_interrupt_error Performs processing in response to the DALI reception error interrupt INTSREDLn.

R_DALIn_Start Sets DALI communication to standby mode.

R_DALIn_Stop Ends DALI communication.

R_DALIn_Send Starts DALI data transmission.

R_DALIn_Receive Starts DALI data reception.

r_dalin_callback_sendend Performs processing in response to the DALI transmission end interrupt INTSTDLn.

r_dalin_callback_receiveend Performs processing in response to the DALI reception end interrupt INTSRDLn.

r_dalin_callback_error Performs processing in response to the DALI reception error interrupt INTSREDLn.

r_dalin_callback_softwareoverrun Performs processing in response to detection of overrun error.

Page 375: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 375 of 642Feb 01, 2018

Performs initialization necessary to control the serial array unit 4 (DALI/UART4).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DALIn_Create

void R_DALIn_Create ( void );

Page 376: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 376 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the DALI transmission end interrupt INTSTDLn.

Remark This API function is called as the interrupt process corresponding to the DALI transmission end interrupt INTSTDLn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dalin_interrupt_send

__interrupt static void r_dalin_interrupt_send ( void );

static void __near r_dalin_interrupt_send ( void );

Page 377: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 377 of 642Feb 01, 2018

Performs processing in response to the DALI reception end interrupt INTSRDLn.

Remark This API function is called as the interrupt process corresponding to the DALI reception end interrupt INTSRDLn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dalin_interrupt_receive

__interrupt static void r_dalin_interrupt_receive ( void );

static void __near r_dalin_interrupt_receive ( void );

Page 378: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 378 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the DALI reception error interrupt INTSREDLn.

Remark This API function is called as the interrupt process corresponding to the DALI reception error interrupt INTSREDLn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dalin_interrupt_error

__interrupt static void r_dalin_interrupt_error ( void );

static void __near r_dalin_interrupt_error ( void );

Page 379: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 379 of 642Feb 01, 2018

Sets DALI communication to standby mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DALIn_Start

void R_DALIn_Start ( void );

Page 380: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 380 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends DALI communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DALIn_Stop

void R_DALIn_Stop ( void );

Page 381: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 381 of 642Feb 01, 2018

Starts DALI data transmission.

Remarks 1. This API function repeats the byte-level DALI transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a DALI transmission, R_DALIn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_DALIn_Send

#include "r_cg_macrodriver.h"MD_STATUS R_DALIn_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 specification

Page 382: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 382 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts DALI data reception.

Remarks 1. This API function performs byte-level DALI 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. Actual DALI reception starts after this API function is called, and R_DALIn_Start is then called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_DALIn_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_DALIn_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 received data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 383: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 383 of 642Feb 01, 2018

Performs processing in response to the DALI transmission end interrupt INTSTDLn.

Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_send correspond-ing to the DALI transmission end interrupt INTSTDLn (performed when number of transmission data specified by R_DALIn_Send argument tx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dalin_callback_sendend

static void r_dalin_callback_sendend ( void );

Page 384: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 384 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the DALI reception end interrupt INTSRDLn.

Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive corre-sponding to the DALI reception end interrupt INTSRDLn (performed when number of received data spec-ified by R_DALIn_Receive argument rx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dalin_callback_receiveend

static void r_dalin_callback_receiveend ( void );

Page 385: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 385 of 642Feb 01, 2018

Performs processing in response to the DALI reception error interrupt INTSREDLn.

Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_error correspond-ing to the DALI reception error interrupt INTSREDLn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_dalin_callback_error

#include "r_cg_macrodriver.h"static void r_dalin_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Trigger for DALI reception error interrupt00000xx1B: Overrun error00000x1xB: Parity error000001xxB: Framing error

Page 386: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 386 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to detection of overrun error.

Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive corre-sponding to the DALI reception end interrupt INTSRDLn (process performed when the amount of data received is greater than the argument rx_num specified for R_DALIn_Receive).

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_dalin_callback_softwareoverrun

#include "r_cg_macrodriver.h"static void r_dalin_callback_softwareoverrun ( uint16_t rx_data );

I/O Argument Description

O uint16_t rx_data; Receive data (greater than the argument rx_num specified for R_DALIn_Receive)

Page 387: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 387 of 642Feb 01, 2018

3.2.31 Asynchronous serial interface LIN-UART

Below is a list of API functions output by the Code Generator for asynchronous serial interface LIN-UART (UARTF) use.

Table 3.31 API Functions: [Asynchronous Serial Interface LIN-UART]

API Function Name Function

R_UARTFn_Create Performs initialization necessary to control the asynchronous serial interface LIN-UART (UARTF).

R_UARTFn_Create_UserInit Performs user-defined initialization related to the asynchronous serial interface LIN-UART (UARTF).

r_uartfn_interrupt_send Performs processing in response to the LIN-UART transmission end interrupt INTLT.

r_uartfn_interrupt_receive Performs processing in response to the LIN-UART reception end inter-rupt INTLR.

r_uartfn_interrupt_error Performs processing in response to the LIN-UART reception status interrupt INTLS.

R_UARTFn_Start Sets LIN communication to standby mode.

R_UARTFn_Stop Ends LIN communication.

R_UARTFn_Set_PowerOff Halts the clock supplied to the asynchronous serial interface LIN-UART (UARTF).

R_UARTFn_Send Starts UARTF data transmission.

R_UARTFn_Receive Starts UARTF data reception.

R_UARTFn_Set_DataComparisonOn Starts the data comparison.

R_UARTFn_Set_DataComparisonOff Ends the data comparison.

r_uartfn_callback_sendend Performs processing in response to the LIN-UART transmission end interrupt INTLT.

r_uartfn_callback_receiveend Performs processing in response to the LIN-UART reception end inter-rupt INTLR.

r_uartfn_callback_error Performs processing in response to the LIN-UART reception status interrupt INTLS.

r_uartfn_callback_softwareoverrun Performs processing in response to detection of overrun error.

r_uartfn_callback_expbitdetect Performs processing in response to detection of expansion bit.

r_uartfn_callback_idmatch Performs processing in response to match of ID parity.

Page 388: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 388 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the asynchronous serial interface LIN-UART (UARTF).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Create

void R_UARTFn_Create ( void );

Page 389: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 389 of 642Feb 01, 2018

Performs user-defined initialization related to the asynchronous serial interface LIN-UART (UARTF).

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Create_UserInit

void R_UARTFn_Create_UserInit ( void );

Page 390: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 390 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the LIN-UART transmission end interrupt INTLT.

Remark This API function is called as the interrupt process corresponding to the LIN-UART transmission end interrupt INTLT.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_interrupt_send

__interrupt static void r_uartfn_interrupt_send ( void );

static void __near r_uartfn_interrupt_send ( void );

Page 391: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 391 of 642Feb 01, 2018

Performs processing in response to the LIN-UART reception end interrupt INTLR.

Remark This API function is called as the interrupt process corresponding to the LIN-UART reception end inter-rupt INTLR.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_interrupt_receive

__interrupt static void r_uartfn_interrupt_receive ( void );

static void __near r_uartfn_interrupt_receive ( void );

Page 392: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 392 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the LIN-UART reception status interrupt INTLS.

Remark This API function is called as the interrupt process corresponding to the LIN-UART reception status inter-rupt INTLS.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_interrupt_error

__interrupt static void r_uartfn_interrupt_error ( void );

static void __near r_uartfn_interrupt_error ( void );

Page 393: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 393 of 642Feb 01, 2018

Sets LIN communication to standby mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Start

void R_UARTFn_Start ( void );

Page 394: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 394 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends LIN communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Stop

void R_UARTFn_Stop ( void );

Page 395: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 395 of 642Feb 01, 2018

Halts the clock supplied to the asynchronous serial interface LIN-UART (UARTF).

Remark Calling this API function changes the asynchronous serial interface LIN-UART (UARTF) to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Set_PowerOff

void R_UARTFn_Set_PowerOff ( void );

Page 396: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 396 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts UARTF data transmission.

Remarks 1. This API function repeats the byte-level UARTF transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a UARTF transmission, R_UARTFn_Start must be called before this API function is called.

Remarks 3. If the asynchronous serial interface LIN-UART (UARTF) is used in expansion bit mode, then store the data to send in the buffer specified by argument tx_buf, in the following format."8-bit data", "Expansion bit", "8-bit data", "Expansion bit", ...

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTFn_Send

MD_STATUS R_UARTFn_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 specification

MD_DATAEXISTS Executing transmission process

Page 397: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 397 of 642Feb 01, 2018

Starts UARTF data reception.

Remarks 1. This API function performs byte-level UARTF 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. Actual UARTF reception starts after this API function is called, and R_UARTFn_Start is then called.

Remarks 3. If the asynchronous serial interface LIN-UART (UARTF) is used in expansion bit mode, then the received data is stored in the buffer specified by argument rx_buf, in the following format."8-bit data", "Expansion bit", "8-bit data", "Expansion bit", ...

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTFn_Receive

MD_STATUS R_UARTFn_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 received data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 398: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 398 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the data comparison.

Remark Calling this API function switches the asynchronous serial interface LIN-UART (UARTF) to expansion bit mode (with data comparison).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Set_DataComparisonOn

void R_UARTFn_Set_DataComparisonOn ( void );

Page 399: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 399 of 642Feb 01, 2018

Ends the data comparison.

Remark Calling this API function switches the asynchronous serial interface LIN-UART (UARTF) to expansion bit mode (with no data comparison).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTFn_Set_DataComparisonOff

void R_UARTFn_Set_DataComparisonOff ( void );

Page 400: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 400 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the LIN-UART transmission end interrupt INTLT.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_send corre-sponding to the LIN-UART transmission end interrupt INTLT (performed when number of transmission data specified by R_UARTFn_Send argument tx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_callback_sendend

static void r_uartfn_callback_sendend ( void );

Page 401: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 401 of 642Feb 01, 2018

Performs processing in response to the LIN-UART reception end interrupt INTLR.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_receive corre-sponding to the LIN-UART reception end interrupt INTLR (performed when number of received data specified by R_UARTFn_Receive argument rx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_callback_receiveend

static void r_uartfn_callback_receiveend ( void );

Page 402: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 402 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the LIN-UART reception status interrupt INTLS.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error corre-sponding to the LIN-UART reception status interrupt INTLS.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_uartfn_callback_error

static void r_uartfn_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Trigger for LIN-UART reception status interrupt00000xx1B: Overrun error00000x1xB: Parity error000001xxB: Framing error

Page 403: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 403 of 642Feb 01, 2018

Performs processing in response to detection of overrun error.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_receive corre-sponding to the LIN-UART reception end interrupt INTLR (performed when number of received data specified by R_UARTFn_Receive argument rx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_callback_softwareoverrun

static void r_uartfn_callback_softwareoverrun ( void );

Page 404: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 404 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to detection of expansion bit.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error corre-sponding to the LIN-UART reception status interrupt INTLS (performed when expansion bit has been detected).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_callback_expbitdetect

static void r_uartfn_callback_expbitdetect ( void );

Page 405: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 405 of 642Feb 01, 2018

Performs processing in response to match ID parity.

Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error corre-sponding to the LIN-UART reception status interrupt INTLS (performed when ID parity has been matched).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartfn_callback_idmatch

static void r_uartfn_callback_idmatch ( void );

Page 406: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 406 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.32 Serial interface IICA

Below is a list of API functions output by the Code Generator for serial interface IICA use.

Table 3.32 API Functions: [Serial Interface IICA]

API Function Name Function

R_IICAn_Create Performs initialization necessary to control the serial interface IICA.

R_IICAn_Create_UserInit Performs user-defined initialization related to the serial interface IICA.

r_iican_interrupt Performs processing in response to the IICA communication end inter-rupt INTIICAn.

R_IICAn_StopCondition Generates stop conditions.

R_IICAn_Stop Ends IICA communication.

R_IICAn_Reset Reset the serial interface IICA.

R_IICAn_Set_PowerOff Halts the clock supplied to the serial interface IICA.

R_IICAn_Master_Send Starts IICA master transmission.

R_IICAn_Master_Receive Starts IICA master reception.

r_iican_callback_master_sendend Performs processing in response to the IICA master transmission end interrupt INTIICAn.

r_iican_callback_master_receiveend Performs processing in response to the IICA master reception end inter-rupt INTIICAn.

r_iican_callback_master_error Performs processing in response to detection of IICA master communi-cation error.

R_IICAn_Slave_Send Starts IICA slave transmission.

R_IICAn_Slave_Receive Starts IICA slave reception.

r_iican_callback_slave_sendend Performs processing in response to the IICA slave transmission end interrupt INTIICAn.

r_iican_callback_slave_receiveend Performs processing in response to the IICA slave reception end inter-rupt INTIICAn.

r_iican_callback_slave_error Performs processing in response to detection of IICA slave communica-tion error.

r_iican_callback_getstopcondition Performs processing in response to detection of stop condition.

R_IICAn_Set_SnoozeOn Enables operation of the address match wakeup function in STOP mode.

R_IICAn_Set_SnoozeOff Disables operation of the address match wakeup function in STOP mode.

R_IICAn_Set_WakeupOn Enables operation of the address match wakeup function in STOP mode.

R_IICAn_Set_WakeupOff Disables operation of the address match wakeup function in STOP mode.

Page 407: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 407 of 642Feb 01, 2018

Performs initialization necessary to control the serial interface IICA.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Create

void R_IICAn_Create ( void );

Page 408: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 408 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization related to the serial interface IICA.

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Create_UserInit

void R_IICAn_Create_UserInit ( void );

Page 409: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 409 of 642Feb 01, 2018

Performs processing in response to the IICA communication end interrupt INTIICAn.

Remark This API function is called as the interrupt process corresponding to the IICA communication end inter-rupt INTIICAn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_interrupt

__interrupt static void r_iican_interrupt ( void );

static void __near r_iican_interrupt ( void );

Page 410: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 410 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Generates stop conditions.

Remark After calling this API function, please confirm a detection of stop condition by SPD0 bit before stopping IICA.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_StopCondition

void R_IICAn_StopCondition ( void );

Page 411: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 411 of 642Feb 01, 2018

Ends IICA communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Stop

void R_IICAn_Stop ( void );

Page 412: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 412 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reset the serial interface IICA.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Reset

void R_IICAn_Reset ( void );

Page 413: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 413 of 642Feb 01, 2018

Halts the clock supplied to the serial interface IICA.

Remark Calling this API function changes the serial interface IICA to reset status.For this reason, writes to the control registers (e.g. IICA control register n: IICCTLn) after this API func-tion is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Set_PowerOff

void R_IICAn_Set_PowerOff ( void );

Page 414: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 414 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts IICA master transmission.

Remark This API function repeats the byte-level IICA master transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_IICAn_Master_Send

#include "r_cg_macrodriver.h"MD_STATUS R_IICAn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num, uint8_t wait );

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

I uint8_t wait; Setup time of start conditions

Macro Description

MD_OK Normal completion

MD_ERROR1 Bus communication status

MD_ERROR2 Bus not released status

Page 415: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 415 of 642Feb 01, 2018

Starts IICA master reception.

Remark This API function performs byte-level IICA master reception the number of times specified by the argument rx_num, and stores the data in the buffer specified by the argument rx_buf.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_IICAn_Master_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_IICAn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num, uint8_t wait );

I/O Argument Description

I uint8_t adr; Slave address

O uint8_t * const rx_buf; Pointer to a buffer to store the received data

I uint16_t rx_num; Total amount of data to receive

I uint8_t wait; Setup time of start conditions

Macro Description

MD_OK Normal completion

MD_ERROR1 Bus communication status

MD_ERROR2 Bus not released status

Page 416: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 416 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the IICA master transmission end interrupt INTIICAn.

Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA master transmission end interrupt INTIICAn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_callback_master_sendend

static void r_iican_callback_master_sendend ( void );

Page 417: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 417 of 642Feb 01, 2018

Performs processing in response to the IICA master reception end interrupt INTIICAn.

Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA master reception end interrupt INTIICAn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_callback_master_receiveend

static void r_iican_callback_master_receiveend ( void );

Page 418: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 418 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to detection of IICA master communication error.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_iican_callback_master_error

#include "r_cg_macrodriver.h"static void r_iican_callback_master_error ( MD_STATUS flag );

I/O Argument Description

I MD_STATUS flag; Cause of communication errorMD_SPT: Stop condition detectedMD_NACK: Acknowledge not detected(No slave that matches the address/A slave can receive no more data or does not require the next data)

Page 419: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 419 of 642Feb 01, 2018

Starts IICA slave transmission.

Remark This API function repeats the byte-level IICA slave transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_IICAn_Slave_Send

#include "r_cg_macrodriver.h"void R_IICAn_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 420: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 420 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts IICA slave reception.

Remark This API function performs byte-level IICA 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.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_IICAn_Slave_Receive

#include "r_cg_macrodriver.h"void R_IICAn_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 received data

I uint16_t rx_num; Total amount of data to receive

Page 421: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 421 of 642Feb 01, 2018

Performs processing in response to the IICA slave transmission end interrupt INTIICAn.

Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA slave transmission end interrupt INTIICAn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_callback_slave_sendend

static void r_iican_callback_slave_sendend ( void );

Page 422: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 422 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the IICA slave reception end interrupt INTIICAn.

Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA slave reception end interrupt INTIICAn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_callback_slave_receiveend

static void r_iican_callback_slave_receiveend ( void );

Page 423: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 423 of 642Feb 01, 2018

Performs processing in response to detection of IICA slave communication error.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_iican_callback_slave_error

#include "r_cg_macrodriver.h"static void r_iican_callback_slave_error ( MD_STATUS flag );

I/O Argument Description

I MD_STATUS flag; Cause of communication errorMD_ERROR: Address mismatch detectedMD_NACK: Acknowledge not detected(Master receiving end)

Page 424: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 424 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to detection of stop condition.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_iican_callback_getstopcondition

static void r_iican_callback_getstopcondition ( void );

Page 425: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 425 of 642Feb 01, 2018

Enables operation of the address match wakeup function in STOP mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Set_SnoozeOn

void R_IICAn_Set_SnoozeOn ( void );

Page 426: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 426 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of the address match wakeup function in STOP mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Set_SnoozeOff

void R_IICAn_Set_SnoozeOff ( void );

Page 427: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 427 of 642Feb 01, 2018

Enables operation of the address match wakeup function in STOP mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Set_WakeupOn

void R_IICAn_Set_WakeupOn ( void );

Page 428: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 428 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of the address match wakeup function in STOP mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_IICAn_Set_WakeupOff

void R_IICAn_Set_WakeupOff ( void );

Page 429: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 429 of 642Feb 01, 2018

3.2.33 LCD controller/driver

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

Table 3.33 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_interrupt Performs processing in response to the LCD frame interrupt INTLCD.

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_Set_VoltageOn Enables operation of internal voltage boost circuit and capacitor split cir-cuit.

R_LCD_Set_VoltageOff Disables operation of internal voltage boost circuit and capacitor split cir-cuit.

R_LCD_Set_PowerOff Halts the clock supplied to the LCD controller/driver.

R_LCD_VoltageOn Enables operation of internal voltage boost circuit and capacitor split cir-cuit.

R_LCD_VoltageOff Disables operation of internal voltage boost circuit and capacitor split cir-cuit.

Page 430: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 430 of 642Feb 01, 2018

e2 studio 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 431: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 431 of 642Feb 01, 2018

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 432: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 432 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the LCD frame interrupt INTLCD.

Remark This API function is called as the interrupt process corresponding to the LCD frame interrupt INTLCD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lcd_interrupt

__interrupt static void r_lcd_interrupt ( void );

static void __near r_lcd_interrupt ( void );

Page 433: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 433 of 642Feb 01, 2018

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 434: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 434 of 642Feb 01, 2018

e2 studio 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 435: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 435 of 642Feb 01, 2018

Enables operation of internal voltage boost circuit and capacitor split circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Set_VoltageOn

void R_LCD_Set_VoltageOn ( void );

Page 436: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 436 of 642Feb 01, 2018

e2 studio 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_Set_VoltageOff

void R_LCD_Set_VoltageOff ( void );

Page 437: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 437 of 642Feb 01, 2018

Halts the clock supplied to the LCD controller/driver.

Remarks 1. Calling this API function changes the LCD controller/driver to reset status.For this reason, writes to the control registers after this API function is called are ignored.

Remarks 2. This API function stops the clock supply to the LCD controller/driver, by operating the RTCEN bit of peripheral enable register n.For this reason, this API function also stops the clock supply to other peripheral devices sharing the RTCEN bit (e.g. real-time clock).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_Set_PowerOff

void R_LCD_Set_PowerOff ( void );

Page 438: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 438 of 642Feb 01, 2018

e2 studio 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_VoltageOn

void R_LCD_VoltageOn ( void );

Page 439: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 439 of 642Feb 01, 2018

Disables operation of internal voltage boost circuit and capacitor split circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LCD_VoltageOff

void R_LCD_VoltageOff ( void );

Page 440: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 440 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.34 Sound generator

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

Table 3.34 API Functions: [Sound Generator]

API Function Name Function

R_SG_Create Performs initialization necessary to control the sound generator.

R_SG_Create_UserInit Performs user-defined initialization relating to the sound generator.

r_sg_interrupt Performs processing in response to the threshold value detection of the logarithmic decrement interrupt INTSG.

R_SG_Start Enables operation of sound generator.

R_SG_Stop Disables operation of sound generator.

Page 441: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 441 of 642Feb 01, 2018

Performs initialization necessary to control the sound generator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SG_Create

void R_SG_Create ( void );

Page 442: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 442 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the sound generator.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SG_Create_UserInit

void R_SG_Create_UserInit ( void );

Page 443: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 443 of 642Feb 01, 2018

Performs processing in response to the threshold value detection of the logarithmic decrement interrupt INTSG.

Remark This API function is called as the interrupt process corresponding to the threshold value detection of the logarithmic decrement interrupt INTSG.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_sg_interrupt

__interrupt static void r_sg_interrupt ( void );

static void __near r_sg_interrupt ( void );

Page 444: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 444 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of sound generator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SG_Start

void R_SG_Start ( void );

Page 445: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 445 of 642Feb 01, 2018

Disables operation of sound generator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SG_Stop

void R_SG_Stop ( void );

Page 446: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 446 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.35 DMA controller

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

Table 3.35 API Functions: [DMA Controller]

API Function Name Function

R_DMACn_Create Performs initialization necessary to control the DMA controller.

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

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_dmacn_interrupt Performs processing in response to the DMA transfer end interrupt INTDMAn.

R_DMACn_Start Enables operation of channel n.

R_DMACn_Stop Disables operation of channel n.

R_DMACn_Set_SoftwareTriggerOn Starts DMA transfer.

Page 447: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 447 of 642Feb 01, 2018

Performs initialization necessary to control the DMA controller.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Create

void R_DMACn_Create ( void );

Page 448: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 448 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the DMA controller.

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Create_UserInit

void R_DMACn_Create_UserInit ( void );

Page 449: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 449 of 642Feb 01, 2018

Performs initialization necessary to control the DMA controller.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DMAC_Create

void R_DMAC_Create ( void );

Page 450: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 450 of 642Feb 01, 2018

e2 studio 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 451: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 451 of 642Feb 01, 2018

Performs processing in response to the DMA transfer end interrupt INTDMAn.

Remark This API function is called as the interrupt process corresponding to the DMA transfer end interrupt INTDMAn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_dmacn_interrupt

__interrupt static void r_dmacn_interrupt ( void );

static void __near r_dmacn_interrupt ( void );

Page 452: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 452 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of channel n.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Start

void R_DMACn_Start ( void );

Page 453: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 453 of 642Feb 01, 2018

Disables operation of channel n.

Remarks 1. This API function does not forcibly terminate DMA transfer.

Remarks 2. Before using this API function, you must confirm that transmission has ended.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Stop

void R_DMACn_Stop ( void );

Page 454: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 454 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts DMA transfer.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DMACn_Set_SoftwareTriggerOn

void R_DMACn_Set_SoftwareTriggerOn ( void );

Page 455: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 455 of 642Feb 01, 2018

3.2.36 Data transfer controller

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

Table 3.36 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_DTCn_Start Enables operation of the Data transfer controller.

R_DTCn_Stop Disables operation of the Data transfer controller.

R_DTC_Set_PowerOff Halts the clock supplied to the Data transfer controller.

R_DTCDn_Start Enables operation of the Data transfer controller.

R_DTCDn_Stop Disables operation of the Data transfer controller.

Page 456: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 456 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the DTC.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DTC_Create

void R_DTC_Create ( void );

Page 457: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 457 of 642Feb 01, 2018

Performs user-defined initialization relating to the DTC.

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 458: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 458 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of the DTC.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DTCn_Start

void R_DTCn_Start ( void );

Page 459: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 459 of 642Feb 01, 2018

Disables operation of the DTC.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DTCn_Stop

void R_DTCn_Stop ( void );

Page 460: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 460 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the DTC.

Remark Calling this API function changes the DTC to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DTC_Set_PowerOff

void R_DTC_Set_PowerOff ( void );

Page 461: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 461 of 642Feb 01, 2018

Enables operation of the DTC.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DTCDn_Start

void R_DTCDn_Start ( void );

Page 462: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 462 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of the DTC.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_DTCDn_Stop

void R_DTCDn_Stop ( void );

Page 463: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 463 of 642Feb 01, 2018

3.2.37 Event link controller

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

Table 3.37 API Functions: [Event Link Controller]

API Function Name Function

R_ELC_Create Performs initialization necessary to control the event link controller (ELC).

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

R_ELC_Stop Disables operation of the event link controller (ELC).

Page 464: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 464 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the event link controller (ELC).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_ELC_Create

void R_ELC_Create ( void );

Page 465: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 465 of 642Feb 01, 2018

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

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 466: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 466 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of the event link controller (ELC).

[Syntax]

[Argument(s)]

Remark Below is shown the format for specifying disabled event source event.In case of setting the event to 0x01010101, the event link operations of event source 00, 08, 16, 24 are prohibited.

[Return value]

None.

R_ELC_Stop

void R_ELC_Stop ( uint32_t event );

I/O Argument Description

I uint32_t event; Disabled event source

031B0B24B31

Event source 00

... ...

B25

Event source 24

Page 467: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 467 of 642Feb 01, 2018

3.2.38 Interrupt functions

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

Table 3.38 API Functions: [Interrupt Functions]

API Function Name Function

R_INTC_Create Performs initialization necessary to control the interrupt functions.

R_INTC_Create_UserInit Performs user-defined initialization relating to the interrupt functions.

r_intcn_interrupt Performs processing in response to the external maskable interrupt INTPn.

R_INTCn_Start Enables the acceptance of the external maskable interrupts INTPn.

R_INTCn_Stop Disables the acceptance of the external maskable interrupts INTPn.

r_intclrn_interrupt Performs processing in response to the external maskable interrupt INTPLRn.

R_INTCLRn_Start Enables the acceptance of the external maskable interrupts INTPLRn.

R_INTCLRn_Stop Disables the acceptance of the external maskable interrupts INTPLRn.

r_intrtcicn_interrupt Performs processing in response to the external maskable interrupt INTRTCICn.

R_INTRTCICn_Start Enables the acceptance of the external maskable interrupts INTRTCICn.

R_INTRTCICn_Stop Disables the acceptance of the external maskable interrupts INTRTCICn.

R_INTFO_Start Enables the acceptance of the external maskable interrupts INTFO.

R_INTFO_Stop Disables the acceptance of the external maskable interrupts INTFO.

R_INTFO_ClearFlag Clears INTFCLR flag of Interrupt flag output control register 1 (INTFOCTL1).

r_intfo_interrupt Performs processing in response to the external maskable interrupt INTFO.

Page 468: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 468 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the interrupt functions.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_INTC_Create

void R_INTC_Create ( void );

Page 469: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 469 of 642Feb 01, 2018

Performs user-defined initialization relating to the interrupt functions.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_INTC_Create_UserInit

void R_INTC_Create_UserInit ( void );

Page 470: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 470 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the external maskable interrupt INTPn.

Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTPn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

r_intcn_interrupt

__interrupt static void r_intcn_interrupt ( void );

static void __near r_intcn_interrupt ( void );

Page 471: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 471 of 642Feb 01, 2018

Enables the acceptance of the external maskable interrupts INTPn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTCn_Start

void R_INTCn_Start ( void );

Page 472: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 472 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables the acceptance of the external maskable interrupts INTPn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTCn_Stop

void R_INTCn_Stop ( void );

Page 473: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 473 of 642Feb 01, 2018

Performs processing in response to the external maskable interrupt INTPLRn.

Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTPLRn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

r_intclrn_interrupt

__interrupt static void r_intclrn_interrupt ( void );

static void __near r_intclrn_interrupt ( void );

Page 474: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 474 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables the acceptance of the external maskable interrupts INTPLRn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTCLRn_Start

void R_INTCLRn_Start ( void );

Page 475: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 475 of 642Feb 01, 2018

Disables the acceptance of the external maskable interrupts INTPLRn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTCLRn_Stop

void R_INTCLRn_Stop ( void );

Page 476: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 476 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the external maskable interrupt INTRTCICn.

Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTRTCICn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

r_intrtcicn_interrupt

__interrupt static void r_intrtcicn_interrupt ( void );

static void __near r_intrtcicn_interrupt ( void );

Page 477: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 477 of 642Feb 01, 2018

Enables the acceptance of the external maskable interrupts INTRTCICn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTRTCICn_Start

void R_INTRTCICn_Start ( void );

Page 478: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 478 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables the acceptance of the external maskable interrupts INTRTCICn.

[Syntax]

Remark n is the interrupt factor number.

[Argument(s)]

None.

[Return value]

None.

R_INTRTCICn_Stop

void R_INTRTCICn_Stop ( void );

Page 479: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 479 of 642Feb 01, 2018

Enables the acceptance of the external maskable interrupts INTFO.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_INTFO_Start

void R_INTFO_Start ( void );

Page 480: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 480 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables the acceptance of the external maskable interrupts INTFO.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_INTFO_Stop

void R_INTFO_Stop ( void );

Page 481: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 481 of 642Feb 01, 2018

Clears INTFCLR flag of Interrupt flag output control register 1 (INTFOCTL1).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_INTFO_ClearFlag

void R_INTFO_ClearFlag ( void );

Page 482: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 482 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the external maskable interrupt INTFO.

Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTFO.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_intfo_interrupt

__interrupt static void r_intfo_interrupt ( void );

static void __near r_intfo_interrupt ( void );

Page 483: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 483 of 642Feb 01, 2018

3.2.39 Key interrupt function

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

Table 3.39 API Functions: [Key Interrupt Function]

API Function Name Function

R_KEY_Create Performs initialization necessary to control the key interrupt function.

R_KEY_Create_UserInit Performs user-defined initialization relating to the key interrupt function.

r_key_interrupt Performs processing in response to the key interrupt INTKR.

R_KEY_Start Enables the acceptance of the key interrupt INTKR.

R_KEY_Stop Disables the acceptance of the key interrupt INTKR.

Page 484: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 484 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the key interrupt function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_KEY_Create

void R_KEY_Create ( void );

Page 485: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 485 of 642Feb 01, 2018

Performs user-defined initialization relating to the key interrupt function.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_KEY_Create_UserInit

void R_KEY_Create_UserInit ( void );

Page 486: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 486 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the key interrupt INTKR.

Remark This API function is called as the interrupt process corresponding to the key interrupt INTKR.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_key_interrupt

__interrupt static void r_key_interrupt ( void );

static void __near r_key_interrupt ( void );

Page 487: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 487 of 642Feb 01, 2018

Enables the acceptance of the key interrupt INTKR.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_KEY_Start

void R_KEY_Start ( void );

Page 488: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 488 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables the acceptance of the key interrupt INTKR.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_KEY_Stop

void R_KEY_Stop ( void );

Page 489: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 489 of 642Feb 01, 2018

3.2.40 Voltage detector

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

Table 3.40 API Functions: [Voltage Detector]

API Function Name Function

R_LVD_Create Performs initialization necessary to control the voltage detector.

R_LVD_Create_UserInit Performs user-defined initialization relating to the voltage detector.

r_lvd_interrupt Performs processing in response to the voltage detection interrupt INTLVI.

r_lvd_vddinterrupt Performs processing in response to the voltage detection of VDD pin interrupt INTLVDVDD.

r_lvd_vbatinterrupt Performs processing in response to the voltage detection of VBAT pin interrupt INTLVDVBAT.

r_lvd_vrtcinterrupt Performs processing in response to the voltage detection of VRTC pin interrupt INTLVDVRTC

r_lvd_exlvdinterrupt Performs processing in response to the voltage detection of EXLVD pin interrupt INTLVDEXLVD.

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

R_LVD_Start_VDD Enables operation of VDD pin voltage detection.

R_LVD_Start_VBAT Enables operation of VBAT pin voltage detection.

R_LVD_Start_VRTC Enables operation of VRTC pin voltage detection.

R_LVD_Start_EXLVD Enables operation of EXLVD pin voltage detection.

R_LVD_Stop_VDD Disables operation of VDD pin voltage detection.

R_LVD_Stop_VBAT Disables operation of VBAT pin voltage detection.

R_LVD_Stop_VRTC Disables operation of VRTC pin voltage detection.

R_LVD_Stop_EXLVD Disables operation of EXLVD pin voltage detection.

R_LVI_Create Performs initialization necessary to control the voltage detector.

R_LVI_Create_UserInit Performs user-defined initialization relating to the voltage detector.

r_lvi_interrupt Performs processing in response to the voltage detection interrupt INTLVI.

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

Page 490: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 490 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the voltage detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Create

void R_LVD_Create ( void );

Page 491: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 491 of 642Feb 01, 2018

Performs user-defined initialization relating to the voltage detector.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Create_UserInit

void R_LVD_Create_UserInit ( void );

Page 492: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 492 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the voltage detection interrupt INTLVI.

Remark This API function is called as the interrupt process corresponding to the voltage detection interrupt INTLVI.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvd_interrupt

__interrupt static void r_lvd_interrupt ( void );

static void __near r_lvd_interrupt ( void );

Page 493: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 493 of 642Feb 01, 2018

Performs processing in response to the voltage detection of VDD pin interrupt INTLVDVDD.

Remark This API function is called as the interrupt process corresponding to the voltage detection of VDD pin interrupt INTLVDVDD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvd_vddinterrupt

__interrupt static void r_lvd_vddinterrup ( void );

static void __near r_lvd_vddinterrup ( void );

Page 494: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 494 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the voltage detection of VBAT pin interrupt INTLVDVBAT.

Remark This API function is called as the interrupt process corresponding to the voltage detection of VBAT pin interrupt INTLVDVBAT.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvd_vbatinterrupt

__interrupt static void r_lvd_vbatinterrup ( void );

static void __near r_lvd_vbatinterrup ( void );

Page 495: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 495 of 642Feb 01, 2018

Performs processing in response to the voltage detection of VRTC pin interrupt INTLVDVRTC.

Remark This API function is called as the interrupt process corresponding to the voltage detection of VRTC pin interrupt INTLVDVRTC.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvd_vrtcinterrupt

__interrupt static void r_lvd_vrtcinterrup ( void );

static void __near r_lvd_vrtcinterrup ( void );

Page 496: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 496 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the voltage detection of EXLVD pin interrupt INTLVDEXLVD.

Remark This API function is called as the interrupt process corresponding to the voltage detection of EXLVD pin interrupt INTLVDEXLVD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvd_exlvdinterrupt

__interrupt static void r_lvd_exlvdinterrup ( void );

static void __near r_lvd_exlvdinterrup ( void );

Page 497: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 497 of 642Feb 01, 2018

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_InterruptMode_Start

void R_LVD_InterruptMode_Start ( void );

Page 498: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 498 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of VDD pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Start_VDD

void R_LVD_Start_VDD ( void );

Page 499: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 499 of 642Feb 01, 2018

Enables operation of VBAT pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Start_VBAT

void R_LVD_Start_VBAT ( void );

Page 500: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 500 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of VRTC pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Start_VRTC

void R_LVD_Start_VRTC ( void );

Page 501: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 501 of 642Feb 01, 2018

Enables operation of EXLVD pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Start_EXLVD

void R_LVD_Start_EXLVD ( void );

Page 502: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 502 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of VDD pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Stop_VDD

void R_LVD_Stop_VDD ( void );

Page 503: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 503 of 642Feb 01, 2018

Disables operation of VBAT pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Stop_VBAT

void R_LVD_Stop_VBAT ( void );

Page 504: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 504 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operation of VRTC pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Stop_VRTC

void R_LVD_Stop_VRTC ( void );

Page 505: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 505 of 642Feb 01, 2018

Disables operation of EXLVD pin voltage detection.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVD_Stop_EXLVD

void R_LVD_Stop_EXLVD ( void );

Page 506: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 506 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the voltage detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVI_Create

void R_LVI_Create ( void );

Page 507: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 507 of 642Feb 01, 2018

Performs user-defined initialization relating to the voltage detector.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVI_Create_UserInit

void R_LVI_Create_UserInit ( void );

Page 508: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 508 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the voltage detection interrupt INTLVI.

Remark This API function is called as the interrupt process corresponding to the voltage detection interrupt INTLVI.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_lvi_interrupt

__interrupt static void r_lvi_interrupt ( void );

static void __near r_lvi_interrupt ( void );

Page 509: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 509 of 642Feb 01, 2018

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_LVI_InterruptMode_Start

void R_LVI_InterruptMode_Start ( void );

Page 510: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 510 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.41 Battery backup function

Below is a list of API functions output by the Code Generator for battery backup function use.

Table 3.41 API Functions: [Battery Backup Function]

API Function Name Function

R_BUP_Create Performs initialization necessary to control the battery backup function.

R_BUP_Create_UserInit Performs user-defined initialization relating to the battery backup function.

r_bup_interrupt Performs processing in response to the power switching detection inter-rupt INTVBAT.

R_BUP_Start Enables operation of battery backup function.

R_BUP_Stop Disables operation of battery backup function.

Page 511: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 511 of 642Feb 01, 2018

Performs initialization necessary to control the battery backup function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BUP_Create

void R_BUP_Create ( void );

Page 512: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 512 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the battery backup function.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BUP_Create_UserInit

void R_BUP_Create_UserInit ( void );

Page 513: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 513 of 642Feb 01, 2018

Performs processing in response to the power switching detection interrupt INTVBAT.

Remark This API function is called as the interrupt process corresponding to the power switching detection inter-rupt INTVBAT.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_bup_interrupt

__interrupt static void r_bup_interrupt ( void );

static void __near r_bup_interrupt ( void );

Page 514: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 514 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of battery backup function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BUP_Start

void R_BUP_Start ( void );

Page 515: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 515 of 642Feb 01, 2018

Disables operation of battery backup function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_BUP_Stop

void R_BUP_Stop ( void );

Page 516: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 516 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.42 Oscillation stop detector

Below is a list of API functions output by the Code Generator for oscillation stop detector use.

Table 3.42 API Functions: [Oscillation Stop Detector]

API Function Name Function

R_OSDC_Create Performs initialization necessary to control the oscillation stop detector.

R_OSDC_Create_UserInit Performs user-defined initialization relating to the oscillation stop detector.

r_osdc_interrupt Performs processing in response to the oscillation stop detection inter-rupt INTOSDC.

R_OSDC_Start Enables operation of oscillation stop detector.

R_OSDC_Stop Disables operation of oscillation stop detector.

R_OSDC_Set_PowerOff Halts the clock supplied to the oscillation stop detector.

R_OSDC_Reset Reset the oscillation stop detector.

Page 517: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 517 of 642Feb 01, 2018

Performs initialization necessary to control the oscillation stop detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Create

void R_OSDC_Create ( void );

Page 518: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 518 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the oscillation stop detector.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Create_UserInit

void R_OSDC_Create_UserInit ( void );

Page 519: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 519 of 642Feb 01, 2018

Performs processing in response to the oscillation stop detection interrupt INTOSDC.

Remark This API function is called as the interrupt process corresponding to the oscillation stop detection inter-rupt INTOSDC.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_osdc_interrupt

__interrupt static void r_osdc_interrupt ( void );

static void __near r_osdc_interrupt ( void );

Page 520: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 520 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of oscillation stop detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Start

void R_OSDC_Start ( void );

Page 521: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 521 of 642Feb 01, 2018

Disables operation of oscillation stop detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Stop

void R_OSDC_Stop ( void );

Page 522: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 522 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the oscillation stop detector.

Remark Calling this API function changes the oscillation stop detector to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Set_PowerOff

void R_OSDC_Set_PowerOff ( void );

Page 523: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 523 of 642Feb 01, 2018

Reset the oscillation stop detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OSDC_Reset

void R_OSDC_Reset ( void );

Page 524: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 524 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.43 SPI interface

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

Table 3.43 API Functions: [SPI Interface]

API Function Name Function

R_SAIC_Create Performs initialization necessary to control the SPI interface.

R_SAIC_Create_UserInit Performs user-defined initialization relating to the SPI interface.

R_SAIC_Write Starts SPI data transmission.

R_SAIC_Read Starts SPI data reception.

R_SPI_Create Performs initialization necessary to control the SPI interface.

R_SPI_Create_UserInit Performs user-defined initialization relating to the SPI interface.

R_SPI_Write Starts SPI data transmission.

R_SPI_Read Starts SPI data reception.

Page 525: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 525 of 642Feb 01, 2018

Performs initialization necessary to control the SPI interface.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SAIC_Create

void R_SAIC_Create ( void );

Page 526: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 526 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the SPI interface.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SAIC_Create_UserInit

void R_SAIC_Create_UserInit ( void );

Page 527: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 527 of 642Feb 01, 2018

Starts SPI data transmission.

[Syntax]

[Argument(s)]

[Return value]

None.

R_SAIC_Write

void R_SAIC_Write ( const smartanalog_t * p_saic_data );

I/O Argument Description

I const smartanalog_t * p_saic_data;

Pointer to area storing the transmission data

Page 528: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 528 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts SPI data reception.

[Syntax]

[Argument(s)]

[Return value]

None.

R_SAIC_Read

void R_SAIC_Read ( const smartanalog_t * p_saic_data, smartanalog_t * p_saic_read_buf );

I/O Argument Description

O const smartanalog_t * p_saic_data;

Pointer to area to store the received data

O smartanalog_t * p_saic_read_buf;

Pointer to a buffer to store the received data

Page 529: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 529 of 642Feb 01, 2018

Performs initialization necessary to control the SPI interface.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SPI_Create

void R_SPI_Create ( void );

Page 530: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 530 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the SPI interface.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SPI_Create_UserInit

void R_SPI_Create_UserInit ( void );

Page 531: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 531 of 642Feb 01, 2018

Starts SPI data transmission.

[Syntax]

[Argument(s)]

[Return value]

None.

R_SPI_Write

void R_SPI_Write ( const smartanalog_t * p_saic_data );

I/O Argument Description

I const smartanalog_t * p_saic_data;

Pointer to area storing the transmission data

Page 532: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 532 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts SPI data reception.

[Syntax]

[Argument(s)]

[Return value]

None.

R_SPI_Read

void R_SPI_Read ( const smartanalog_t * p_saic_data, smartanalog_t * p_saic_read_buf );

I/O Argument Description

O const smartanalog_t * p_saic_data;

Pointer to area to store the received data

O smartanalog_t * p_saic_read_buf;

Pointer to a buffer to store the received data

Page 533: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 533 of 642Feb 01, 2018

3.2.44 Operational amplifier

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

Table 3.44 API Functions: [Operational amplifier]

API Function Name Function

R_OPAMP_Create Performs initialization necessary to control the operational amplifier.

R_OPAMP_Create_UserInit Performs user-defined initialization relatede to the operational amplifier.

R_OPAMP_Set_ReferenceCurcuitOn Enables operational amplifier reference current circuit.

R_OPAMP_Set_ReferenceCircuitOff Disables operational amplifier reference current circuit.

R_OPAMPn_Start Starts operational amplifier of unit n.

R_OPAMPn_Stop Stops operational amplifier of unit n.

R_OPAMPn_Set_PrechargeOn Starts precharging of the external capacitor of the operational amplifier n.

R_OPAMPn_Set_PrechargeOff Performs user-defined initialization relatede to the operational amplifier.

Page 534: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 534 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the operational amplifier.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OPAMP_Create

void R_OPAMP_Create ( void );

Page 535: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 535 of 642Feb 01, 2018

Performs user-defined initialization relating to the operational amplifier.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OPAMP_Create_UserInit

void R_OPAMP_Create_UserInit ( void );

Page 536: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 536 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operational amplifier reference current circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OPAMP_Set_ReferenceCurcuitOn

void R_OPAMP_Set_ReferenceCircuitOn ( void );

Page 537: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 537 of 642Feb 01, 2018

Disables operational amplifier reference current circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OPAMP_Set_ReferenceCircuitOff

void R_OPAMP_Set_ReferenceCircuitOff ( void );

Page 538: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 538 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts operational amplifier of unit n.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPn_Start

void R_OPAMPn_Start ( void );

Page 539: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 539 of 642Feb 01, 2018

Stops operational amplifier of unit n.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPn_Stop

void R_OPAMPn_Stop ( void );

Page 540: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 540 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts precharging of the external capacitor of the operational amplifier n.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPn_Set_PrechargeOn

void R_OPAMPn_Set_PrechargeOn ( void );

Page 541: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 541 of 642Feb 01, 2018

Stops precharging of the external capacitor of the operational amplifier n.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPn_Set_PrechargeOff

void R_OPAMPn_Set_PrechargeOff ( void );

Page 542: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 542 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.45 Data operation circuit

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

Table 3.45 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 related to the data operation circuit.

r_doc_interrupt Performs processing in response to the DOC operation result detection interrupt INTDOC.

R_DOC_SetMode Configures the operation mode of data operation circuit.

R_DOC_WriteData Writes new data to compare, add or subtract.

R_DOC_GetResult Gets result of addition or subtraction.

R_DOC_ClearFlag Clears DOPCF flag of DOC control register (DOCR).

R_DOC_Set_PowerOff Stops the clock supplied for data operation circuit.

R_DOC_Reset Resets Data opration circuit module.

Page 543: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 543 of 642Feb 01, 2018

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 544: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 544 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

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 545: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 545 of 642Feb 01, 2018

Performs processing in response to the data operation circuit interrupt INTDOC.

Remark This API function is called as the interrupt process corresponding to the data operation circuit interrupt INTDOC.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_doc_interrupt

__interrupt static void r_doc_interrupt ( void );

static void __near r_doc_interrupt ( void );

Page 546: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 546 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Configures the operation mode of data operation circuit.

[Syntax]

[Argument(s)]

[Return value]

R_DOC_SetMode

#include “r_cg_macrodriver.h”#include “r_cg_doc.h”MD_STATUS R_DOC_SetMode ( doc_mode_t mode, uint16_t value);

I/O Argument Description

I doc_mode_t mode; Operation mode of data operation circuitADDTION: Data addition modeSUBTRACTION: Data subtraction modeCOMPARE_MATCH: Data comparison mode (Detection Condition: Data match is detected)COMPARE_MISMATCH: Data subtraction mode (Detection Condition: Data mismatch is detected)

I uint16_t value; Data addition and data subtraction : Results of operationsData comparison : 16-bit data for use as a reference

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 547: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 547 of 642Feb 01, 2018

Writes new data to compare, add or subtract.

Remark Write data to DODIR register.

[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

O uint16_t data; data to compare, add or subtract

Page 548: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 548 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Gets result of addition or subtraction.

[Syntax]

[Argument(s)]

[Return value]

None.

R_DOC_GetResult

#include “r_cg_macrodriver.h”void R_DOC_GetResult ( uint16_t *const data );

I/O Argument Description

O uint16_t *const data pointer to where result will be stored

Page 549: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 549 of 642Feb 01, 2018

Clears DOPCF flag of DOC control register (DOCR).

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_ClearFlag

void R_DOC_ClearFlag ( void );

Page 550: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 550 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Stops the clock supplied for data operation circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_Set_PowerOff

void R_DOC_Set_PowerOff ( void );

Page 551: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 551 of 642Feb 01, 2018

Resets Data operation circuit module.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_DOC_Reset

void R_DOC_Reset ( void );

Page 552: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 552 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.46 32-bit Multiply-accumulator

Below is a list of API functions output by the Code Generator for 32-bit Multiply-accumulator use.

Table 3.46 API Functions: [32-bit Multiply-accumulator]

API Function Name Function

R_MAC32Bit_Create Performs initialization necessary to control the data operation circuit.

R_MAC32Bit_Create_UserInit Performs user-defined initialization related to the data operation circuit.

r_mac32bit_interrupt_flow Performs processing in response to the DOC operation result detection interrupt INTDOC.

R_MAC32Bit_Reset Gets result of addition or subtraction.

R_MAC32Bit_Set_PowerOff Clears DOPCF flag of DOC control register (DOCR).

R_MAC32bit_MULUnsigned Operates the unsigned multiply.

R_MAC32Bit_MULSigned Operates the signed multiply.

R_MAC32Bit_MACUnsigned Operates the unsigned multiply-accumulate.

R_MAC32Bit_MACSigned Operates the signed multiply-accumulate.

Page 553: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 553 of 642Feb 01, 2018

Performs initialization necessary to control the 32-bit Multiply-accumulator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MAC32Bit_Create

void R_MAC32Bit_Create ( void );

Page 554: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 554 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the 32-bit Multiply-accumulator.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MAC32Bit_Create_UserInit

void R_MAC32Bit_Create_UserInit ( void );

Page 555: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 555 of 642Feb 01, 2018

Performs processing in response to the 32-bit Multiply-accumulator interrupt INTMACLOF.

Remark This API function is called as the interrupt process corresponding to the 32-bit Multiply-accumulator inter-rupt INTMACLOF.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_mac32bit_interrupt_flow

__interrupt static void r_mac32bit_interrupt_flow ( void );

static void __near r_mac32bit_interrupt_flow ( void );

Page 556: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 556 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Resets the 32-bit Multiply-accumulator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MAC32Bit_Reset

void R_MAC32Bit_Reset ( void );

Page 557: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 557 of 642Feb 01, 2018

Stops the cock supplied for the 32-bit Multiply-accumulator.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_MAC32Bit_Set_PowerOff

void R_MAC32Bit_Set_PowerOff ( void );

Page 558: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 558 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Operates the unsigned multiply.

[Syntax]

[Argument(s)]

Remark Below is an example of the structure mac32bit_uint64_t for the multiplier result.

[Return value]

None.

R_MAC32bit_MULUnsigned

#include “r_cg_macrodriver.h”#include “r_cg_mac32bit.h”void R_MAC32Bit_MULUnsigned(uint32_t data_a, uint32_t data_b, mac32bit_uint64_t * buffer_64bit);

I/O Argument Description

I uint32_t data_a Multiplicand

I uint32_t data_b Multiplier

O mac32bit_uint64_t * buffer_64bit

Multiplier result

typedef struct{ uint16_t low_low; uint16_t low_high; uint16_t high_low; uint16_t high_high;} mac32bit_uint64_t;

Page 559: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 559 of 642Feb 01, 2018

Operates the signed multiply.

[Syntax]

[Argument(s)]

Remark Below is an example of the structure mac32bit_int64_t for the multiplier result.

[Return value]

None.

R_MAC32Bit_MULSigned

#include “r_cg_macrodriver.h”#include “r_cg_mac32bit.h”void R_MAC32Bit_MULSigned(int32_t data_a, int32_t data_b, mac32bit_int64_t * buffer_64bit);

I/O Argument Description

I int32_t data_a Multiplicand

I int32_t data_b Multiplier

O mac32bit_int64_t * buffer_64bit

Multiplier result

typedef struct{ int16_t low_low; int16_t low_high; int16_t high_low; int16_t high_high;} mac32bit_int64_t;

Page 560: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 560 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Operates the unsigned multiply-accumulate.

[Syntax]

[Argument(s)]

Remark See R_MAC32bit_MULUnsigned for details about the mac32bit_uint64_t.

[Return value]

None.

R_MAC32Bit_MACUnsigned

#include “r_cg_macrodriver.h”#include “r_cg_mac32bit.h”void R_MAC32Bit_MACUnsigned(uint32_t data_a, uint32_t data_b, mac32bit_uint64_t * buffer_64bit);

I/O Argument Description

I uint32_t data_a Multiplicand

I uint32_t data_b Multiplier

O mac32bit_uint64_t * buffer_64bit

Accumulation initial value / Multiplier result

Page 561: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 561 of 642Feb 01, 2018

Operates the signed multiply-accumulate.

[Syntax]

[Argument(s)]

Remark See R_MAC32Bit_MULSigned for details about the mac32bit_int64_t.

[Return value]

None.

R_MAC32Bit_MACSigned

#include “r_cg_macrodriver.h”#include “r_cg_mac32bit.h”void R_MAC32Bit_MACSigned(int32_t data_a, int32_t data_b, mac32bit_int64_t * buffer_64bit);

I/O Argument Description

I int32_t data_a Multiplicand

I int32_t data_b Multiplier

O mac32bit_int64_t * buffer_64bit

Accumulation initial value / Multiplier result

Page 562: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 562 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.47 12-bit A/D converter

Below is a list of API functions output by the Code Generator for 12-bit A/D converter use.

Table 3.47 API Functions: [12-bit A/D Converter]

API Function Name Function

R_12ADC_Create Performs initialization necessary to control the 12-bit A/D converter.

R_12ADC_Create_UserInit Performs user-defined initialization relating to the 12-bit A/D converter.

r_12adc_interrupt Performs processing in response to the A/D conversion end interrupt INTAD.

R_12ADC_Start Starts A/D conversion.

R_12ADC_Stop Ends A/D conversion.

R_12ADC_Get_ValueResult Reads the results of A/D conversion (12 bits).

R_12ADC_Set_ADChannel Configures the analog voltage input pin for A/D conversion.

R_12ADC_TemperatureSensorOutput_On

Enables 12-bit A/D converter temperature sensor output circuit.

R_12ADC_TemperatureSensorOutput_Off

Disables12-bit A/D converter temperature sensor output circuit.

R_12ADC_InternalReferenceVoltage_On Enables 12-bit A/D converter reference voltage circuit.

R_12ADC_InternalReferenceVoltage_Off Disables12-bit A/D converter reference voltage circuit.

R_12ADC_Set_PowerOff Halts the clock supplied to the 12-bit A/D converter.

Page 563: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 563 of 642Feb 01, 2018

Performs initialization necessary to control the 12-bit A/D converter.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_Create

void R_12ADC_Create ( void );

Page 564: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 564 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the 12-bit A/D converter.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_Create_UserInit

void R_12ADC_Create_UserInit ( void );

Page 565: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 565 of 642Feb 01, 2018

Performs processing in response to the A/D conversion end interrupt INTAD.

Remark This API function is called as the interrupt process corresponding to the A/D conversion end interrupt INTAD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_12adc_interrupt

__interrupt static void r_12adc_interrupt ( void );

static void __near r_12adc_interrupt ( void );

Page 566: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 566 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts A/D conversion.

Remark About 1 micro second of stabilization time is required when changing the voltage converter from opera-tion stopped to operation enabled status.Consequently, about 1 micro second must be left free between the call to R_12ADC_Create and the call to this API function.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_Start

void R_12ADC_Start ( void );

Page 567: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 567 of 642Feb 01, 2018

Ends A/D conversion.

Remark The voltage converter continues to operate after the process of this API function completes.Consequently, to stop the operation of the voltage converter, you must call R_12ADC_Set_PowerOff after the process of this API function completes.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_Stop

void R_12ADC_Stop ( void );

Page 568: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 568 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Reads the results of A/D conversion (12 bits).

[Syntax]

[Argument(s)]

[Return value]

R_12ADC_Get_ValueResult

#include "r_cg_macrodriver.h"void R_12ADC_Get_ValueResult ( ad_channel_t channel, uint16_t * const buffer );

I/O Argument Description

I ad_channel_t channel Analog voltage input pin

O uint16_t * const buffer; Pointer to area in which to store read results of A/D conversion

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 569: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 569 of 642Feb 01, 2018

Configures the analog voltage input pin for A/D conversion.

Remark The value specified in argument channel is set to A/D channel select register A0 (ADANSA0) or A/D con-version extended input control register (ADEXICR).

[Syntax]

[Argument(s)]

Remark See the header file r_cg_12adc.h for details about the analog voltage input pin ADCHANNELn.

[Return value]

R_12ADC_Set_ADChannel

#include "r_cg_macrodriver.h"#include "r_cg_12adc.h"MD_STATUS R_12ADC_Set_ADChannel ( ad_sel_register_t register, uint16_t data );

I/O Argument Description

I ad_sel_register_t register; Set to selected registerSEL_ADANSA0: A/D channel select register A0 (ADANSA0)SEL_ADEXICR: A/D conversion extended input con-trol register (ADEXICR)

I uint16_t data; Set to selected register value

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 570: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 570 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables 12-bit A/D converter temperature sensor output circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_TemperatureSensorOutput_On

void R_12ADC_TemperatureSensorOutput_On ( void );

Page 571: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 571 of 642Feb 01, 2018

Disables 12-bit A/D converter temperature sensor output circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_TemperatureSensorOutput_Off

void R_12ADC_TemperatureSensorOutput_Off ( void );

Page 572: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 572 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables 12-bit A/D converter reference voltage circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_InternalReferenceVoltage_On

void R_12ADC_InternalReferenceVoltage_On ( void );

Page 573: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 573 of 642Feb 01, 2018

Disables 12-bit A/D converter reference voltage circuit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_InternalReferenceVoltage_Off

void R_12ADC_InternalReferenceVoltage_Off ( void );

Page 574: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 574 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 12-bit A/D converter.

Remark Calling this API function changes the A/D converter to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12ADC_Set_PowerOff

void R_12ADC_Set_PowerOff ( void );

Page 575: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 575 of 642Feb 01, 2018

3.2.48 12-bit D/A converter

Below is a list of API functions output by the Code Generator for 12-bit D/A converter use.

Table 3.48 API Functions: [12-bit D/A Converter]

API Function Name Function

R_12DA_Create Performs initialization necessary to control the 12-bit D/A converter.

R_12DA_Create_UserInit Performs user-defined initialization relating to the 12-bit D/A converter.

R_12DAn_Start Starts D/A conversion.

R_12DAn_Stop Ends D/A conversion.

R_12DA_Set_PowerOff Halts the clock supplied to the 12-bit D/A converter.

R_12DAn_Set_ConversionValue Sets the analog voltage output to the ANOn pin.

Page 576: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 576 of 642Feb 01, 2018

e2 studio 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_12DA_Create

void R_12DA_Create ( void );

Page 577: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 577 of 642Feb 01, 2018

Performs user-defined initialization relating to the 12-bit D/A converter.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12DA_Create_UserInit

void R_12DA_Create_UserInit ( void );

Page 578: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 578 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_12DAn_Start

void R_12DAn_Start ( void );

Page 579: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 579 of 642Feb 01, 2018

Ends D/A conversion.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_12DAn_Stop

void R_12DAn_Stop ( void );

Page 580: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 580 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the 12-bit D/A converter.

Remark Calling this API function changes the 12-bit D/A converter to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_12DA_Set_PowerOff

void R_12DA_Set_PowerOff ( void );

Page 581: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 581 of 642Feb 01, 2018

Sets the analog voltage output to the ANOn pin.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

R_12DAn_Set_ConversionValue

#include "r_cg_macrodriver.h"void R_12DAn_Set_ConversionValue ( uint16_t reg_value );

I/O Argument Description

I uint16_t reg_value; D/A conversion value.

Page 582: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 582 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.49 Operational amplifier and Analog switch

Below is a list of API functions output by the Code Generator for Operational Amplifier and Analog switch use.

Table 3.49 API Functions: [Operational amplifier and Analog switch]

API Function Name Function

R_AMPANSW_Create Performs initialization necessary to control the Operational amplifier and Analog switch.

R_AMPANSW_Create_UserInit Performs user-defined initialization relating to the Operational amplifier and Analog switch.

R_OPAMPm_Set_ReferenceCurcuitOn Enables operational amplifier reference current circuit.

R_OPAMPm_Set_ReferenceCircuitOff Disables operational amplifier reference current circuit.

R_OPAMPm_Start Starts operational amplifier of unit m.

R_OPAMPm_Stop Stops operational amplifier of unit m.

R_ANSW_ChargePumpm_On Enables analog switch of unit m.

R_ANSW_ChargePumpm_Off Disables analog switch of unit m.

Page 583: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 583 of 642Feb 01, 2018

Performs initialization necessary to control the Operational amplifier and Analog switch.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMPANSW_Create

void R_AMPANSW_Create ( void );

Page 584: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 584 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the Operational amplifier and Analog switch.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMPANSW_Create_UserInit

void R_AMPANSW_Create_UserInit ( void );

Page 585: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 585 of 642Feb 01, 2018

Enables operational amplifier reference current circuit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPm_Set_ReferenceCurcuitOn

void R_OPAMPm_Set_ReferenceCircuitOn ( void );

Page 586: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 586 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables operational amplifier reference current circuit.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPm_Set_ReferenceCircuitOff

void R_OPAMPm_Set_ReferenceCircuitOff ( void );

Page 587: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 587 of 642Feb 01, 2018

Starts operational amplifier of unit m.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPm_Start

void R_OPAMPm_Start ( void );

Page 588: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 588 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Stops operational amplifier of unit m.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_OPAMPm_Stop

void R_OPAMPm_Stop ( void );

Page 589: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 589 of 642Feb 01, 2018

Enables analog switch of unit m.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_ANSW_ChargePumpm_On

void R_ANSW_ChargePumpm_On ( void );

Page 590: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 590 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Disables analog switch of unit m.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_ANSW_ChargePumpm_Off

void R_ANSW_ChargePumpm_Off ( void );

Page 591: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 591 of 642Feb 01, 2018

3.2.50 Voltage reference

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

Table 3.50 API Functions: [Voltage Reference]

API Function Name Function

R_VR_Create Performs initialization necessary to control the Voltage reference.

R_VR_Create_UserInit Performs user-defined initialization relating to the Voltage reference.

R_VR_Start Enables operation of Voltage reference.

R_VR_Stop Disables operation of Voltage reference.

Page 592: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 592 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the Voltage reference.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_VR_Create

void R_VR_Create ( void );

Page 593: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 593 of 642Feb 01, 2018

Performs user-defined initialization relating to the Voltage referdetector.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_VR_Create_UserInit

void R_VR_Create_UserInit ( void );

Page 594: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 594 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables operation of Voltage reference.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_VR_Start

void R_VR_Start ( void );

Page 595: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 595 of 642Feb 01, 2018

Disables operation of Voltage reference.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_VR_Stop

void R_VR_Stop ( void );

Page 596: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 596 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.51 Sampling output timer detector

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

Table 3.51 API Functions: [Sampling output timer detector]

API Function Name Function

R_SMOTD_Create Performs initialization necessary to control the Sampling output timer detector.

R_SMOTD_Create_UserInit Performs user-defined initialization relating to the Sampling output timer detector.

r_smotd_counterA_interrupt Performs processing in response to the Sampling output timer interval interrupt INTSMOTA.

r_smotd_counterB_interrupt performs processing in response to the Sampling output timer compare match interrupt INTSMOTB.

r_smotd_smpn_interrupt Performs processing int response to the Sampling detector detection interrupt INTSMPn.

R_SMOTD_Start Starts Sampling output timer detector.

R_SMOTD_Stop Ends Sampling output timer detector.

R_SMOTD_Set_PowerOff Halts the clock supplied to the Sampling output timer detector.

Page 597: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 597 of 642Feb 01, 2018

Performs initialization necessary to control the Sampling output timer detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SMOTD_Create

void R_SMOTD_Create ( void );

Page 598: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 598 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization relating to the Sampling output timer detector.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SMOTD_Create_UserInit

void R_SMOTD_Create_UserInit ( void );

Page 599: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 599 of 642Feb 01, 2018

Performs processing in response to the Sampling output timer interval interrupt INTSMOTA.

Remark This API function is called as the interrupt process corresponding to the Sampling output timer interval interrupt INTSMOTA.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_smotd_counterA_interrupt

__interrupt static void r_smotd_counterA_interrupt ( void );

static void __near r_smotd_counterA_interrupt ( void );

Page 600: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 600 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the Sampling output timer compare match interrupt INTSMOTB.

Remark This API function is called as the interrupt process corresponding to the Sampling output timer compare match INTSMOTB.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_smotd_counterB_interrupt

__interrupt static void r_smotd_counterB_interrupt ( void );

static void __near r_smotd_counterB_interrupt ( void );

Page 601: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 601 of 642Feb 01, 2018

Performs processing in response to the Sampling detector detection interrupt INTSMPn.

Remark This API function is called as the interrupt process corresponding to the Sampling detector detection interrupt INTSMPn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the sampling input number.

[Argument(s)]

None.

[Return value]

None.

r_smotd_smpn_interrupt

__interrupt static void r_smotd_smpn_interrupt ( void );

static void __near r_smotd_smpn_interrupt ( void );

Page 602: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 602 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts Sampling output timer detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SMOTD_Start

void R_SMOTD_Start ( void );

Page 603: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 603 of 642Feb 01, 2018

Ends Sampling output timer detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SMOTD_Stop

void R_SMOTD_Stop ( void );

Page 604: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 604 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the Sampling output timer detector.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_SMOTD_Set_PowerOff

void R_SMOTD_Set_PowerOff ( void );

Page 605: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 605 of 642Feb 01, 2018

3.2.52 External signal sampler

Below is a list of API functions output by the Code Generator for External signal sampler use.

Table 3.52 API Functions: [External signal sampler]

API Function Name Function

R_EXSD_Create Performs initialization necessary to control the External signal sampler.

R_EXSD_Create_UserInit Performs user-defined initialization relating to the External signal sam-pler.

r_exsd_interrupt Performs processing in response to the External signal sampler edge detection interrupt INTEXSD.

R_EXSD_Start Starts External signal sampling.

R_EXSD_Stop Ends External signal sampling.

R_EXSD_Set_PowerOff Halts the clock supplied to the External signal sampler.

Page 606: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 606 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the External signal sampler.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_EXSD_Create

void R_EXSD_Create ( void );

Page 607: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 607 of 642Feb 01, 2018

Performs user-defined initialization relating to the External signal sampler.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_EXSD_Create_UserInit

void R_EXSD_Create_UserInit ( void );

Page 608: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 608 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the External signal sampler edge detection interrupt INTEXSD.

Remark This API function is called as the interrupt process corresponding to the External signal sampler edge detection interrupt INTEXSD.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

[Argument(s)]

None.

[Return value]

None.

r_exsd_interrupt

__interrupt static void r_exsd_interrupt ( void );

static void __near r_exsd_interrupt ( void );

Page 609: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 609 of 642Feb 01, 2018

Starts A/D External signal sanpling.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_EXSD_Start

void R_EXSD_Start ( void );

Page 610: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 610 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Ends External signal sampling.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_EXSD_Stop

void R_EXSD_Stop ( void );

Page 611: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 611 of 642Feb 01, 2018

Halts the clock supplied to the External signal sampler.

Remark Calling this API function changes the External signal sampler to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_EXSD_Set_PowerOff

void R_EXSD_Set_PowerOff ( void );

Page 612: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 612 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.53 Serial interface UARTMG

Below is a list of API functions output by the Code Generator for serial interface UARTMG use.

Table 3.53 API Functions: [Serial interface UARTMG]

API Function Name Function

R_UARTMGn_Create Performs initialization necessary to control the serial interface UARTMG.

R_UARTMGn_Create_UserInit Performs user-defined initialization related to the serial interface UARTMG.

r_uartmgn_interrupt_send Performs processing in response to the UARTMG transmissioncompletion interrupt INTSTMGn.

r_uartmgn_interrupt_receive Performs processing in response to the UARTMG reception completion interrupt INTSRMGn.

r_uartmgn_interrupt_error Perfomrs processing in response to the UARTMG reception errorinterrupt INTSREMGn.

R_UARTMGn_Start Sets UARTMG communication to standby mode..

R_UARTMGn_Stop Ends UARTMG communication.

R_UARTMGn_Set_PowerOff Halts the clock supplied to the serial interface UARTMG.

R_UARTMGn_Send Starts UARTMG data transmission.

R_UARTMGn_Receive Starts UARTMG data reception.

r_uartmgn_callback_sendend Performs processing in response to the UARTMG transmission comple-tion interrupt INTSTMGn.

r_uartn_callback_receiveend Performs processing in response to the UARTMG reception completion interrupt INTSRMGn.

r_uartmgn_callback_error Performs processing in response to the UARTMG reception error inter-rupt INTSREMGn.

r_uartmgn_callback_softwareoverrun Performs processing in response to detection of overrun error.

Page 613: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 613 of 642Feb 01, 2018

Performs initialization necessary to control the serial interface UARTMG.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTMGn_Create

void R_UARTMGn_Create ( void );

Page 614: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 614 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs user-defined initialization related to the serial interface UARTMG.

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

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTMGn_Create_UserInit

void R_UARTMGn_Create_UserInit ( void );

Page 615: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 615 of 642Feb 01, 2018

Performs processing in response to the UARTMG transmission completion interrupt INTSTMGn.

Remark This API function is called as the interrupt process corresponding to the UARTMG transmissioncompletion interrupt INTSTMGn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartmgn_interrupt_send

__interrupt static void r_uartmgn_interrupt_send ( void );

static void __near r_uartmgn_interrupt_send ( void );

Page 616: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 616 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the UARTMG reception completion interrupt INTSRMGn.

Remark This API function is called as the interrupt process corresponding to the UARMG reception completion interrupt INTSRMGn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartmgn_interrupt_receive

__interrupt static void r_uartmgn_interrupt_receive ( void );

static void __near r_uartmgn_interrupt_receive ( void );

Page 617: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 617 of 642Feb 01, 2018

Performs processing in response to the UARTMG reception error interrupt INTSREMGn.

Remark This API function is called as the interrupt process corresponding to the UARTMG reception errorinterrupt INTSREMGn.

[Syntax]

CA78K0R Compiler

CC-RL Compiler

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartmgn_interrupt_error

__interrupt static void r_uartmgn_interrupt_error ( void );

static void __near r_uartmgn_interrupt_error ( void );

Page 618: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 618 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Sets UARTMG communication to standby mode.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTMGn_Start

void R_UARTMGn_Start ( void );

Page 619: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 619 of 642Feb 01, 2018

Ends UARTMG communication.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTMGn_Stop

void R_UARTMGn_Stop ( void );

Page 620: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 620 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Halts the clock supplied to the serial interface UARTMG.

Remark Calling this API function changes the serial interface UARTMG to reset status.For this reason, writes to the control registers after this API function is called are ignored.

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

R_UARTMGn_Set_PowerOff

void R_UARTMGn_Set_PowerOff ( void );

Page 621: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 621 of 642Feb 01, 2018

Starts UARTMG data transmission.

Remarks 1. This API function repeats the byte-level UART transmission from the buffer specified in argument tx_buf the number of times specified in argument tx_num.

Remarks 2. When performing a UART transmission, R_UARTMGn_Start must be called before this API function is called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTMGn_Send

#include "r_cg_macrodriver.h"MD_STATUS R_UARTMGn_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 specification

Page 622: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 622 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts UARTMG data reception.

Remarks 1. This API function performs byte-level UART 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. Actual UART reception starts after this API function is called, and R_UARTMGn_Start is then called.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

R_UARTMGn_Receive

#include "r_cg_macrodriver.h"MD_STATUS R_UARTMGn_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 received data

I uint16_t rx_num; Total amount of data to receive

Macro Description

MD_OK Normal completion

MD_ARGERROR Invalid argument specification

Page 623: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 623 of 642Feb 01, 2018

Performs processing in response to the UARTMG transmission complition interrupt INTSTMGn.

Remark This API function is called as the callback routine of interrupt process r_uartmgn_interrupt_send corre-sponding to the UARTMG transmission completion interrupt INTSTMGn (performed when number of transmission data specified by R_UARTMGn_Send argument tx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartmgn_callback_sendend

static void r_uartmgn_callback_sendend ( void );

Page 624: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 624 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to the UARTMG reception completion interrupt INTSRMGn.

Remark This API function is called as the callback routine of interrupt process r_uartmgn_interrupt_receive corre-sponding to the UARTMG reception completion interrupt INTSRMGn (performed when number of received data specified by R_UARTMGn_Receive argument rx_num has been completed).

[Syntax]

Remark n is the channel number.

[Argument(s)]

None.

[Return value]

None.

r_uartn_callback_receiveend

static void r_uartmgn_callback_receiveend ( void );

Page 625: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 625 of 642Feb 01, 2018

Performs processing in response to the UARTMG reception error interrupt INTSREMGn.

Remark This API function is called as the callback routine of interrupt process r_uartmgn_interrupt_error corre-sponding to the UARTMG reception error interrupt INTSREMGn.

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_uartmgn_callback_error

#include "r_cg_macrodriver.h"static void r_uartn_callback_error ( uint8_t err_type );

I/O Argument Description

O uint8_t err_type; Trigger for UART reception error interrupt00000xx1B: Overrun error00000x1xB: Parity error000001xxB: Framing error

Page 626: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 626 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs processing in response to detection of overrun error.

Remark This API function is called as the callback routine of interrupt process r_uartmgn_interrupt_receive corre-sponding to the UARTMG reception end interrupt INTSRMGn (process performed when the amount of data received is greater than the argument rx_num specified for R_UARTMGn_Receive).

[Syntax]

Remark n is the channel number.

[Argument(s)]

[Return value]

None.

r_uartmgn_callback_softwareoverrun

#include "r_cg_macrodriver.h"static void r_uartmgn_callback_softwareoverrun ( uint16_t rx_data );

I/O Argument Description

O uint16_t rx_data; Receive data (greater than the argument rx_num specified for R_UARTMGn_Receive)

Page 627: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 627 of 642Feb 01, 2018

3.2.54 Amplifier unit

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

Table 3.54 API Functions: [Amplifier unit]

API Function Name Function

R_AMP_Create Performs initialization necessary to control the amplifier unit.

R_AMP_Create_UserInit Performs user-defined initialization relatede to the amplifie unit.

R_AMP_Set_PowerOn Enables amplifier unit power supply.

R_AMP_Set_PowerOff Disables amplifier unit power supply.

R_PGA1_Start Starts instrumentation amplifier 1.

R_OPAMPn_Stop Stops instrumentation amplifier 1.

R_AMPn_Start Starts operational amplifier n.

R_AMPn_Stop Stops operational amplifier n.

Page 628: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 628 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Performs initialization necessary to control the amplifier unit.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMP_Create

void R_AMP_Create ( void );

Page 629: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 629 of 642Feb 01, 2018

Performs user-defined initialization relating to the amplifier unit.

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

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMP_Create_UserInit

void R_AMP_Create_UserInit ( void );

Page 630: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 630 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Enables amplifier unit power supply.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMP_Set_PowerOn

void R_AMP_Set_PowerOn ( void );

Page 631: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 631 of 642Feb 01, 2018

Disables amplifier unit power supply.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_AMP_Set_PowerOff

void R_AMP_Set_PowerOff ( void );

Page 632: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 632 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts instrumentation amplifier 1.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_PGA1_Start

void R_PGA1_Start ( void );

Page 633: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 633 of 642Feb 01, 2018

Stops instrumentation amplifier 1.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_OPAMPn_Stop

void R_PGA1_Stop ( void );

Page 634: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 634 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts operational amplifier n.

[Syntax]

Remark n is the operational amplifier unit number.

[Argument(s)]

None.

[Return value]

None.

R_AMPn_Start

void R_AMPn_Start ( void );

Page 635: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 635 of 642Feb 01, 2018

Stops operational amplifier n.

[Syntax]

Remark n is the operational amplifier unit number.

[Argument(s)]

None.

[Return value]

None.

R_AMPn_Stop

void R_AMPn_Stop ( void );

Page 636: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 636 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

3.2.55 Data flash libraries

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

Table 3.55 API Functions: [Data Flash Libraries]

API Function Name Function

R_FDL_Create Performs initialization necessary to control the Data Flash Libraries.

R_FDL_Open Starts the Data Flash Libraries.

R_FDL_Close Stop the Data Flash Libraries.

R_FDL_Write Writes the data to Data Flash Memories.

R_FDL_Read Reads the data from Data Flash Memories.

R_FDL_Erase Erases data for Data Flash Memories.

Page 637: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 637 of 642Feb 01, 2018

Performs initialization necessary to control the Data Flash Libraries.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FDL_Create

void R_FDL_Create ( void );

Page 638: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 638 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Starts the Data Flash Libraries.

[Syntax]

[Argument(s)]

None.

[Return value]

None.

R_FDL_Open

void R_FDL_Open ( void );

Page 639: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 639 of 642Feb 01, 2018

Stops the Data Flash Libraries.

[Syntax]

Remark m is the unit number.

[Argument(s)]

None.

[Return value]

None.

R_FDL_Close

void R_SAUm_Reset ( void );

Page 640: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 640 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Writes the data to Data Flash Memories.

[Syntax]

Remark m is the unit number.

[Argument(s)]

[Return value]

R_FDL_Write

pfdl_status_t R_FDL_Write ( pfdl_u16 index, __near pfdl_u08 * buffer, pfdl_u16 bytecounter);

I/O Argument Description

I pfld_u16 index; Writing start address of Data Flash Memories

I pfdl_u08 * buffer; Pointer to a buffer to store the write data

I pfdl_u16 bytecounter; Total amount of data to wire

Macro Description

PFDL_OK Normal completion

PFDL_BUSY During execution of the other commands.

PFDL_ERR_WRITE Error of the writing

PFDL_ERR_PARAMETER Error of the parameters

Page 641: e studio Code Generator - renesas.com

e2 studio Code Generator Tool 3. API FUNCTIONS

R20UT3127EJ0105 Rev.1.05 Page 641 of 642Feb 01, 2018

Reads the data from Data Flash Memories.

[Syntax]

[Argument(s)]

[Return value]

R_FDL_Read

pfdl_status_t R_FDL_Read ( pfdl_u16 index, __near pfdl_u08 * buffer, pfdl_u16 bytecounter );

I/O Argument Description

I pfdl_u16 index; Reading start address of the Data Flash Memories

O pfdl_u08 * buffer; Pointer to a buffer to store the read data

I uint16_t tx_num; Total amount of data to read

Macro Description

PFDL_OK Normal completion

PFDL_BUSY During execution of the other commands.

PFDL_ERR_PARAMETER Error of the parameters

Page 642: e studio Code Generator - renesas.com

R20UT3127EJ0105 Rev.1.05 Page 642 of 642Feb 01, 2018

e2 studio Code Generator Tool 3. API FUNCTIONS

Erases the block of Data Flash Memories.

[Syntax]

[Argument(s)]

[Return value]

R_FDL_Erase

void R_FDL_Erase ( pfdl_u16 blockno );

I/O Argument Description

I pfdl_u16 blockno; Erase no block for Data Flash Memories

Macro Description

PFDL_OK Normal completion

PFDL_ERR_ERASE Error of the erasing

PFDL_ERR_PARAMETER Error of the parameters

Page 643: e studio Code Generator - renesas.com

C - 1

Revision Record

Rev. Date Description

Page Summary

1.00 Aug 01, 2015 First Edition issued

1.01 Dec 01, 2014 2. OUTPUT FILESTimerRJ, TimerRD API addition

2. OUTPUT FILESComparator/Programmable gain amplifier API addition

3.2.5 Timer RJAPI addition

3.2.6 Timer RDAPI addition

3.2.24 Comparator/Programmable gain amplifier chapter addition

1.02 Aug 01, 2015 2. OUTPUT FILESAPI addition・Timer RX・PGA+DS A/D converter・Configurable Amp・D/A converter・Voltage detector

98 - 105

3.2.8 Timer RXchapter addition

208 - 218

3.2.19 PGA+DS A/D converterchapter addition

235 - 240

3.2.21 Configurable Ampchapter addition

265 - 266

3.2.24 D/A converter

API addition

439 - 442

3.2.39 Voltage detectorAPI addition

1.03 Mar 01, 2016 7,11,13,16,17,18,

19

2. OUTPUT FILESAPI addition・High-speed on-chip Oscillator clock Frequency Correction function・Real-time clock・Temperature sensor・24-bit DS A/D converter・Serial interface IICA・Interrupt functions・Voltage detector・Oscillation stop detector・32-bit Multiply-accumulator

44 -49

3.2.4 High-speed on-chip Oscillator clock Frequency Correction functionchapter addition

166 -190

3.2.13 Real-time clockAPI addition

271 3.2.23 Temperature sensorAPI addition

Page 644: e studio Code Generator - renesas.com

C - 2

282 3.2.24 24-bit DS A/D converterAPI addition

323 3.2.32 Serial interface IICAAPI addition

457 -459

3.2.38 Interrupt functionsAPI addition

470 -482

3.2.40 Voltage detectorAPI addition

500 3.2.42 Oscillation stop detectorAPI addition

525 -534

3.2.46 32-bit Multiply-accumulatorchapter addition

1.04 2016.10.01 8, 9, 11, 13,

14, 16, 17

2. OUTPUT FILESAPI addition・Timer array unit(R_TAUmReset)・16-bit timer KB(R_TMR_KBm_ForcedOutput_mn_Start,R_TMR_KBm_ForcedOutput_mn_Stop, R_TMR_KBm_Reset)・A/D converter(R_ADC_Reset)・D/A converter(R_DACn_Create, R_DAC_Reset)・Programmable gain amplifier(R_PGA_Reset)・LCD controller/driver(R_LCD_VoltageOn, R_LCD_VoltageOff)・Interrupt functions(R_INTFO_Start, R_INTFO_Stop, R_INTFO_ClearFlag,r_intfo_interrupt)

9, 17 2. OUTPUT FILESFile addition・16-bit timer KB(r_cg_tmkb.c, r_cg_tmb_user.c, r_cg_tmkb.h)・Key interrupt function(r_cg_key.c, r_cg_key_user.c, r_cg_key.h)

19, 20 2. OUTPUT FILESFunction additional・12-bit A/D converter・12-bit D/A converter・Operational amplifier and Analog switch・Voltage reference

22 Table 3.1.) API Functions: [Common]Note update・hdwinit

23, 24 3.2.1. CommonNote update・hdwinit・R_Systeminit

115, 125-127

3.2.10.16-bit timer KBAPI addition・R_TMR_KBm_ForcedOutput_mn_Start・R_TMR_KBm_ForcedOutput_mn_Stop・R_TMR_KBm_Reset

286, 295-296

3.2.25.D/A converterAPI addition・R_DACn_Create・R_DAC_Reset

Rev. Date Description

Page Summary

Page 645: e studio Code Generator - renesas.com

C - 3

295, 300

3.2.26.Programmable gain amplifierAPIaddition・R_PGA_Reset

414, 423-424

3.2.33.LCD controller/driverAPI addition・R_LCD_VoltageOn・R_LCD_VoltageOff

448, 460-463

3.2.38.Interrupt functionsAPI addition・R_INTFO_Start・R_INTFO_Stop・R_INTFO_ClearFlag・r_intfo_interrupt

536-547

3.2.47.12-bit A/D converterchapter additionAPI addition・R_12ADC_Create・R_12ADC_Create_UserInit・r_12adc_interrupt・R_12ADC_Start・R_12ADC_Stop・R_12ADC_Get_ValueResult・R_12ADC_Set_ADChannel・R_12ADC_TemperatureSensorOutput_On・R_12ADC_TemperatureSensorOutput_Off・R_12ADC_InternalReferenceVoltage_On・R_12ADC_InternalReferenceVoltage_Off・R_12ADC_Set_PowerOff

551-557

3.2.48.12-bit D/A converterchapter additionAPI addition・R_12DA_Create・R_12DA_Create_UserInit・R_12DAn_Start・R_12DAn_Stop・R_12DAn_Set_ConversionValue・R_12DA_Set_PowerOff

561-569

3.2.49.Operational amplifier and Analog switchchapter additionAPI addition・R_AMPANSW_Create・R_AMPANSW_Create_UserInit・R_OPAMPm_Set_ReferenceCircuitOn・R_OPAMPm_Set_ReferenceCircuitOff・R_OPAMPm_Start・R_OPAMPm_Stop・R_ANSW_ChargePumpm_On・R_ANSW_ChargePumpm_Off

Rev. Date Description

Page Summary

Page 646: e studio Code Generator - renesas.com

C - 4

571-575

3.2.50.Voltage referencechapter additionAPI addition・R_VR_Create・R_VR_Create_UserInit・R_VR_Start・R_VR_Stop

11 2. OUTPUT FILESNote update・R_RTC_Set_BinaryAlarmValue to R_RTC_Set_BinaryAlarmOn

11, 162, 198

3.2.13. Real-time clockAPI addition・r_rtc_callback_periodic

11 2. OUTPUT FILESAPI addition・R_IT_Set_PowerOff

14, 303, 309

3.2.26. Programmable gain amplifierAPI addition・R_PGA_Set_PowerOff

15 2. OUTPUT FILESAPI addition・R_SAUm_Reset

405, 413, 418

3.2.32. Serial interface IICANote update・R_IICAn_StopCondition・r_iican_callback_master_error・r_iican_callback_slave_error

1.05 2018.02.01 67-81 3.2.6 Timer RJAPI name update・R_TMR_RJn_Create・R_TMR_RJn_Start・R_TMR_RJn_Stop・R_TMR_RJn_Set_PowerOff・R_TMR_RJn_Get_PulseWidth・R_TMR_RJn_Create_UserInit・r_tmr_rjn_interrupt・R_TMRJn_Create・R_TMRJn_Start・R_TMRJn_Stop・R_TMRJn_Set_PowerOff・R_TMRJn_Get_PulseWidth・R_TMRJn_Create_UserInit・r_tmrjn_interrupt

82,101

3.2.7 Timer RDAPI addition・R_TMRD_Set_PowerOff

215,222

3.2.16 8-bit interval timerAPI addition・R_IT8bitm_set_PowerOff

Rev. Date Description

Page Summary

Page 647: e studio Code Generator - renesas.com

C - 5

241,252,253

3.2.20 24-bit DS A/D converter with programmable gain instrumentation amplifierAPI addition・r_pga_dsad_conversion_interrupt・r_pga_dsad_scan_interrupt

296,307

3.2.25 D/A converterAPI addition・R_DACn_Create_UserInit

455,461,462

3.2.36 Data transfer controllerAPI addition・R_DTCDn_Start・R_DTCDn_Stop

524,529-532

3.2.43 SPI interfaceAPI addition・R_SPI_Create・R_SPI_Start・R_SPI_Stop・R_SPI_Create_UserInit

596-604

3.2.51 Sampling output timer detectorChapter additionAPI addition・R_SMOTD_Create・R_SMOTD_Start・R_SMOTD_Stop・R_SMOTD_Set_PowerOff・R_SMOTD_Create_UserInit・r_smotd_counterA_interrupt・r_smotd_counterB_interrupt・r_smotd_smpn_interrupt

605-611

3.2.52 External signal samplerChapter additionAPI addition・R_EXSD_Create・R_EXSD_Start・R_EXSD_Stop・R_EXSD_Set_PowerOff・R_EXSD_Create_UserInit・r_exsd_interrupt

612-626

3.2.53 Serial interface UARTMGChapter additionAPI addition・R_UARTMGn_Create・R_UARTMGn_Start・R_UARTMGn_Stop・R_UARTMGn_Set_PowerOff・R_UARTMGn_Send・R_UARTMGn_Receive・R_UARTMGn_Create_UserInit・r_uartmgn_interrupt_send・r_uartmgn_interrupt_receive・r_uartmgn_interrupt_error・r_uartmgn_callback_sendend・r_uartmgn_callback_receiveend・r_uartmgn_callback_error・r_uartmgn_callback_softwareoverrun

Rev. Date Description

Page Summary

Page 648: e studio Code Generator - renesas.com

C - 6

627-635

3.2.54 Amplifier unitChapter additionAPI addition・R_AMP_Create・R_PGA1_Start・R_PGA1_Stop・R_AMPn_Start・R_AMPn_Stop・R_AMP_Set_PowerOn・R_AMP_Set_PowerOff・R_AMP_Create_UserInit

636-642

3.2.55 Data flash librariesChapter additionAPI addition・R_FDL_Create・R_FDL_Open・R_FDL_Close・R_FDL_Write・R_FDL_Read・R_FDL_Erase

Rev. Date Description

Page Summary

Page 649: e studio Code Generator - renesas.com

e2 studio Code Generator Tool User's Manual:RL78 API Reference

Publication Date: Rev.1.00 Aug 01, 2014Rev.1.05 Feb 01, 2018

Published by: Renesas Electronics Corporation

Page 650: e studio Code Generator - renesas.com

http://www.renesas.comRefer to "http://www.renesas.com/" for the latest and detailed information.

Renesas Electronics America Inc.1001 Murphy Ranch Road, Milpitas, CA 95035, U.S.A.Tel: +1-408-432-8888, Fax: +1-408-434-5351Renesas Electronics Canada Limited9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3Tel: +1-905-237-2004Renesas Electronics Europe LimitedDukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.KTel: +44-1628-651-700, Fax: +44-1628-651-804Renesas Electronics Europe GmbHArcadiastrasse 10, 40472 Düsseldorf, GermanyTel: +49-211-6503-0, Fax: +49-211-6503-1327Renesas 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-7679Renesas Electronics (Shanghai) Co., Ltd.Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, 200333 P. R. ChinaTel: +86-21-2226-0888, Fax: +86-21-2226-0999Renesas 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-9022Renesas Electronics Taiwan Co., Ltd.13F, No. 363, Fu Shing North Road, Taipei 10543, TaiwanTel: +886-2-8175-9600, Fax: +886 2-8175-9670Renesas Electronics Singapore Pte. Ltd.80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949Tel: +65-6213-0200, Fax: +65-6213-0300Renesas 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-9510Renesas Electronics India Pvt. Ltd.No.777C, 100 Feet Road, HAL 2nd Stage, Indiranagar, Bangalore 560 038, IndiaTel: +91-80-67208700, Fax: +91-80-67208777Renesas Electronics Korea Co., Ltd.17F, KAMCO Yangjae Tower, 262, Gangnam-daero, Gangnam-gu, Seoul, 06265 KoreaTel: +82-2-558-3737, Fax: +82-2-558-5338

SALES OFFICES

© 2018 Renesas Electronics Corporation. All rights reserved.Colophon 5.0

Page 651: e studio Code Generator - renesas.com

e2 studio Code Generator Tool

R20UT3127EJ0105