e2 studio Code Generator Integrated Development Environment

User’s Manual
e2 studio Code Generator
Integrated Development Environment
User's Manual: RL78 API Reference
Target Device
RL78 Family
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).
www.renesas.com
Rev.1.02
Oct 2015
Notice
1.
Descriptions of circuits, software and other related information in this document are provided only to illustrate the operation of
semiconductor products and application examples. You are fully responsible for the incorporation of these circuits, software,
and information in the design of your equipment. Renesas Electronics assumes no responsibility for any losses incurred by you
or third parties arising from the use of these circuits, software, or information.
2.
Renesas Electronics has used reasonable care in preparing the information included in this document, but Renesas Electronics
does not warrant that such information is error free. Renesas Electronics assumes no liability whatsoever for any damages
incurred by you resulting from errors in or omissions from the information included herein.
3.
Renesas Electronics does not assume any liability for infringement of patents, copyrights, or other intellectual property rights of
third parties by or arising from the use of Renesas Electronics products or technical information described in this document. No
license, express, implied or otherwise, is granted hereby under any patents, copyrights or other intellectual property rights of
Renesas Electronics or others.
4.
You should not alter, modify, copy, or otherwise misappropriate any Renesas Electronics product, whether in whole or in part.
Renesas Electronics assumes no responsibility for any losses incurred by you or third parties arising from such alteration,
modification, copy or otherwise misappropriation of Renesas Electronics product.
5.
Renesas Electronics products are classified according to the following two quality grades: “Standard” and “High Quality”. The
recommended applications for each Renesas Electronics product depends on the product’s quality grade, as indicated below.
“Standard”:
Computers; office equipment; communications equipment; test and measurement equipment; audio and visual
equipment; home electronic appliances; machine tools; personal electronic equipment; and industrial robots etc.
“High Quality”: Transportation equipment (automobiles, trains, ships, etc.); traffic control systems; anti-disaster systems; anticrime systems; and safety equipment etc.
Renesas Electronics products are neither intended nor authorized for use in products or systems that may pose a direct threat to
human life or bodily injury (artificial life support devices or systems, surgical implantations etc.), or may cause serious property
damages (nuclear reactor control systems, military equipment etc.). You must check the quality grade of each Renesas
Electronics product before using it in a particular application. You may not use any Renesas Electronics product for any
application for which it is not intended. Renesas Electronics shall not be in any way liable for any damages or losses incurred
by you or third parties arising from the use of any Renesas Electronics product for which the product is not intended by Renesas
Electronics.
6.
You should use the Renesas Electronics products described in this document within the range specified by Renesas Electronics,
especially with respect to the maximum rating, operating supply voltage range, movement power voltage range, heat radiation
characteristics, installation and other product characteristics. Renesas Electronics shall have no liability for malfunctions or
damages arising out of the use of Renesas Electronics products beyond such specified ranges.
7.
Although Renesas Electronics endeavors to improve the quality and reliability of its products, semiconductor products have
specific characteristics such as the occurrence of failure at a certain rate and malfunctions under certain use conditions. Further,
Renesas Electronics products are not subject to radiation resistance design. Please be sure to implement safety measures to
guard them against the possibility of physical injury, and injury or damage caused by fire in the event of the failure of a Renesas
Electronics product, such as safety design for hardware and software including but not limited to redundancy, fire control and
malfunction prevention, appropriate treatment for aging degradation or any other appropriate measures. Because the evaluation
of microcomputer software alone is very difficult, please evaluate the safety of the final products or systems manufactured by
you.
8.
Please contact a Renesas Electronics sales office for details as to environmental matters such as the environmental compatibility
of each Renesas Electronics product. Please use Renesas Electronics products in compliance with all applicable laws and
regulations that regulate the inclusion or use of controlled substances, including without limitation, the EU RoHS Directive.
Renesas Electronics assumes no liability for damages or losses occurring as a result of your noncompliance with applicable laws
and regulations.
9.
Renesas Electronics products and technology may not be used for or incorporated into any products or systems whose
manufacture, use, or sale is prohibited under any applicable domestic or foreign laws or regulations. You should not use
Renesas Electronics products or technology described in this document for any purpose relating to military applications or use
by the military, including but not limited to the development of weapons of mass destruction. When exporting the Renesas
Electronics products or technology described in this document, you should comply with the applicable export control laws and
regulations and follow the procedures required by such laws and regulations.
10. It is the responsibility of the buyer or distributor of Renesas Electronics products, who distributes, disposes of, or otherwise
places the product with a third party, to notify such third party in advance of the contents and conditions set forth in this
document, Renesas Electronics assumes no responsibility for any losses incurred by you or third parties as a result of
unauthorized use of Renesas Electronics products.
11. This document may not be reproduced or duplicated in any form, in whole or in part, without prior written consent of Renesas
Electronics.
12. Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document
or Renesas Electronics products, or if you have any other inquiries.
(Note 1) “Renesas Electronics” as used in this document means Renesas Electronics Corporation and also includes its majorityowned subsidiaries.
(Note 2) “Renesas Electronics product(s)” means any product developed or manufactured by or for Renesas Electronics.
(2012.4)
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.GENERAL
2.OUTPUT FILES
3.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 ... XXXX
Hexadecimal ... 0xXXXX
All trademarks or registered trademarks in this document are the property of their respective owners.
TABLE OF CONTENTS
1.
GENERAL . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
1.2
Features. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 6
2.
OUTPUT FILES . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
2.1
3.
Description . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7
API FUNCTIONS . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.1
Overview . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2
Function Reference . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
3.2.1
Common . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
3.2.2
Clock generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
3.2.3
Port functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 38
3.2.4
Timer array unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41
3.2.5
Timer RJ . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 56
3.2.6
Timer RD . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 71
3.2.7
Timer RG . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 90
3.2.8
Timer RX. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 98
3.2.9
16-bit timer KB . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 106
3.2.10
16-bit timer KC0 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 116
3.2.11
16-bit timer KB2 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 123
3.2.12
Real-time clock . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 147
3.2.13
Subsystem clock frequency measurement circuit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 168
3.2.14
12-bit interval timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 175
3.2.15
8-bit interval timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 183
3.2.16
16-bit wakeup timer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 190
3.2.17
Clock output/buzzer output controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 197
3.2.18
Watchdog timer. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 203
3.2.19
24-bit DS A/D converter with programmable gain instrumentation amplifier . . . . . . . . . . . . . . . . . . . . . 208
3.2.20
A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 219
3.2.21
Configurable amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 235
3.2.22
Temperature sensor . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 241
3.2.23
24-bitDS A/D converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 247
3.2.24
D/A converter . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 258
3.2.25
Programmable gain amplifier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 267
3.2.26
Comparator. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 272
3.2.27
Comparator/ProgrammableGainAmplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 280
3.2.28
Serial array unit. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 291
3.2.29
Serial array unit 4 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 331
3.2.30
Asynchronous serial interface LIN-UART . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 344
3.2.31
Serial interface IICA . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 363
3.2.32
LCD controller/driver. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 385
3.2.33
Sound generator . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 394
3.2.34
DMA controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 400
3.2.35
Data transfer controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 409
3.2.36
Event link controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 415
3.2.37
Interrupt functions . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 419
3.2.38
Key interrupt function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 428
3.2.39
Voltage detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 434
3.2.40
Battery backup function . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 443
3.2.41
Oscillation stop detector . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 449
3.2.42
SPI interface . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 456
3.2.43
Operational amplifier. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 461
3.2.44
Data operation circuit . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 470
Revision Record . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 1
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 function
The 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 function
You can output configured information using the Pin Configurator/Code Generator as files in various formats for use
as design documents.
- Renaming function
The user can change default names assigned to the files output by the Code Generator and the API functions contained in the source code.
- User code protective function
The 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 */
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 6 of 483
e2 studio Code Generator Tool
2. OUTPUT FILES
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
Common
Clock generator
Port functions
Timer array unit
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
File Name
API Function Name
r_main.c or r_cg_main.c
main
R_MAIN_UserInit
r_systeminit.c or
r_cg_systeminit.c
hdwinit
R_Systeminit
r_cg_macrodriver.h
-
r_cg_userdefine.h
-
r_cg_lk.dr
-
r_cg_cgc.c
R_CGC_Create
R_CGC_Set_ClockMode
R_CGC_RAMECC_Start
R_CGC_RAMECC_Stop
R_CGC_StackPointer_Start
R_CGC_StackPointer_Stop
R_CGC_ClockMonitor_Start
R_CGC_ClockMonitor_Stop
r_cg_cgc_user.c
R_CGC_Create_UserInit
r_cgc_ram_ecc_interrupt
r_cgc_stackpointer_interrupt
r_cgc_clockmonitor_interrupt
R_CGC_Get_ResetSource
r_cg_cgc.h
-
r_cg_port.c
R_PORT_Create
r_cg_port_user.c
R_PORT_Create_UserInit
r_cg_port.h
-
r_cg_timer.c or
r_cg_tau.c
R_TAUm_Create
R_TAUm_Channeln_Start
R_TAUm_Channeln_Higher8bits_Start
R_TAUm_Channeln_Lower8bits_Start
R_TAUm_Channeln_Stop
R_TAUm_Channeln_Higher8bits_Stop
R_TAUm_Channeln_Lower8bits_Stop
R_TAUm_Set_PowerOff
R_TAUm_Channeln_Get_PulseWidth
R_TAUm_Channeln_Set_SoftwareTriggerOn
r_cg_timer_user.c or
r_cg_tau_user.c
R_TAUm_Create_UserInit
r_taum_channeln_interrupt
r_taum_channeln_higher8bits_interrupt
r_cg_timer.h or
r_cg_tau.h
-
Page 7 of 483
e2 studio Code Generator Tool
Peripheral Function
Timer RJ
Timer RD
Timer RG
Timer RX
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_timer.c
R_TMR_RJ0_Create
R_TMR_RJ0_Start
R_TMR_RJ0_Stop
R_TMR_RJ0_Set_PowerOff
R_TMR_RJ0_Get_PulseWidth
R_TMRJ0_Create
R_TMRJ0_Start
R_TMRJ0_Stop
R_TMRJ0_Set_PowerOff
R_TMRJ0_Get_PulseWidth
r_cg_timer_user.c
R_TMR_RJ0_Create_UserInit
r_tmr_rj0_interrupt
R_TMRJ0_Create_UserInit
r_tmrj0_interrupt
r_cg_timer.h
-
r_cg_timer.c
R_TMR_RDn_Create
R_TMR_RDn_Start
R_TMR_RDn_Stop
R_TMR_RDn_Set_PowerOff
R_TMR_RDn_ForcedOutput_Start
R_TMR_RDn_ForcedOutput_Stop
R_TMR_RDn_Get_PulseWidth
R_TMRDn_Create
R_TMRDn_Start
R_TMRDn_Stop
R_TMRDn_Set_PowerOff
R_TMRDn_ForcedOutput_Start
R_TMRDn_ForcedOutput_Stop
R_TMRDn_Get_PulseWidth
r_cg_timer_user.c
R_TMR_RDn_Create_UserInit
r_tmr_rdn_interrupt
R_TMRDn_Create_UserInit
r_tmrdn_interrupt
r_cg_timer.h
-
r_cg_timer.c
R_TMR_RG0_Create
R_TMR_RG0_Start
R_TMR_RG0_Stop
R_TMR_RG0_Set_PowerOff
R_TMR_RG0_Get_PulseWidth
r_cg_timer_user.c
R_TMR_RG0_Create_UserInit
r_tmr_rg0_interrupt
r_cg_timer.h
-
r_cg_tmrx.c
R_TMRX_Create
R_TMRX_Start
R_TMRX_Stop
R_TMRX_Set_PowerOff
R_TMRX_Get_BufferValue
r_cg_tmrx_user.c
R_TMRX_Create_UserInit
r_tmrx_interrupt
r_cg_tmrx.h
-
Page 8 of 483
e2 studio Code Generator Tool
Peripheral Function
16-bit timer KB
16-bit timer KC0
16-bit timer KB2
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_timer.c
R_TMR_KB_Create
R_TMR_KBm_Start
R_TMR_KBm_Stop
R_TMR_KBm_Set_PowerOff
R_TMR_KBmn_ForcedOutput_Start
R_TMR_KBmn_ForcedOutput_Stop
R_TMR_KBm_BatchOverwriteRequestOn
r_cg_timer_user.c
R_TMR_KBm_Create_UserInit
r_tmr_kbm_interrupt
r_cg_timer.h
-
r_cg_timer.c
R_TMR_KC0_Create
R_TMR_KC0_Start
R_TMR_KC0_Stop
R_TMR_KC0_Set_PowerOff
r_cg_timer_user.c
R_TMR_KC0_Create_UserInit
r_tmr_kc0_interrupt
r_cg_timer.h
-
r_cg_kb2.c
R_KB2m_Create
R_KB2m_Start
R_KB2m_Stop
R_KB2m_Set_PowerOff
R_KB2m_Simultaneous_Start
R_KB2m_Simultaneous_Stop
R_KB2m_Synchronous_Start
R_KB2m_Synchronous_Stop
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop
R_KB2m_TKBOn0_DitheringFunction_Start
R_KB2m_TKBOn0_DitheringFunction_Stop
R_KB2m_TKBOn1_DitheringFunction_Start
R_KB2m_TKBOn1_DitheringFunction_Stop
R_KB2m_TKBOn0_SmoothStartFunction_Start
R_KB2m_TKBOn0_SmoothStartFunction_Stop
R_KB2m_TKBOn1_SmoothStartFunction_Start
R_KB2m_TKBOn1_SmoothStartFunction_Stop
R_KB2m_Set_BatchOverwriteRequestOn
r_cg_kb2_user.c
R_KB2m_Create_UserInit
r_kb2m_interrupt
r_cg_kb2.h
-
Page 9 of 483
e2 studio Code Generator Tool
Peripheral Function
Real-time clock
Subsystem clock frequency measurement circuit
12-bit interval timer
8-bit interval timer
16-bit wakeup timer
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_rtc.c
R_RTC_Create
R_RTC_Start
R_RTC_Stop
R_RTC_Set_PowerOff
R_RTC_Set_HourSystem
R_RTC_Set_CounterValue
R_RTC_Get_CounterValue
R_RTC_Set_ConstPeriodInterruptOn
R_RTC_Set_ConstPeriodInterruptOff
R_RTC_Set_AlarmOn
R_RTC_Set_AlarmOff
R_RTC_Set_AlarmValue
R_RTC_Get_AlarmValue
R_RTC_Set_RTC1HZOn
R_RTC_Set_RTC1HZOff
r_cg_rtc_user.c
R_RTC_Create_UserInit
r_rtc_interrupt
r_rtc_callback_constperiod
r_rtc_callback_alarm
r_cg_rtc.h
-
r_cg_fmc.c
R_FMC_Create
R_FMC_Start
R_FMC_Stop
R_FMC_Set_PowerOff
r_cg_fmc_user.c
R_FMC_Create_UserInit
r_fmc_interrupt
r_cg_fmc.h
-
r_cg_it.c
R_IT_Create
R_IT_Start
R_IT_Stop
R_IT_Reset
r_cg_it_user.c
R_IT_Create_UserInit
r_it_interrupt
r_cg_it.h
-
r_cg_it8bit.c
R_IT8bitm_Channeln_Create
R_IT8bitm_Channeln_Start
R_IT8bitm_Channeln_Stop
R_IT8bitm_Channeln_Set_PowerOff
r_cg_it8bit_user.c
R_IT8bitm_Channeln_Create_UserInit
r_it8bitm_channeln_interrupt
r_cg_it8bit.h
-
r_cg_timer.c
R_WUTM_Create
R_WUTM_Start
R_WUTM_Stop
R_WUTM_Set_PowerOff
r_cg_timer_user.c
R_WUTM_Create_UserInit
r_wutm_interrupt
r_cg_timer.h
-
Page 10 of 483
e2 studio Code Generator Tool
Peripheral Function
Clock output/buzzer output
controller
Watchdog timer
24-bit DS A/D converter
with programmable gain
instrumentation amplifier
A/D converter
Configurable amplifier
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_pclbuz.c
R_PCLBUZn_Create
R_PCLBUZn_Start
R_PCLBUZn_Stop
R_PCLBUZ_Set_PowerOff
r_cg_pclbuz_user.c
R_PCLBUZn_Create_UserInit
r_cg_pclbuz.h
-
r_cg_wdt.c
R_WDT_Create
R_WDT_Restart
r_cg_wdt_user.c
R_WDT_Create_UserInit
r_wdt_interrupt
r_cg_wdt.h
-
r_cg_pga_dsad.c
R_PGA_DSAD_Create
R_PGA_DSAD_Start
R_PGA_DSAD_Stop
R_PGA_DSAD_Set_PowerOff
R_PGA_DSAD_Get_AverageResult
R_PGA_DSAD_Get_Result
R_PGA_DSAD_CAMP_OffsetTrimming
r_cg_pga_dsad_user.c
R_PGA_DSAD_Create_UserInit
r_pga_dsad_interrupt_conversion
r_pga_dsad_interrupt_scan
r_cg_pga_dsad.h
-
r_cg_adc.c
R_ADC_Create
R_ADC_Set_OperationOn
R_ADC_Set_OperationOff
R_ADC_Start
R_ADC_Stop
R_ADC_Set_PowerOff
R_ADC_Set_ADChannel
R_ADC_Set_SnoozeOn
R_ADC_Set_SnoozeOff
R_ADC_Set_TestChannel
R_ADC_Get_Result
R_ADC_Get_Result_8bit
r_cg_adc_user.c
R_ADC_Create_UserInit
r_adc_interrupt
r_cg_adc.h
-
r_cg_camp.c
R_CAMP_Create
R_CAMPn_Start
R_CAMPn_Stop
R_CAMP_Set_PowerOff
r_cg_camp_user.c
R_CAMP_Create_UserInit
r_cg_camp.h
-
Page 11 of 483
e2 studio Code Generator Tool
Peripheral Function
Temperature sensor
24-bitDS A/D converter
D/A converter
Programmable gain amplifier
Comparator
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_tmps.c
R_TMPS_Create
R_TMPS_Start
R_TMPS_Stop
R_TMPS_Set_PowerOff
r_cg_tmps_user.c
R_TMPS_Create_UserInit
r_cg_tmps.h
-
r_cg_dsadc.c
R_DSADC_Create
R_DSADC_Set_OperationOn
R_DSADC_Set_OperationOff
R_DSADC_Start
R_DSADC_Stop
R_DSADC_Set_PowerOff
R_DSADC_Channeln_Get_Result
R_DSADC_Channeln_Get_Result_16bit
r_cg_dsadc_user.c
R_DSADC_Create_UserInit
r_dsadc_interrupt
r_cg_dsadc.h
-
r_cg_dac.c
R_DAC_Create
R_DACn_Start
R_DACn_Stop
R_DAC_Set_PowerOff
R_DACn_Set_ConversionValue
R_DAC_Change_OutputVoltage_8bit
R_DAC_Change_OutputVoltage
r_cg_dac_user.c
R_DAC_Create_UserInit
r_cg_dac.h
-
r_cg_pga.c
R_PGA_Create
R_PGA_Start
R_PGA_Stop
r_cg_pga_user.c
R_PGA_Create_UserInit
r_cg_pga.h
-
r_cg_comp.c
R_COMP_Create
R_COMPn_Start
R_COMPn_Stop
R_COMP_Reset
R_COMP_Set_PowerOff
r_cg_comp_user.c
R_COMP_Create_UserInit
r_compn_interrupt
r_cg_comp.h
-
Page 12 of 483
e2 studio Code Generator Tool
Peripheral Function
Comparator/ProgrammableGainAmplifier
Serial array unit
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_comppga.c
R_COMPPGA_Create
R_COMPPGA_Set_PowerOff
R_COMPn_Start
R_COMPn_Stop
R_PGA_Start
R_PGA_Stop
R_PWMOPT_Start
R_PWMOPT_Stop
r_cg_comppga_user.c
R_COMP_Create_UserInit
r_compn_interrupt
R_COMPPGA_Create_UserInit
r_compn_interrupt
r_cg_comppga.h
-
r_cg_serial.c or
r_cg_sau.c
R_SAUm_Create
R_SAUm_Set_PowerOff
R_SAUm_Set_SnoozeOn
R_SAUm_Set_SnoozeOff
R_UARTn_Create
R_UARTn_Start
R_UARTn_Stop
R_UARTn_Send
R_UARTn_Receive
R_CSImn_Create
R_CSImn_Start
R_CSImn_Stop
R_CSImn_Send
R_CSImn_Receive
R_CSImn_Send_Receive
R_IICmn_Create
R_IICmn_StartCondition
R_IICmn_StopCondition
R_IICmn_Stop
R_IICmn_Master_Send
R_IICmn_Master_Receive
r_cg_serial_user.c or
r_cg_sau_user.c
R_SAUm_Create_UserInit
r_uartn_interrupt_send
r_uartn_interrupt_receive
r_uartn_interrupt_error
r_uartn_callback_sendend
r_uartn_callback_receiveend
r_uartn_callback_error
r_uartn_callback_softwareoverrun
r_csimn_interrupt
r_csimn_callback_sendend
r_csimn_callback_receiveend
r_csimn_callback_error
r_iicmn_interrupt
r_iicmn_callback_master_sendend
r_iicmn_callback_master_receiveend
r_iicmn_callback_master_error
r_cg_serial.h or
r_cg_sau.h
-
Page 13 of 483
e2 studio Code Generator Tool
Peripheral Function
Serial array unit 4
Asynchronous serial interface LIN-UART
Serial interface IICA
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_serial.c
R_DALIn_Create
R_DALIn_Start
R_DALIn_Stop
R_DALIn_Send
R_DALIn_Receive
r_cg_serial_user.c
r_dalin_interrupt_send
r_dalin_interrupt_receive
r_dalin_interrupt_error
r_dalin_callback_sendend
r_dalin_callback_receiveend
r_dalin_callback_error
r_dalin_callback_softwareoverrun
r_cg_serial.h
-
r_cg_serial.c
R_UARTFn_Create
R_UARTFn_Start
R_UARTFn_Stop
R_UARTFn_Set_PowerOff
R_UARTFn_Send
R_UARTFn_Receive
R_UARTFn_Set_DataComparisonOn
R_UARTFn_Set_DataComparisonOff
r_cg_serial_user.c
R_UARTFn_Create_UserInit
r_uartfn_interrupt_send
r_uartfn_interrupt_receive
r_uartfn_interrupt_error
r_uartfn_callback_sendend
r_uartfn_callback_receiveend
r_uartfn_callback_error
r_uartfn_callback_softwareoverrun
r_uartfn_callback_expbitdetect
r_uartfn_callback_idmatch
r_cg_serial.h
-
r_cg_serial.c or
r_cg_iica.c
R_IICAn_Create
R_IICAn_StopCondition
R_IICAn_Stop
R_IICAn_Set_PowerOff
R_IICAn_Master_Send
R_IICAn_Master_Receive
R_IICAn_Slave_Send
R_IICAn_Slave_Receive
R_IICAn_Set_SnoozeOn
R_IICAn_Set_SnoozeOff
R_IICAn_Set_WakeupOn
R_IICAn_Set_WakeupOff
r_cg_serial_user.c or
r_cg_iica_user.c
R_IICAn_Create_UserInit
r_iican_interrupt
r_iican_callback_master_sendend
r_iican_callback_master_receiveend
r_iican_callback_master_error
r_iican_callback_slave_sendend
r_iican_callback_slave_receiveend
r_iican_callback_slave_error
r_iican_callback_getstopcondition
r_cg_serial.h or
r_cg_iica.h
-
Page 14 of 483
e2 studio Code Generator Tool
Peripheral Function
LCD controller/driver
Sound generator
DMA controller
Data transfer controller
Event link controller
Interrupt functions
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_lcd.c
R_LCD_Create
R_LCD_Start
R_LCD_Stop
R_LCD_Set_VoltageOn
R_LCD_Set_VoltageOff
R_LCD_Set_PowerOff
r_cg_lcd_user.c
R_LCD_Create_UserInit
r_lcd_interrupt
r_cg_lcd.h
-
r_cg_sg.c
R_SG_Create
R_SG_Start
R_SG_Stop
r_cg_sg_user.c
R_SG_Create_UserInit
r_sg_interrupt
r_cg_sg.h
-
r_cg_dmac.c
R_DMACn_Create
R_DMAC_Create
R_DMACn_Start
R_DMACn_Stop
R_DMACn_Set_SoftwareTriggerOn
r_cg_dmac_user.c
R_DMACn_Create_UserInit
R_DMAC_Create_UserInit
r_dmacn_interrupt
r_cg_dmac.h
-
r_cg_dtc.c
R_DTC_Create
R_DTCn_Start
R_DTCn_Stop
R_DTC_Set_PowerOff
r_cg_dtc_user.c
R_DTC_Create_UserInit
r_cg_dtc.h
-
r_cg_elc.c
R_ELC_Create
R_ELC_Stop
r_cg_elc_user.c
R_ELC_Create_UserInit
r_cg_elc.h
-
r_cg_intc.c
R_INTC_Create
R_INTCn_Start
R_INTCn_Stop
R_INTCLRn_Start
R_INTCLRn_Stop
r_cg_intc_user.c
R_INTC_Create_UserInit
r_intcn_interrupt
r_intclrn_interrupt
r_cg_intc.h
-
Page 15 of 483
e2 studio Code Generator Tool
Peripheral Function
Key interrupt function
Voltage detector
Battery backup function
Oscillation stop detector
SPI interface
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
2. OUTPUT FILES
File Name
API Function Name
r_cg_intc.c
R_KEY_Create
R_KEY_Start
R_KEY_Stop
r_cg_intc_user.c
R_KEY_Create_UserInit
r_key_interrupt
r_cg_intc.h
-
r_cg_lvd.c
R_LVD_Create
R_LVD_InterruptMode_Start
R_LVI_Create
R_LVI_InterruptMode_Start
r_cg_lvd_user.c
R_LVD_Create_UserInit
r_lvd_interrupt
R_LVI_Create_UserInit
r_lvi_interrupt
r_cg_lvd.h
-
r_cg_bup.c
R_BUP_Create
R_BUP_Start
R_BUP_Stop
r_cg_bup_user.c
R_BUP_Create_UserInit
r_bup_interrupt
r_cg_bup.h
-
r_cg_osdc.c
R_OSDC_Create
R_OSDC_Start
R_OSDC_Stop
R_OSDC_Set_PowerOff
r_cg_osdc_user.c
R_OSDC_Create_UserInit
r_osdc_interrupt
r_cg_osdc.h
-
r_cg_saic.c
R_SAIC_Create
R_SAIC_Write
R_SAIC_Read
r_cg_saic_user.c
R_SAIC_Create_UserInit
r_cg_saic.h
-
Page 16 of 483
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)
.........
(2)
.......................................................................................................................................
...........................
(3)
[Syntax]
...
(4)
.........
[Argument(s)]
I/O
...
Argument
...
.........
Description
................................................................
...........................
(5)
[Return value]
Macro
.........
Description
........................................................................................................
...........................
(1)
Name
Indicates the name of the API function.
(2)
Outline
Outlines 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 17 of 483
e2 studio Code Generator Tool
(4)
3. API FUNCTIONS
[Argument(s)]
API function arguments are explained in the following format.
I/O
Argument
Description
(a)
(b)
(c)
(a)
I/O
Argument classification
I
... Input argument
O
... Output argument
(b)
Argument
Argument data type
(c)
Description
Description of argument
(5)
[Return value]
API function return value is explained in the following format.
Macro
Description
(a)
(b)
(a)
Macro
Macro of return value
(b)
Description
Description of return value
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 18 of 483
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 Renesasmade 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 19 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
hdwinit
Performs initialization necessary to control the various hardwares.
Remark
Call this API function from the startup routine.
[Syntax]
void
hdwinit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 20 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_Systeminit
Performs initialization necessary to control the various peripheral functions.
Remark
This API function is called as the hdwinit callback routine.
[Syntax]
void
R_Systeminit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 21 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
main
This is a main function.
Remark
Call this API function from the startup routine.
[Syntax]
void
main ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 22 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_MAIN_UserInit
Performs user-defined initialization.
Remark
This API function is called as the main callback routine.
[Syntax]
void
R_MAIN_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 23 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 24 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_Create
Performs initialization required to control the clock generator (include reset function, on-chip debug function, etc.).
[Syntax]
void
R_CGC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 25 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_Create_UserInit
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]
void
R_CGC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 26 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_cgc_ram_ecc_interrupt
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
__interrupt static
void
r_cgc_ram_ecc_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_cgc_ram_ecc_interrupt ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 27 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_cgc_stackpointer_interrupt
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
__interrupt static
void
r_cgc_stackpointer_interrupt ( void );
CC-RL Compiler
static
void
__near r_cgc_stackpointer_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 28 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_cgc_clockmonitor_interrupt
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
__interrupt static
void
r_cgc_clockmonitor_interrupt ( void );
CC-RL Compiler
static
void
__near r_cgc_clockmonitor_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 29 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_Get_ResetSource
Performs processing in response to RESET signal.
[Syntax]
void
R_CGC_Get_ResetSource ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 30 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_Set_ClockMode
Changes the CPU clock/peripheral hardware clock.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_cgc.h"
R_CGC_Set_ClockMode ( clock_mode_t mode );
[Argument(s)]
I/O
I
Argument
clock_mode_t
mode;
Description
Clock generator type
HIOCLK:
SYSX1CLK:
SYSEXTCLK:
SUBXT1CLK:
SUBEXTCLK:
High-speed onchip oscillator
X1 clock
External main system clock
XT1 clock
External subsystem clock
[Return value]
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
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 31 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_RAMECC_Start
Starts the RAM-ECC function.
[Syntax]
void
R_CGC_RAMECC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 32 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_RAMECC_Stop
Ends the RAM-ECC function.
[Syntax]
void
R_CGC_RAMECC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 33 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_StackPointer_Start
Starts the CPU stack pointer function.
[Syntax]
void
R_CGC_StackPointer_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 34 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_StackPointer_Stop
Ends the CPU stack pointer function.
[Syntax]
void
R_CGC_StackPointer_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 35 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_ClockMonitor_Start
Starts the clock monitor.
[Syntax]
void
R_CGC_ClockMonitor_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 36 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CGC_ClockMonitor_Stop
Ends the clock monitor.
[Syntax]
void
R_CGC_ClockMonitor_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 37 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 38 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PORT_Create
Performs initialization necessary to control the port functions.
[Syntax]
void
R_PORT_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 39 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PORT_Create_UserInit
Performs user-defined initialization relating to the port functions.
Remark
This API function is called as the R_PORT_Create callback routine.
[Syntax]
void
R_PORT_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 40 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.4 Timer array unit
Below is a list of API functions output by the Code Generator for timer array unit use.
Table 3.4
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 signal (pulses) input to the TImn pin.
R_TAUm_Channeln_Set_SoftwareTrigge
rOn
Generates the trigger (software trigger) for one-shot pulse output.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 41 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Create
Performs initialization necessary to control the timer array unit.
[Syntax]
void
Remark
R_TAUm_Create ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 42 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Create_UserInit
Performs user-defined initialization relating to the timer array unit.
Remark
This API function is called as the R_TAUm_Create callback routine.
[Syntax]
void
Remark
R_TAUm_Create_UserInit ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 43 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_taum_channeln_interrupt
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
__interrupt static
void
r_taum_channeln_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_taum_channeln_interrupt ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 44 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_taum_channeln_higher8bits_interrupt
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
__interrupt static
void
r_taum_channeln_higher8bits_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_taum_channeln_higher8bits_interrupt ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 45 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Start
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]
void
Remark
R_TAUm_Channeln_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 46 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Higher8bits_Start
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]
void
Remark
R_TAUm_Channeln_Higher8bits_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 47 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Lower8bits_Start
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]
void
R_TAUm_Channeln_Lower8bits_Start ( void );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 48 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Stop
Ends the count for channel n.
[Syntax]
void
Remark
R_TAUm_Channeln_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 49 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Higher8bits_Stop
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]
void
R_TAUm_Channeln_Higher8bits_Stop ( void );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 50 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Lower8bits_Stop
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]
void
R_TAUm_Channeln_Lower8bits_Stop ( void );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 51 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Reset
Reset the timer array unit.
[Syntax]
void
Remark
R_TAUm_Reset ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 52 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Set_PowerOff
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]
void
Remark
R_TAUm_Set_PowerOff ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 53 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Get_PulseWidth
Captures the high/low-level width measured between pulses of the signal (pulses) input to the TImn pin.
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_TAUm_Channeln_Get_PulseWidth ( uint32_t * const width );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
I/O
O
Argument
uint32_t
* const width;
Description
Pointer to an area to store the measurement width (0x0 to
0x1FFFF)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 54 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TAUm_Channeln_Set_SoftwareTriggerOn
Generates the trigger (software trigger) for one-shot pulse output.
[Syntax]
void
Remark
R_TAUm_Channeln_Set_SoftwareTriggerOn ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 55 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.5 Timer RJ
Below is a list of API functions output by the Code Generator for timer RJ use.
Table 3.5
API Functions: [Timer RJ]
API Function Name
Function
R_TMR_RJ0_Create
Performs initialization necessary to control the 16-bit timer RJ0.
R_TMR_RJ0_Create_UserInit
Performs user-defined initialization relating to the 16-bit timer RJ0.
r_tmr_rj0_interrupt
Performs processing in response to the timer interrupt.
R_TMR_RJ0_Start
Starts the count for 16-bit timer RJ0.
R_TMR_RJ0_Stop
Ends the count for 16-bit timer RJ0.
R_TMR_RJ0_Set_PowerOff
Halts the clock supplied to the 16-bit timer RJ0.
R_TMR_RJ0_Get_PulseWidth
Reads the pulse width of the 16-bit timer RJ0.
R_TMRJ0_Create
Performs initialization necessary to control the 16-bit timer RJ0.
R_TMRJ0_Create_UserInit
Performs user-defined initialization relating to the 16-bit timer RJ0.
r_tmrj0_interrupt
Performs processing in response to the timer interrupt.
R_TMRJ0_Start
Starts the count for 16-bit timer RJ0.
R_TMRJ0_Stop
Ends the count for 16-bit timer RJ0.
R_TMRJ0_Set_PowerOff
Halts the clock supplied to the 16-bit timer RJ0.
R_TMRJ0_Get_PulseWidth
Reads the pulse width of the 16-bit timer RJ0.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 56 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Create
Performs initialization necessary to control the 16-bit timer RJ0.
[Syntax]
void
R_TMR_RJ0_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 57 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Create_UserInit
Performs user-defined initialization relating to the 16-bit timer RJ0.
Remark
This API function is called as the R_TMR_RJ0_Create callback routine.
[Syntax]
void
R_TMR_RJ0_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 58 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmr_rj0_interrupt
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
__interrupt static
void
r_tmr_rj0_interrupt ( void );
CC-RL Compiler
static
void
__near r_tmr_rj0_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 59 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Start
Starts the count for 16-bit timer RJ0.
[Syntax]
void
R_TMR_RJ0_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 60 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Stop
Ends the count for 16-bit timer RJ0.
[Syntax]
void
R_TMR_RJ0_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 61 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Set_PowerOff
Halts the clock supplied to the 16-bit timer RJ0.
Remark
Calling this API function changes the 16-bit timer RJ0 to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
void
R_TMR_RJ0_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 62 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RJ0_Get_PulseWidth
Reads the pulse width of the 16-bit timer RJ0.
Remarks 1.
This API function can only be called when the 16-bit timer RJ0 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]
#include
"r_cg_macrodriver.h"
void
R_TMR_RJ0_Get_PulseWidth ( uint32_t * const active_width );
[Argument(s)]
I/O
O
Argument
uint32_t
* const active_width;
Description
Pointer to an area storing the active level width that was read
from the TRJ0IO pin
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 63 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Create
Performs initialization necessary to control the 16-bit timer RJ0.
[Syntax]
void
R_TMRJ0_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 64 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Create_UserInit
Performs user-defined initialization relating to the 16-bit timer RJ0.
Remark
This API function is called as the R_TMRJ0_Create callback routine.
[Syntax]
void
R_TMRJ0_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 65 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmrj0_interrupt
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
__interrupt static
void
r_tmrj0_interrupt ( void );
CC-RL Compiler
static
void
__near r_tmrj0_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 66 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Start
Starts the count for 16-bit timer RJ0.
[Syntax]
void
R_TMRJ0_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 67 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Stop
Ends the count for 16-bit timer RJ0.
[Syntax]
void
R_TMRJ0_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 68 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Set_PowerOff
Halts the clock supplied to the 16-bit timer RJ0.
Remark
Calling this API function changes the 16-bit timer RJ0 to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
void
R_TMRJ0_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 69 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRJ0_Get_PulseWidth
Reads the pulse width of the 16-bit timer RJ0.
Remarks 1.
This API function can only be called when the 16-bit timer RJ0 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]
#include
"r_cg_macrodriver.h"
void
R_TMRJ0_Get_PulseWidth ( uint32_t * const active_width );
[Argument(s)]
I/O
O
Argument
uint32_t
* const active_width;
Description
Pointer to an area storing the active level width that was read
from the TRJ0IO pin
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 70 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.6 Timer RD
Below is a list of API functions output by the Code Generator for timer RD use.
Table 3.6
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 71 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Create
Performs initialization necessary to control the 16-bit timer RDn.
[Syntax]
void
Remark
R_TMR_RDn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 72 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Create_UserInit
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]
void
Remark
R_TMR_RDn_Create_UserInit ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 73 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmr_rdn_interrupt
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
__interrupt static
void
r_tmr_rdn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_tmr_rdn_interrupt ( void );
[n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 74 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Start
Starts the count for 16-bit timer RDn.
[Syntax]
void
Remark
R_TMR_RDn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 75 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Stop
Ends the count for 16-bit timer RDn.
[Syntax]
void
Remark
R_TMR_RDn_Stop ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 76 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Set_PowerOff
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]
void
Remark
R_TMR_RDn_Set_PowerOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 77 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_ForcedOutput_Start
Starts the pulse output forced cutoff for 16-bit timer RDn.
[Syntax]
void
Remark
R_TMR_RDn_ForcedOutput_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 78 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_ForcedOutput_Stop
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]
void
Remark
R_TMR_RDn_ForcedOutput_Stop ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 79 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RDn_Get_PulseWidth
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]
#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 );
Remark
n is the channel number.
[Argument(s)]
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 read
TMCHANNELA:
TMCHANNELB:
TMCHANNELC:
TMCHANNELD:
TRDIOAn pin
TRDIOBn pin
TRDIOCn pin
TRDIODn pin
[Return value]
Macro
MD_OK
Description
Normal completion
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 80 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Create
Performs initialization necessary to control the 16-bit timer RDn.
[Syntax]
void
Remark
R_TMRDn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 81 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Create_UserInit
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]
void
Remark
R_TMRDn_Create_UserInit ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 82 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmrdn_interrupt
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
__interrupt static
void
r_tmrdn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_tmrdn_interrupt ( void );
[n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 83 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Start
Starts the count for 16-bit timer RDn.
[Syntax]
void
Remark
R_TMRDn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 84 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Stop
Ends the count for 16-bit timer RDn.
[Syntax]
void
R_TMRDn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 85 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Set_PowerOff
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]
void
Remark
R_TMRDn_Set_PowerOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 86 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_ForcedOutput_Start
Starts the pulse output forced cutoff for 16-bit timer RDn.
[Syntax]
void
Remark
R_TMRDn_ForcedOutput_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 87 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_ForcedOutput_Stop
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]
void
Remark
R_TMRDn_ForcedOutput_Stop ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 88 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRDn_Get_PulseWidth
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]
#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 );
Remark
n is the channel number.
[Argument(s)]
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 read
TMCHANNELA:
TMCHANNELB:
TMCHANNELC:
TMCHANNELD:
TRDIOAn pin
TRDIOBn pin
TRDIOCn pin
TRDIODn pin
[Return value]
Macro
MD_OK
Description
Normal completion
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 89 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.7 Timer RG
Below is a list of API functions output by the Code Generator for timer RG use.
Table 3.7
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 90 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Create
Performs initialization necessary to control the 16-bit timer RG0.
[Syntax]
void
R_TMR_RG0_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 91 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Create_UserInit
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]
void
R_TMR_RG0_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 92 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmr_rg0_interrupt
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
__interrupt static
void
r_tmr_rg0_interrupt ( void );
CC-RL Compiler
static
void
__near r_tmr_rg0_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 93 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Start
Starts the count for 16-bit timer RG0.
[Syntax]
void
R_TMR_RG0_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 94 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Stop
Ends the count for 16-bit timer RG0.
[Syntax]
void
R_TMR_RG0_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 95 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Set_PowerOff
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]
void
R_TMR_RG0_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 96 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_RG0_Get_PulseWidth
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]
#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 );
[Argument(s)]
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 read
TMCHANNELA:
TMCHANNELB:
TRGIOA0 pin
TRGIOB0 pin
[Return value]
Macro
MD_OK
Description
Normal completion
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 97 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.8 Timer RX
Below is a list of API functions output by the Code Generator for timer RX use.
Table 3.8
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).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 98 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Create
Performs initialization necessary to control the 16-bit timer RX.
[Syntax]
void
R_TMRX_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 99 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Create_UserInit
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]
void
R_TMRX_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 100 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmrx_interrupt
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
__interrupt static
void
r_tmrx_interrupt ( void );
CC-RL Compiler
static
void
__near r_tmrx_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 101 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Start
Starts the count for 16-bit timer RX.
[Syntax]
void
R_TMRX_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 102 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Stop
Ends the count for 16-bit timer RX.
[Syntax]
void
R_TMRX_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 103 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Set_PowerOff
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]
void
R_TMRX_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 104 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMRX_Get_BufferValue
Reads the buffer value of TRX register (16-bit timer RX).
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_TMRX_Get_BufferValue ( uint32_t * const value );
[Argument(s)]
I/O
O
Argument
uint32_t
* const value;
Description
Pointer to an area storing the buffer resister value of TRX resister
[Return value]
なし
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 105 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.9 16-bit timer KB
Below is a list of API functions output by the Code Generator for 16-bit timer KB use.
Table 3.9
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 function.
R_TMR_KBmn_ForcedOutput_Stop
Disables input of the trigger signal used for the forced output stop function.
R_TMR_KBm_BatchOverwriteRequestO
n
Enables batch overwriting of the compare register.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 106 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KB_Create
Performs initialization necessary to control the 16-bit timers KB.
[Syntax]
void
R_TMR_KB_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 107 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBm_Create_UserInit
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]
void
Remark
R_TMR_KBm_Create_UserInit ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 108 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmr_kbm_interrupt
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
__interrupt static
void
r_tmr_kbm_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_tmr_kbm_interrupt ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 109 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBm_Start
Starts the count for 16-bit timer KB.
[Syntax]
void
Remark
R_TMR_KBm_Start ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 110 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBm_Stop
Ends the count for 16-bit timer KB.
[Syntax]
void
Remark
R_TMR_KBm_Stop ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 111 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBm_Set_PowerOff
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]
void
Remark
R_TMR_KBm_Set_PowerOff ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 112 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBmn_ForcedOutput_Start
Enables input of the trigger signal used for the forced output stop function.
[Syntax]
void
Remark
R_TMR_KBmn_ForcedOutput_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 113 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBmn_ForcedOutput_Stop
Disables input of the trigger signal used for the forced output stop function.
[Syntax]
void
Remark
R_TMR_KBmn_ForcedOutput_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 114 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KBm_BatchOverwriteRequestOn
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]
void
Remark
R_TMR_KBm_BatchOverwriteRequestOn ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 115 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.10 16-bit timer KC0
Below is a list of API functions output by the Code Generator for 16-bit timer KC0 use.
Table 3.10
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 116 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KC0_Create
Performs initialization necessary to control the the 16-bit timer KC0.
[Syntax]
void
R_TMR_KC0_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 117 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KC0_Create_UserInit
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]
void
R_TMR_KC0_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 118 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_tmr_kc0_interrupt
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
__interrupt static
void
r_tmr_kc0_interrupt ( void );
CC-RL Compiler
static
void
__near r_tmr_kc0_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 119 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KC0_Start
Starts the count for 16-bit timer KC0.
[Syntax]
void
R_TMR_KC0_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 120 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KC0_Stop
Ends the count for 16-bit timer KC0.
[Syntax]
void
R_TMR_KC0_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 121 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMR_KC0_Set_PowerOff
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]
void
R_TMR_KC0_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 122 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.11 16-bit timer KB2
Below is a list of API functions output by the Code Generator for 16-bit timer KB2 use.
Table 3.11
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_St
art
Starts dithering function for timer output TKBOn0.
R_KB2m_TKBOn0_DitheringFunction_St
op
Ends dithering function for timer output TKBOn0.
R_KB2m_TKBOn1_DitheringFunction_St
art
Starts dithering function for timer output TKBOn1.
R_KB2m_TKBOn1_DitheringFunction_St
op
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 123 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Create
Performs initialization necessary to control the 16-bit timer KB2.
[Syntax]
void
Remark
R_KB2m_Create ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 124 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Create_UserInit
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]
void
Remark
R_KB2m_Create_UserInit ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 125 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_kb2m_interrupt
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
__interrupt static
void
r_kb2m_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_kb2m_interrupt ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 126 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Start
Starts the count for 16-bit timer KB2.
[Syntax]
void
Remark
R_KB2m_Start ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 127 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Stop
Ends the count for 16-bit timer KB2.
[Syntax]
void
Remark
R_KB2m_Stop ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 128 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Set_PowerOff
Halts the clock supplied to the 16-bit timer KB2.
[Syntax]
void
Remark
R_KB2m_Set_PowerOff ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 129 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Simultaneous_Start
Starts the simultaneous start/stop mode.
[Syntax]
void
Remark
R_KB2m_Simultaneous_Start ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 130 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Simultaneous_Stop
Ends the simultaneous start/stop mode.
[Syntax]
void
Remark
R_KB2m_Simultaneous_Stop ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 131 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Synchronous_Start
Starts the timer start/clear mode.
[Syntax]
void
Remark
R_KB2m_Synchronous_Start ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 132 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Synchronous_Stop
Ends the timer start/clear mode.
[Syntax]
void
Remark
R_KB2m_Synchronous_Stop ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 133 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start
Starts forced output stop function 1 for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 134 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop
Ends forced output stop function 1 for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 135 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start
Starts forced output stop function 2 for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 136 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop
Ends forced output stop function 2 for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 137 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_DitheringFunction_Start
Starts dithering function for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_DitheringFunction_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 138 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_DitheringFunction_Stop
Ends dithering function for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_DitheringFunction_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 139 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_DitheringFunction_Start
Starts dithering function for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_DitheringFunction_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 140 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_DitheringFunction_Stop
Ends dithering function for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_DitheringFunction_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 141 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_SmoothStartFunction_Start
Starts smooth start function for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_SmoothStartFunction_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 142 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn0_SmoothStartFunction_Stop
Ends smooth start function for timer output TKBOn0.
[Syntax]
void
Remark
R_KB2m_TKBOn0_SmoothStartFunction_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 143 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_SmoothStartFunction_Start
Starts smooth start function for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_SmoothStartFunction_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 144 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_TKBOn1_SmoothStartFunction_Stop
Ends smooth start function for timer output TKBOn1.
[Syntax]
void
Remark
R_KB2m_TKBOn1_SmoothStartFunction_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 145 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KB2m_Set_BatchOverwriteRequestOn
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]
void
Remark
R_KB2m_Set_BatchOverwriteRequestOn ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 146 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.12 Real-time clock
Below is a list of API functions output by the Code Generator for real-time clock use.
Table 3.12
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 (year, month, weekday, day, hour, minute, second) of the real-time clock.
R_RTC_Get_CounterValue
Reads the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.
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_AlarmOff
Ends the alarm interrupt function.
R_RTC_Set_AlarmValue
Sets the alarm conditions (weekday, hour, minute).
R_RTC_Get_AlarmValue
Reads the alarm conditions (weekday, hour, minute).
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 147 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Create
Performs initialization necessary to control the real-time clock.
[Syntax]
void
R_RTC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 148 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Create_UserInit
Performs user-defined initialization relating to the real-time clock.
Remark
This API function is called as the R_RTC_Create callback routine.
[Syntax]
void
R_RTC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 149 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_rtc_interrupt
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
__interrupt static
void
r_rtc_interrupt ( void );
CC-RL Compiler
static
void
__near r_rtc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 150 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Start
Starts the count of the real-time clock (year, month, weekday, day, hour, minute, second).
[Syntax]
void
R_RTC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 151 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Stop
Ends the count of the real-time clock (year, month, weekday, day, hour, minute, second).
[Syntax]
void
R_RTC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 152 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_PowerOff
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]
void
R_RTC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 153 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_HourSystem
Sets the clock type (12-hour or 24-hour clock) of the real-time clock.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_rtc.h"
R_RTC_Set_HourSystem ( rtc_hour_system_t hour_system );
[Argument(s)]
I/O
Argument
I
rtc_hour_system_t hour_system;
Description
Clock type
HOUR12:
HOUR24:
12-hour clock
24-hour clock
[Return value]
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
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 154 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_CounterValue
Sets the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_rtc.h"
R_RTC_Set_CounterValue ( rtc_counter_value_t counter_write_val );
[Argument(s)]
I/O
I
Argument
rtc_counter_value_t
counter_write_val;
Remark
Description
Counter value
Below is an example of the structure rtc_counter_value_t (counter value) for the real-time clock.
typedef struct {
uint8_t sec;
/*
uint8_t min;
/*
uint8_t hour;
/*
uint8_t day;
/*
uint8_t week;
/*
uint8_t month; /*
uint8_t year;
/*
} rtc_counter_value_t;
second */
Minute */
Hour */
Day */
Weekday (0: Sunday, 6: Saturday) */
Month */
Year */
[Return value]
Macro
Description
MD_OK
Normal completion
MD_BUSY1
Executing count process (before change to setting)
MD_BUSY2
Stopping count process (after change to setting)
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 155 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Get_CounterValue
Reads the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_rtc.h"
R_RTC_Get_CounterValue ( rtc_counter_value_t * const counter_read_val );
[Argument(s)]
I/O
O
Argument
rtc_counter_value_t
* const counter_read_val;
Remark
Description
Pointer to structure in which to store the counter value being read
See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.
[Return value]
Macro
Description
MD_OK
Normal completion
MD_BUSY1
Executing count process (before reading)
MD_BUSY2
Stopping count process (after reading)
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 156 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_ConstPeriodInterruptOn
Sets the cycle of the interrupts INTRTC, then starts the cyclic interrupt function.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_rtc.h"
R_RTC_Set_ConstPeriodInterruptOn ( rtc_int_period_t period );
[Argument(s)]
I/O
I
Argument
rtc_int_period_t
period;
Description
Interrupt INTRTC cycle
HALFSEC:
0.5 seconds
ONESEC:
1 second
ONEMIN:
1 minute
ONEHOUR:
1 hour
ONEDAY:
1 day
ONEMONTH:
1 month
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 157 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_ConstPeriodInterruptOff
Ends the cyclic interrupt function.
[Syntax]
void
R_RTC_Set_ConstPeriodInterruptOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 158 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_rtc_callback_constperiod
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]
static
void
r_rtc_callback_constperiod ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 159 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_AlarmOn
Starts the alarm interrupt function.
[Syntax]
void
R_RTC_Set_AlarmOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 160 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_AlarmOff
Ends the alarm interrupt function.
[Syntax]
void
R_RTC_Set_AlarmOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 161 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_AlarmValue
Sets the alarm conditions (weekday, hour, minute).
[Syntax]
#include
"r_cg_macrodriver.h"
#include
"r_cg_rtc.h"
void
R_RTC_Set_AlarmValue ( rtc_alarm_value_t alarm_val );
[Argument(s)]
I/O
I
Remark
Argument
Description
rtc_alarm_value_t alarm_val;
Alarm conditions (weekday, hour, minute)
Below is shown the structure rtc_alarm_value_t (alarm conditions).
typedef struct {
uint8_t alarmwm;
uint8_t alarmwh;
uint8_t alarmww;
} rtc_alarm_value_t;
/* Minute */
/* Hour */
/* Weekday */
- alarmwm (Minute)
Below are shown the meanings of each bit of the structure member alarmwm.
7
4 3
0
BCD code (minute: digit 1)
BCD code (minute: digit 10)
0: Fixed
- 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:
AM
1:
PM
7 6 5 4 3
0
BCD code (hour: digit 1)
BCD code (hour: digit 10)
00: Fixed
- alarmww (Weekday)
Below are shown the meanings of each bit of the structure member alarmww.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 162 of 483
e2 studio Code Generator Tool
7
6
5
3.
4
3
2
1
API FUNCTIONS
0
1: Sunday
1: Monday
1: Tuesday
1: Wednesday
1: Thursday
1: Friday
1: Saturday
0: Fixed
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 163 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Get_AlarmValue
Reads the alarm conditions (weekday, hour, minute).
[Syntax]
#include
"r_cg_macrodriver.h"
#include
"r_cg_rtc.h"
void
R_RTC_Get_AlarmValue ( rtc_alarm_value_t * const alarm_val );
Remark
See R_RTC_Set_AlarmValue for details about rtc_alarm_value_t (alarm conditions).
[Argument(s)]
I/O
O
Argument
rtc_alarm_value_t
* const alarm_val;
Description
Pointer to structure in which to store the conditions being read
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 164 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_rtc_callback_alarm
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]
static
void
r_rtc_callback_alarm ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 165 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_RTC1HZOn
Enables output of the correction clock (1 Hz) to the RTC1HZ pin.
[Syntax]
void
R_RTC_Set_RTC1HZOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 166 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_RTC_Set_RTC1HZOff
Disables output of the correction clock (1 Hz) to the RTC1HZ pin.
[Syntax]
void
R_RTC_Set_RTC1HZOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 167 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.13 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.13
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 frequency measurement circuit.
R_FMC_Stop
Ends measurement of the frequency that uses the subsystem clock frequency measurement circuit.
R_FMC_Set_PowerOff
Halts the clock supplied to the subsystem clock frequency measurement
circuit.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 168 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_FMC_Create
Performs initialization necessary to control the subsystem clock frequency measurement circuit.
[Syntax]
void
R_FMC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 169 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_FMC_Create_UserInit
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]
void
R_FMC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 170 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_fmc_interrupt
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
__interrupt static
void
r_fmc_interrupt ( void );
CC-RL Compiler
static
void
__near r_fmc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 171 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_FMC_Start
Starts measurement of the frequency that uses the subsystem clock frequency measurement circuit.
[Syntax]
void
R_FMC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 172 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_FMC_Stop
Ends measurement of the frequency that uses the subsystem clock frequency measurement circuit.
[Syntax]
void
R_FMC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 173 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_FMC_Set_PowerOff
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]
void
R_FMC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 174 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.14 12-bit interval timer
Below is a list of API functions output by the Code Generator for 12-bit interval timer use.
Table 3.14
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 175 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Create
Performs initialization necessary to control the 12-bit interval timer.
[Syntax]
void
R_IT_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 176 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Create_UserInit
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]
void
R_IT_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 177 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_it_interrupt
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
__interrupt static
void
r_it_interrupt ( void );
CC-RL Compiler
static
void
__near r_it_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 178 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Start
Starts the count of the 12-bit interval timer.
[Syntax]
void
R_IT_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 179 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Stop
Ends the count of the 12-bit interval timer.
[Syntax]
void
R_IT_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 180 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Reset
Reset the 12-bit interval timer.
[Syntax]
void
R_IT_Reset ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 181 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT_Set_PowerOff
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 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-timer clock).
[Syntax]
void
R_IT_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 182 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.15 8-bit interval timer
Below is a list of API functions output by the Code Generator for 8-bit interval timer use.
Table 3.15
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 183 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT8bitm_Channeln_Create
Performs initialization necessary to control the 8-bit interval timer.
[Syntax]
void
Remark
R_IT8bitm_Channeln_Create ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 184 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT8bitm_Channeln_Create_UserInit
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]
void
Remark
R_IT8bitm_Channeln_Create_UserInit ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 185 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_it8bitm_channeln_interrupt
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
__interrupt static
void
r_it8bitm_channeln_interrupt ( void );
CC-RL Compiler
static
void
__near r_it8bitm_channeln_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 186 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT8bitm_Channeln_Start
Starts the count of the 8-bit interval timer.
[Syntax]
void
Remark
R_IT8bitm_Channeln_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 187 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT8bitm_Channeln_Stop
Ends the count of the 8-bit interval timer.
[Syntax]
void
Remark
R_IT8bitm_Channeln_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 188 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IT8bitm_Channeln_Set_PowerOff
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]
void
R_IT8bitm_Channeln_Set_PowerOff ( void );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 189 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.16 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.16
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 190 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WUTM_Create
Performs initialization necessary to control the 16-bit wakeup timer.
[Syntax]
void
R_WUTM_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 191 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WUTM_Create_UserInit
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]
void
R_WUTM_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 192 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_wutm_interrupt
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
__interrupt static
void
r_wutm_interrupt ( void );
CC-RL Compiler
static
void
__near r_wutm_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 193 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WUTM_Start
Starts the count for 16-bit wakeup timer.
[Syntax]
void
R_WUTM_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 194 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WUTM_Stop
Ends the count for 16-bit wakeup timer.
[Syntax]
void
R_WUTM_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 195 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WUTM_Set_PowerOff
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]
void
R_WUTM_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 196 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.17 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.17
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 197 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PCLBUZn_Create
Performs initialization necessary to control the clock/buzzer output controller.
[Syntax]
void
Remark
R_PCLBUZn_Create ( void );
n is the output pin.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 198 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PCLBUZn_Create_UserInit
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]
void
Remark
R_PCLBUZn_Create_UserInit ( void );
n is the output pin.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 199 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PCLBUZn_Start
Starts clock/buzzer output.
[Syntax]
void
Remark
R_PCLBUZn_Start ( void );
n is the output pin.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 200 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PCLBUZn_Stop
Ends clock/buzzer output.
[Syntax]
void
Remark
R_PCLBUZn_Stop ( void );
n is the output pin.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 201 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PCLBUZ_Set_PowerOff
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]
void
R_PCLBUZ_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 202 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.18 Watchdog timer
Below is a list of API functions output by the Code Generator for watchdog timer use.
Table 3.18
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 203 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WDT_Create
Performs initialization necessary to control the watchdog timer.
[Syntax]
void
R_WDT_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 204 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WDT_Create_UserInit
Performs user-defined initialization relating to the watchdog timer.
Remark
This API function is called as the R_WDT_Create callback routine.
[Syntax]
void
R_WDT_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 205 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_wdt_interrupt
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
__interrupt static
void
r_wdt_interrupt ( void );
CC-RL Compiler
static
void
__near r_wdt_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 206 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_WDT_Restart
Clears the watchdog timer counter and resumes counting.
[Syntax]
void
R_WDT_Restart ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 207 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.19 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 instrumentation amplifier use.
Table 3.19
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 converter 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 programmable 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 208 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Create
Performs initialization necessary to control the 24-bit ∆Σ A/D converter with programmable gain instrumentation
amplifier.
[Syntax]
void
R_PGA_DSAD_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 209 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Create_UserInit
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]
void
R_PGA_DSAD_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 210 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_pga_dsad_interrupt_conversion
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
__interrupt static
void
r_pga_dsad_interrupt_conversion ( void );
CC-RL Compiler
static
void
__near r_pga_dsad_interrupt_conversion ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 211 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_pga_dsad_interrupt_scan
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
__interrupt static
void
r_pga_dsad_interrupt_scan ( void );
CC-RL Compiler
static
void
__near r_pga_dsad_interrupt_scan ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 212 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Start
Starts A/D conversion.
[Syntax]
void
R_PGA_DSAD_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 213 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Stop
Ends A/D conversion.
[Syntax]
void
R_PGA_DSAD_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 214 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Set_PowerOff
Halts the clock supplied to the 24-bit ∆Σ A/D converter with programmable gain instrumentation amplifier.
[Syntax]
void
R_PGA_DSAD_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 215 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Get_AverageResult
Reads the average results of A/D conversion.(mean value)
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_PGA_DSAD_Get_AverageResult ( uint16_t * const bufferH, uint16_t * const
bufferL );
[Argument(s)]
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)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 216 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_Get_Result
Reads the results of A/D conversion.
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_PGA_DSAD_Get_Result ( uint16_t * const bufferH, uint16_t * const bufferL );
[Argument(s)]
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)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 217 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_DSAD_CAMP_OffsetTrimming
Connects the configurable amplifier to the 24-bit ∆Σ A/D converter and trims the offset.
[Syntax]
void
R_PGA_DSAD_CAMP_OffsetTrimming ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 218 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.20 A/D converter
Below is a list of API functions output by the Code Generator for A/D converter use.
Table 3.20
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 10bit resolution).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 219 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Create
Performs initialization necessary to control the A/D converter.
[Syntax]
void
R_ADC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 220 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Create_UserInit
Performs user-defined initialization relating to the A/D converter.
Remark
This API function is called as the R_ADC_Create callback routine.
[Syntax]
void
R_ADC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 221 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_adc_interrupt
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
__interrupt static
void
r_adc_interrupt ( void );
CC-RL Compiler
static
void
__near r_adc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 222 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_OperationOn
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]
void
R_ADC_Set_OperationOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 223 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_OperationOff
Disables operation of voltage converter.
[Syntax]
void
R_ADC_Set_OperationOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 224 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Start
Starts A/D conversion.
Remark
About 1 micro second 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 R_ADC_Set_OperationOn and
the call to this API function.
[Syntax]
void
R_ADC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 225 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Stop
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]
void
R_ADC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 226 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Reset
Reset A/D conversion.
[Syntax]
void
R_ADC_Reset ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 227 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_PowerOff
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]
void
R_ADC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 228 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_ADChannel
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]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_adc.h"
R_ADC_Set_ADChannel ( ad_channel_t channel );
[Argument(s)]
I/O
I
Argument
ad_channel_t
Remark
channel;
Description
Analog voltage input pin
ADCHANNELn:
Input pin
See the header file r_cg_adc.h for details about the analog voltage input pin ADCHANNELn.
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 229 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_SnoozeOn
Enables the switch from STOP mode to SNOOZE mode.
[Syntax]
void
R_ADC_Set_SnoozeOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 230 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_SnoozeOff
Disables the switch from STOP mode to SNOOZE mode.
[Syntax]
void
R_ADC_Set_SnoozeOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 231 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Set_TestChannel
Sets the operation mode of A/D converter.
[Syntax]
#include
#include
MD_STATUS
"r_cg_macrodriver.h"
"r_cg_adc.h"
R_ADC_Set_TestChannel ( test_channel_t channel );
[Argument(s)]
I/O
I
Argument
test_channel_t
channel;
Description
Operation mode of A/D converter
ADNORMALINPUT:
Normal mode (Normal A/D conversion)
ADAVREFM:
Test mode (AVREFM input)
ADAVREFP:
Test mode (AVREFP input)
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 232 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Get_Result
Reads the results of A/D conversion (10 bits).
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_ADC_Get_Result ( uint16_t * const buffer );
[Argument(s)]
I/O
O
Argument
uint16_t
* const buffer;
Description
Pointer to area in which to store read results of A/D conversion
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 233 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ADC_Get_Result_8bit
Reads the results of A/D conversion (8 bits; most significant 8 bits of 10-bit resolution).
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_ADC_Get_Result_8bit ( uint8_t * const buffer );
[Argument(s)]
I/O
O
Remark
Argument
Description
uint8_t * const buffer;
Pointer to area in which to store the results of A/D conversion
Below is an example of the results of A/D conversion to be stored in buffer.
15
8 7
0
B10 B9 B8 B7 B6 B5 B4 B3 B2 B1
Results of A/D conversion to be stored in buffer
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 234 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.21 Configurable amplifier
Below is a list of API functions output by the Code Generator for configurable amplifier use.
Table 3.21
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 configurable
amplifier.
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 235 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CAMP_Create
Performs initialization necessary to control the configurable amplifier.
[Syntax]
void
R_CAMP_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 236 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CAMP_Create_UserInit
Performs user-defined initialization relating to the configurable amplifier.
Remark
This API function is called as the R_CAMP_Create callback routine.
[Syntax]
void
R_CAMP_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 237 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CAMPn_Start
Turns on the power of the configurable amplifier(AMPn).
[Syntax]
void
R_CAMPn_Start ( void );
Remark
n is the channel number.ye
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 238 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CAMPn_Stop
Turns off the power of the configurable amplifier(AMPn).
[Syntax]
void
R_CAMPn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 239 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CAMP_Set_PowerOff
Halts the clock supplied to the configurable amplifier.
[Syntax]
void
R_CAMP_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 240 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.22 Temperature sensor
Below is a list of API functions output by the Code Generator for temperature sensor use.
Table 3.22
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 sensor.
R_TMPS_Stop
Ends measurement of the temperature that uses the temperature sensor.
R_TMPS_Set_PowerOff
Halts the clock supplied to the temperature sensor.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 241 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMPS_Create
Performs initialization necessary to control the temperature sensor.
[Syntax]
void
R_TMPS_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 242 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMPS_Create_UserInit
Performs user-defined initialization relating to the temperature sensor.
Remark
This API function is called as the R_TMPS_Create callback routine.
[Syntax]
void
R_TMPS_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 243 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMPS_Start
Starts measurement of the temperature that uses the temperature sensor.
[Syntax]
void
R_TMPS_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 244 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMPS_Stop
Ends measurement of the temperature that uses the temperature sensor.
[Syntax]
void
R_TMPS_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 245 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_TMPS_Set_PowerOff
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]
void
R_TMPS_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 246 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.23 24-bitDS A/D converter
Below is a list of API functions output by the Code Generator for 24-bit  A/D converter use.
Table 3.23
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 converter.
r_dsadc_interrupt
Performs processing in response to the  A/D conversion end interrupt
INTDSAD.
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_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).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 247 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Create
Performs initialization necessary to control the 24-bit  A/D converter.
[Syntax]
void
R_DSADC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 248 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Create_UserInit
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]
void
R_DSADC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 249 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dsadc_interrupt
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
__interrupt static
void
r_dsadc_interrupt ( void );
CC-RL Compiler
static
void
__near r_dsadc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 250 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Set_OperationOn
Enables operation of 24-bit  A/D converter.
[Syntax]
void
R_DSADC_Set_OperationOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 251 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Set_OperationOff
Disables operation of 24-bit  A/D converter.
[Syntax]
void
R_DSADC_Set_OperationOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 252 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Start
Starts A/D conversion.
[Syntax]
void
R_DSADC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 253 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Stop
Ends A/D conversion.
[Syntax]
void
R_DSADC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 254 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Set_PowerOff
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]
void
R_DSADC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 255 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Channeln_Get_Result
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]
#include
"r_cg_macrodriver.h"
void
R_DSADC_Channeln_Get_Result ( uint32_t * const buffer );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint32_t
* const buffer;
Description
Pointer to area in which to store read results of A/D conversion
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 256 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DSADC_Channeln_Get_Result_16bit
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]
#include
"r_cg_macrodriver.h"
void
R_DSADC_Channeln_Get_Result_16bit ( uint16_t * const buffer );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint16_t
* const buffer;
Description
Pointer to area in which to store the results of A/D conversion
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 257 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.24 D/A converter
Below is a list of API functions output by the Code Generator for D/A converter use.
Table 3.24
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)
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 258 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DAC_Create
Performs initialization necessary to control the D/A converter.
[Syntax]
void
R_DAC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 259 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DAC_Create_UserInit
Performs user-defined initialization relating to the D/A converter.
Remark
This API function is called as the R_DAC_Create callback routine.
[Syntax]
void
R_DAC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 260 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DACn_Start
Starts D/A conversion.
[Syntax]
void
R_DACn_Start ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 261 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DACn_Stop
Ends D/A conversion.
[Syntax]
void
R_DACn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 262 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DAC_Set_PowerOff
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]
void
R_DAC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 263 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DACn_Set_ConversionValue
Sets the analog voltage output to the ANOn pin.
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_DACn_Set_ConversionValue ( uint8_t reg_value );
Remark
n is the channel number.
[Argument(s)]
I/O
I
Argument
uint8_t reg_value;
Description
D/A conversion value (0x0 to 0xFF)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 264 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DAC_Change_OutputVoltage_8bit
Changes the output voltage of D/A converter.(8bit mode)
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_DAC_Change_OutputVoltage_8bit ( uint8_t outputVoltage );
[Argument(s)]
I/O
I
Argument
uint8_t outputVoltage;
Description
output Voltage (Low 8bit)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 265 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DAC_Change_OutputVoltage
Changes the output voltage of D/A converter.(12bit mode)
[Syntax]
#include
"r_cg_macrodriver.h"
void
R_DAC_Change_OutputVoltage ( uint16_t outputVoltage );
[Argument(s)]
I/O
I
Argument
uint16_t outputVoltage;
Description
output Voltage (Low 12bit)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 266 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.25 Programmable gain amplifier
Below is a list of API functions output by the Code Generator for programmable gain amplifier use.
Table 3.25
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 267 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Create
Performs initialization necessary to control the programmable gain amplifier.
[Syntax]
void
R_PGA_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 268 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Create_UserInit
Performs user-defined initialization relating to the programmable gain amplifier.
Remark
This API function is called as the R_PGA_Create callback routine.
[Syntax]
void
R_PGA_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 269 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Start
Starts the operation of programmable gain amplifier.
[Syntax]
void
R_PGA_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 270 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Stop
Ends the operation of programmable gain amplifier.
[Syntax]
void
R_PGA_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 271 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.26 Comparator
Below is a list of API functions output by the Code Generator for comparator use.
Table 3.26
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 voltage.
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 272 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMP_Create
Performs initialization necessary to control the comparator.
[Syntax]
void
R_COMP_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 273 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMP_Create_UserInit
Performs user-defined initialization relating to the comparator.
Remark
This API function is called as the R_COMP_Create callback routine.
[Syntax]
void
R_COMP_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 274 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_compn_interrupt
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
__interrupt static
void
r_compn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_compn_interrupt ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 275 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPn_Start
Begins comparison of reference input voltage and analog input voltage.
[Syntax]
void
Remark
R_COMPn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 276 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPn_Stop
Stops comparison of reference input voltage and analog input voltage.
[Syntax]
void
R_COMPn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 277 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMP_Reset
Reset the comparator.
[Syntax]
void
R_COMP_Reset ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 278 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMP_Set_PowerOff
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]
void
R_COMP_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 279 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.27 Comparator/ProgrammableGainAmplifier
Below is a list of API functions output by the Code Generator for comparator/programmable gain amplifier use.
Table 3.27
API Functions: [Comparator/ProgrammableGainAmplifier]
API Function Name
Function
R_COMPPGA_Create
Performs initialization necessary to control the comparator/programmable gain amplifier.
R_COMPPGA_Set_PowerOff
Halts the clock supplied to the comparator/programmable gain amplifier.
R_COMPPGA_Create_UserInit
Performs user-defined initialization relating to the comparator/programmable 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 voltage.
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 280 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPPGA_Create
Performs initialization necessary to control the comparator/programmable gain amplifier.
[Syntax]
void
R_COMPPGA_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 281 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPPGA_Set_PowerOff
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]
void
R_COMPPGA_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 282 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPPGA_Create_UserInit
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]
void
R_COMPPGA_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 283 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_compn_interrupt
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
__interrupt static
void
r_compn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_compn_interrupt ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 284 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPn_Start
Begins comparison of reference input voltage and analog input voltage.
[Syntax]
void
Remark
R_COMPn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 285 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_COMPn_Stop
Stops comparison of reference input voltage and analog input voltage.
[Syntax]
void
R_COMPn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 286 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Start
Starts the operation of programmable gain amplifier.
[Syntax]
void
R_PGA_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 287 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PGA_Stop
Ends the operation of programmable gain amplifier.
[Syntax]
void
R_PGA_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 288 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PWMOPT_Start
Supplies the clock to the 6-phase PWM option.
In addition, sets the operation mode of the 6-phase PWM option.
[Syntax]
void
R_PWMOPT_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 289 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_PWMOPT_Stop
Halts the clock supplied to the 6-phase PWM option.
[Syntax]
void
R_PWMOPT_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 290 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.28 Serial array unit
Below is a list of API functions output by the Code Generator for serial array unit use.
Table 3.28
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 interrupt 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 interrupt 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 interrupt 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 291 of 483
e2 studio Code Generator Tool
3.
API Function Name
API FUNCTIONS
Function
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).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 292 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Create
Performs initialization necessary to control the serial array unit.
[Syntax]
void
Remark
R_SAUm_Create ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 293 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Create_UserInit
Performs user-defined initialization related to the serial array unit.
Remark
This API function is called as the R_SAUm_Create callback routine.
[Syntax]
void
Remark
R_SAUm_Create_UserInit ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 294 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Reset
Reset the serial array unit.
[Syntax]
void
Remark
R_SAUm_Reset ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 295 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Set_PowerOff
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]
void
Remark
R_SAUm_Set_PowerOff ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 296 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Set_SnoozeOn
Enables the switch from STOP mode to SNOOZE mode.
[Syntax]
void
Remark
R_SAUm_Set_SnoozeOn ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 297 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAUm_Set_SnoozeOff
Disables the switch from STOP mode to SNOOZE mode.
[Syntax]
void
Remark
R_SAUm_Set_SnoozeOff ( void );
m is the unit number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 298 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTn_Create
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]
void
Remark
R_UARTn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 299 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_interrupt_send
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
__interrupt static
void
r_uartn_interrupt_send ( void );
CC-RL Compiler
static
Remark
void
__near r_uartn_interrupt_send ( void );
[n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 300 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_interrupt_receive
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
__interrupt static
void
r_uartn_interrupt_receive ( void );
CC-RL Compiler
static
Remark
void
__near r_uartn_interrupt_receive ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 301 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_interrupt_error
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
__interrupt static
void
r_uartn_interrupt_error ( void );
CC-RL Compiler
static
Remark
void
__near r_uartn_interrupt_error ( void );
[n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 302 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTn_Start
Sets UART communication to standby mode.
[Syntax]
void
Remark
R_UARTn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 303 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTn_Stop
Ends UART communication.
[Syntax]
void
R_UARTn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 304 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTn_Send
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_UARTn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 305 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTn_Receive
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_UARTn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 306 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_callback_sendend
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 corresponding 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]
static
Remark
void
r_uartn_callback_sendend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 307 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_callback_receiveend
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 corresponding to the UART reception end interrupt INTSRn (performed when number of received data specified by R_UARTn_Receive argument rx_num has been completed).
[Syntax]
static
Remark
void
r_uartn_callback_receiveend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 308 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_callback_error
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 corresponding to the UART reception error interrupt INTSREn.
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_uartn_callback_error ( uint8_t err_type );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint8_t err_type;
Description
Trigger for UART reception error interrupt
00000xx1B:
Overrun error
00000x1xB:
Parity error
000001xxB:
Framing error
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 309 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartn_callback_softwareoverrun
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 corresponding 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]
#include
"r_cg_macrodriver.h"
static void
r_uartn_callback_softwareoverrun ( uint16_t rx_data );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint16_t
rx_data;
Description
Receive data (greater than the argument rx_num specified for
R_UARTn_Receive)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 310 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Create
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]
void
Remark
R_CSImn_Create ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 311 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_csimn_interrupt
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]
__interrupt static
Remark
void
r_csimn_interrupt ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 312 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Start
Sets 3-wire serial I/O communication to standby mode.
[Syntax]
void
Remark
R_CSImn_Start ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 313 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Stop
Ends 3-wire serial I/O communication.
[Syntax]
void
Remark
R_CSImn_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 314 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Send
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_CSImn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
m is the unit number, and n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 315 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Receive
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_CSImn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
m is the unit number, and n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 316 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_CSImn_Send_Receive
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]
#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 );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 317 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_csimn_callback_sendend
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]
static
Remark
void
r_csimn_callback_sendend ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 318 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_csimn_callback_receiveend
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]
static
Remark
void
r_csimn_callback_receiveend ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 319 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_csimn_callback_error
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 corresponding to the CSI reception error interrupt INTSREn.
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_csimn_callback_error ( uint8_t err_type );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
I/O
O
Argument
uint8_t err_type;
Description
Trigger for CSI reception error interrupt
00000xx1B:
Overrun error
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 320 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_Create
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]
void
Remark
R_IICmn_Create ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 321 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iicmn_interrupt
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]
__interrupt static
Remark
void
r_iicmn_interrupt ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 322 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_StartCondition
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]
void
Remark
R_IICmn_StartCondition ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 323 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_StopCondition
Generates stop conditions.
[Syntax]
void
Remark
R_IICmn_StopCondition ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 324 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_Stop
Ends simple IIC communication.
[Syntax]
void
Remark
R_IICmn_Stop ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 325 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_Master_Send
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]
#include
"r_cg_macrodriver.h"
void
R_IICmn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
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
Remark
Below is shown the format for specifying device address adr.
7
0
B7 B6 B5 B4 B3 B2 B1 B0
Slave address
Device type
Device address
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 326 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICmn_Master_Receive
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]
#include
"r_cg_macrodriver.h"
void
R_IICmn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num
);
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
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
Remark
Below is shown the format for specifying device address adr.
7
0
B7 B6 B5 B4 B3 B2 B1 B0
Slave address
Device type
Device address
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 327 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iicmn_callback_master_sendend
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]
static
Remark
void
r_iicmn_callback_master_sendend ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 328 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iicmn_callback_master_receiveend
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]
static
Remark
void
r_iicmn_callback_master_receiveend ( void );
m is the unit number, and n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 329 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iicmn_callback_master_error
Performs processing in response to detection of parity error (ACK error).
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_iicmn_callback_master_error ( MD_STATUS flag );
Remark
m is the unit number, and n is the channel number.
[Argument(s)]
I/O
O
Argument
MD_STATUS flag;
Description
Cause of communication error
MD_NACK:
Acknowledge not detected
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 330 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.29 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.29
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 331 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DALIn_Create
Performs initialization necessary to control the serial array unit 4 (DALI/UART4).
[Syntax]
void
Remark
R_DALIn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 332 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_interrupt_send
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
__interrupt static
void
r_dalin_interrupt_send ( void );
CC-RL Compiler
static
Remark
void
__near r_dalin_interrupt_send ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 333 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_interrupt_receive
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
__interrupt static
void
r_dalin_interrupt_receive ( void );
CC-RL Compiler
static
Remark
void
__near r_dalin_interrupt_receive ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 334 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_interrupt_error
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
__interrupt static
void
r_dalin_interrupt_error ( void );
CC-RL Compiler
static
Remark
void
__near r_dalin_interrupt_error ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 335 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DALIn_Start
Sets DALI communication to standby mode.
[Syntax]
void
Remark
R_DALIn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 336 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DALIn_Stop
Ends DALI communication.
[Syntax]
void
R_DALIn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 337 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DALIn_Send
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_DALIn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 338 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DALIn_Receive
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]
#include
MD_STATUS
Remark
"r_cg_macrodriver.h"
R_DALIn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 339 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_callback_sendend
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 corresponding 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]
static
Remark
void
r_dalin_callback_sendend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 340 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_callback_receiveend
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 corresponding to the DALI reception end interrupt INTSRDLn (performed when number of received data specified by R_DALIn_Receive argument rx_num has been completed).
[Syntax]
static
Remark
void
r_dalin_callback_receiveend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 341 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_callback_error
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 corresponding to the DALI reception error interrupt INTSREDLn.
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_dalin_callback_error ( uint8_t err_type );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint8_t err_type;
Description
Trigger for DALI reception error interrupt
00000xx1B:
Overrun error
00000x1xB:
Parity error
000001xxB:
Framing error
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 342 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dalin_callback_softwareoverrun
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 corresponding 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]
#include
"r_cg_macrodriver.h"
static void
r_dalin_callback_softwareoverrun ( uint16_t rx_data );
Remark
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint16_t
rx_data;
Description
Receive data (greater than the argument rx_num specified for
R_DALIn_Receive)
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 343 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.30 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.30
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 interrupt 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 interrupt 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 344 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Create
Performs initialization necessary to control the asynchronous serial interface LIN-UART (UARTF).
[Syntax]
void
Remark
R_UARTFn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 345 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Create_UserInit
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]
void
Remark
R_UARTFn_Create_UserInit ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 346 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_interrupt_send
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
__interrupt static
void
r_uartfn_interrupt_send ( void );
CC-RL Compiler
static
Remark
void
__near r_uartfn_interrupt_send ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 347 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_interrupt_receive
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 interrupt INTLR.
[Syntax]
CA78K0R Compiler
__interrupt static
void
r_uartfn_interrupt_receive ( void );
CC-RL Compiler
static
Remark
void
__near r_uartfn_interrupt_receive ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 348 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_interrupt_error
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 interrupt INTLS.
[Syntax]
CA78K0R Compiler
__interrupt static
void
r_uartfn_interrupt_error ( void );
CC-RL Compiler
static
Remark
void
__near r_uartfn_interrupt_error ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 349 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Start
Sets LIN communication to standby mode.
[Syntax]
void
Remark
R_UARTFn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 350 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Stop
Ends LIN communication.
[Syntax]
void
Remark
R_UARTFn_Stop ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 351 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Set_PowerOff
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]
void
Remark
R_UARTFn_Set_PowerOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 352 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Send
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]
MD_STATUS
Remark
R_UARTFn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
MD_DATAEXISTS
Executing transmission process
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 353 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Receive
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]
MD_STATUS
Remark
R_UARTFn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 354 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Set_DataComparisonOn
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]
void
Remark
R_UARTFn_Set_DataComparisonOn ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 355 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_UARTFn_Set_DataComparisonOff
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]
void
Remark
R_UARTFn_Set_DataComparisonOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 356 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_sendend
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 corresponding 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]
static
Remark
void
r_uartfn_callback_sendend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 357 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_receiveend
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 corresponding 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]
static
Remark
void
r_uartfn_callback_receiveend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 358 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_error
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 corresponding to the LIN-UART reception status interrupt INTLS.
[Syntax]
static
Remark
void
r_uartfn_callback_error ( uint8_t err_type );
n is the channel number.
[Argument(s)]
I/O
O
Argument
uint8_t err_type;
Description
Trigger for LIN-UART reception status interrupt
00000xx1B:
Overrun error
00000x1xB:
Parity error
000001xxB:
Framing error
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 359 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_softwareoverrun
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 corresponding 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]
static
Remark
void
r_uartfn_callback_softwareoverrun ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 360 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_expbitdetect
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 corresponding to the LIN-UART reception status interrupt INTLS (performed when expansion bit has been
detected).
[Syntax]
static
Remark
void
r_uartfn_callback_expbitdetect ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 361 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_uartfn_callback_idmatch
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 corresponding to the LIN-UART reception status interrupt INTLS (performed when ID parity has been
matched).
[Syntax]
static
Remark
void
r_uartfn_callback_idmatch ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 362 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.31 Serial interface IICA
Below is a list of API functions output by the Code Generator for serial interface IICA use.
Table 3.31
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 interrupt INTIICAn.
R_IICAn_StopCondition
Generates stop conditions.
R_IICAn_Stop
Ends IICA communication.
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 interrupt INTIICAn.
r_iican_callback_master_error
Performs processing in response to detection of IICA master communication 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 interrupt INTIICAn.
r_iican_callback_slave_error
Performs processing in response to detection of IICA slave communication 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 363 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Create
Performs initialization necessary to control the serial interface IICA.
[Syntax]
void
Remark
R_IICAn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 364 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Create_UserInit
Performs user-defined initialization related to the serial interface IICA.
Remark
This API function is called as the R_IICAn_Create callback routine.
[Syntax]
void
Remark
R_IICAn_Create_UserInit ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 365 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_interrupt
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 interrupt INTIICAn.
[Syntax]
CA78K0R Compiler
__interrupt static
void
r_iican_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_iican_interrupt ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 366 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_StopCondition
Generates stop conditions.
[Syntax]
void
Remark
R_IICAn_StopCondition ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 367 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Stop
Ends IICA communication.
[Syntax]
void
R_IICAn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 368 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Set_PowerOff
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 function is called are ignored.
[Syntax]
void
Remark
R_IICAn_Set_PowerOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 369 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Master_Send
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]
#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 );
Remark
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ERROR1
Bus communication status
MD_ERROR2
Bus not released status
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 370 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Master_Receive
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]
#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 );
Remark
n is the channel number.
[Argument(s)]
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
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ERROR1
Bus communication status
MD_ERROR2
Bus not released status
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 371 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_master_sendend
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]
static
Remark
void
r_iican_callback_master_sendend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 372 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_master_receiveend
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]
static
Remark
void
r_iican_callback_master_receiveend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 373 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_master_error
Performs processing in response to detection of IICA master communication error.
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_iican_callback_master_error ( MD_STATUS flag
Remark
);
n is the channel number.
[Argument(s)]
I/O
I
Argument
MD_STATUS flag;
Description
Cause of communication error
MD_SPT:
Stop condition detected
MD_NACK:
Acknowledge not detected
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 374 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Slave_Send
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]
#include
"r_cg_macrodriver.h"
void
R_IICAn_Slave_Send ( uint8_t * const tx_buf, uint16_t tx_num );
Remark
n is the channel number.
[Argument(s)]
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
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 375 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Slave_Receive
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]
#include
"r_cg_macrodriver.h"
void
R_IICAn_Slave_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
Remark
n is the channel number.
[Argument(s)]
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
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 376 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_slave_sendend
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]
static
Remark
void
r_iican_callback_slave_sendend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 377 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_slave_receiveend
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]
static
Remark
void
r_iican_callback_slave_receiveend ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 378 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_slave_error
Performs processing in response to detection of IICA slave communication error.
[Syntax]
#include
"r_cg_macrodriver.h"
static void
r_iican_callback_slave_error ( MD_STATUS flag
Remark
);
n is the channel number.
[Argument(s)]
I/O
I
Argument
MD_STATUS flag;
Description
Cause of communication error
MD_ERROR:
Address mismatch detected
MD_NACK:
Acknowledge not detected
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 379 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_iican_callback_getstopcondition
Performs processing in response to detection of stop condition.
[Syntax]
static
Remark
void
r_iican_callback_getstopcondition ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 380 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Set_SnoozeOn
Enables operation of the address match wakeup function in STOP mode.
[Syntax]
void
Remark
R_IICAn_Set_SnoozeOn ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 381 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Set_SnoozeOff
Disables operation of the address match wakeup function in STOP mode.
[Syntax]
void
Remark
R_IICAn_Set_SnoozeOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 382 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Set_WakeupOn
Enables operation of the address match wakeup function in STOP mode.
[Syntax]
void
Remark
R_IICAn_Set_WakeupOn ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 383 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_IICAn_Set_WakeupOff
Disables operation of the address match wakeup function in STOP mode.
[Syntax]
void
Remark
R_IICAn_Set_WakeupOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 384 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.32 LCD controller/driver
Below is a list of API functions output by the Code Generator for LCD controller/driver use.
Table 3.32
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 circuit.
R_LCD_Set_VoltageOff
Disables operation of internal voltage boost circuit and capacitor split circuit.
R_LCD_Set_PowerOff
Halts the clock supplied to the LCD controller/driver.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 385 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Create
Performs initialization necessary to control the LCD controller/driver.
[Syntax]
void
R_LCD_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 386 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Create_UserInit
Performs user-defined initialization relating to the LCD controller/driver.
Remark
This API function is called as the R_LCD_Create callback routine.
[Syntax]
void
R_LCD_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 387 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_lcd_interrupt
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
__interrupt static
void
r_lcd_interrupt ( void );
CC-RL Compiler
static
void
__near r_lcd_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 388 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Start
Sets the LCD controller/driver to display on status.
[Syntax]
void
R_LCD_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 389 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Stop
Sets the LCD controller/driver to display off status.
[Syntax]
void
R_LCD_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 390 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Set_VoltageOn
Enables operation of internal voltage boost circuit and capacitor split circuit.
[Syntax]
void
R_LCD_Set_VoltageOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 391 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Set_VoltageOff
Disables operation of internal voltage boost circuit and capacitor split circuit.
[Syntax]
void
R_LCD_Set_VoltageOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 392 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LCD_Set_PowerOff
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]
void
R_LCD_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 393 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.33 Sound generator
Below is a list of API functions output by the Code Generator for sound generator use.
Table 3.33
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 394 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SG_Create
Performs initialization necessary to control the sound generator.
[Syntax]
void
R_SG_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 395 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SG_Create_UserInit
Performs user-defined initialization relating to the sound generator.
Remark
This API function is called as the R_SG_Create callback routine.
[Syntax]
void
R_SG_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 396 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_sg_interrupt
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
__interrupt static
void
r_sg_interrupt ( void );
CC-RL Compiler
static
void
__near r_sg_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 397 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SG_Start
Enables operation of sound generator.
[Syntax]
void
R_SG_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 398 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SG_Stop
Disables operation of sound generator.
[Syntax]
void
R_SG_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 399 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.34 DMA controller
Below is a list of API functions output by the Code Generator for DMA controller use.
Table 3.34
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 400 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMACn_Create
Performs initialization necessary to control the DMA controller.
[Syntax]
void
Remark
R_DMACn_Create ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 401 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMACn_Create_UserInit
Performs user-defined initialization relating to the DMA controller.
Remark
This API function is called as the R_DMACn_Create callback routine.
[Syntax]
void
Remark
R_DMACn_Create_UserInit ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 402 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMAC_Create
Performs initialization necessary to control the DMA controller.
[Syntax]
void
R_DMAC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 403 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMAC_Create_UserInit
Performs user-defined initialization relating to the DMA controller.
Remark
This API function is called as the R_DMAC_Create callback routine.
[Syntax]
void
R_DMAC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 404 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_dmacn_interrupt
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
__interrupt static
void
r_dmacn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_dmacn_interrupt ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 405 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMACn_Start
Enables operation of channel n.
[Syntax]
void
Remark
R_DMACn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 406 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMACn_Stop
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]
void
R_DMACn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 407 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DMACn_Set_SoftwareTriggerOn
Starts DMA transfer.
[Syntax]
void
Remark
R_DMACn_Set_SoftwareTriggerOn ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 408 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.35 Data transfer controller
Below is a list of API functions output by the Code Generator for Data transfer controller use.
Table 3.35
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 409 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DTC_Create
Performs initialization necessary to control the DTC.
[Syntax]
void
R_DTC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 410 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DTC_Create_UserInit
Performs user-defined initialization relating to the DTC.
Remark
This API function is called as the R_DTC_Create callback routine.
[Syntax]
void
R_DTC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 411 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DTCn_Start
Enables operation of the DTC.
[Syntax]
void
R_DTCn_Start ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 412 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DTCn_Stop
Disables operation of the DTC.
[Syntax]
void
R_DTCn_Stop ( void );
Remark
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 413 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DTC_Set_PowerOff
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]
void
R_DTC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 414 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.36 Event link controller
Below is a list of API functions output by the Code Generator for event link controller (ELC) use.
Table 3.36
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).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 415 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ELC_Create
Performs initialization necessary to control the event link controller (ELC).
[Syntax]
void
R_ELC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 416 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ELC_Create_UserInit
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]
void
R_ELC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 417 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_ELC_Stop
Disables operation of the event link controller (ELC).
[Syntax]
void
R_ELC_Stop ( uint32_t event );
[Argument(s)]
I/O
I
Remark
Argument
uint32_t
Description
Disabled event source
event;
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.
31
0
B31
B0
B25 B24
...
...
Event source 00
Event source 24
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 418 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.37 Interrupt functions
Below is a list of API functions output by the Code Generator for interrupt functions use.
Table 3.37
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 419 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTC_Create
Performs initialization necessary to control the interrupt functions.
[Syntax]
void
R_INTC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 420 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTC_Create_UserInit
Performs user-defined initialization relating to the interrupt functions.
Remark
This API function is called as the R_INTC_Create callback routine.
[Syntax]
void
R_INTC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 421 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_intcn_interrupt
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
__interrupt static
void
r_intcn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_intcn_interrupt ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 422 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTCn_Start
Enables the acceptance of the external maskable interrupts INTPn.
[Syntax]
void
Remark
R_INTCn_Start ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 423 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTCn_Stop
Disables the acceptance of the external maskable interrupts INTPn.
[Syntax]
void
Remark
R_INTCn_Stop ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 424 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_intclrn_interrupt
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
__interrupt static
void
r_intclrn_interrupt ( void );
CC-RL Compiler
static
Remark
void
__near r_intclrn_interrupt ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 425 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTCLRn_Start
Enables the acceptance of the external maskable interrupts INTPLRn.
[Syntax]
void
Remark
R_INTCLRn_Start ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 426 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_INTCLRn_Stop
Disables the acceptance of the external maskable interrupts INTPLRn.
[Syntax]
void
Remark
R_INTCLRn_Stop ( void );
n is the interrupt factor number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 427 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.38 Key interrupt function
Below is a list of API functions output by the Code Generator for key interrupt function use.
Table 3.38
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 428 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KEY_Create
Performs initialization necessary to control the key interrupt function.
[Syntax]
void
R_KEY_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 429 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KEY_Create_UserInit
Performs user-defined initialization relating to the key interrupt function.
Remark
This API function is called as the R_KEY_Create callback routine.
[Syntax]
void
R_KEY_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 430 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_key_interrupt
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
__interrupt static
void
r_key_interrupt ( void );
CC-RL Compiler
static
void
__near r_key_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 431 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KEY_Start
Enables the acceptance of the key interrupt INTKR.
[Syntax]
void
R_KEY_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 432 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_KEY_Stop
Disables the acceptance of the key interrupt INTKR.
[Syntax]
void
R_KEY_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 433 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.39 Voltage detector
Below is a list of API functions output by the Code Generator for voltage detector use.
Table 3.39
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_InterruptMode_Start
Starts voltage detection (when in interrupt mode, and interrupt & reset
mode).
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).
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 434 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVD_Create
Performs initialization necessary to control the voltage detector.
[Syntax]
void
R_LVD_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 435 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVD_Create_UserInit
Performs user-defined initialization relating to the voltage detector.
Remark
This API function is called as the R_LVD_Create callback routine.
[Syntax]
void
R_LVD_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 436 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_lvd_interrupt
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
__interrupt static
void
r_lvd_interrupt ( void );
CC-RL Compiler
static
void
__near r_lvd_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 437 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVD_InterruptMode_Start
Starts voltage detection (when in interrupt mode, and interrupt & reset mode).
[Syntax]
void
R_LVD_InterruptMode_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 438 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVI_Create
Performs initialization necessary to control the voltage detector.
[Syntax]
void
R_LVI_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 439 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVI_Create_UserInit
Performs user-defined initialization relating to the voltage detector.
Remark
This API function is called as the R_LVI_Create callback routine.
[Syntax]
void
R_LVI_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 440 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_lvi_interrupt
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
__interrupt static
void
r_lvi_interrupt ( void );
CC-RL Compiler
static
void
__near r_lvi_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 441 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_LVI_InterruptMode_Start
Starts voltage detection (when in interrupt mode, and interrupt & reset mode).
[Syntax]
void
R_LVI_InterruptMode_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 442 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.40 Battery backup function
Below is a list of API functions output by the Code Generator for battery backup function use.
Table 3.40
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 interrupt INTVBAT.
R_BUP_Start
Enables operation of battery backup function.
R_BUP_Stop
Disables operation of battery backup function.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 443 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_BUP_Create
Performs initialization necessary to control the battery backup function.
[Syntax]
void
R_BUP_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 444 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_BUP_Create_UserInit
Performs user-defined initialization relating to the battery backup function.
Remark
This API function is called as the R_BUP_Create callback routine.
[Syntax]
void
R_BUP_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 445 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_bup_interrupt
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 interrupt INTVBAT.
[Syntax]
CA78K0R Compiler
__interrupt static
void
r_bup_interrupt ( void );
CC-RL Compiler
static
void
__near r_bup_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 446 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_BUP_Start
Enables operation of battery backup function.
[Syntax]
void
R_BUP_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 447 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_BUP_Stop
Disables operation of battery backup function.
[Syntax]
void
R_BUP_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 448 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.41 Oscillation stop detector
Below is a list of API functions output by the Code Generator for oscillation stop detector use.
Table 3.41
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 interrupt 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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 449 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OSDC_Create
Performs initialization necessary to control the oscillation stop detector.
[Syntax]
void
R_OSDC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 450 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OSDC_Create_UserInit
Performs user-defined initialization relating to the oscillation stop detector.
Remark
This API function is called as the R_OSDC_Create callback routine.
[Syntax]
void
R_OSDC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 451 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_osdc_interrupt
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 interrupt INTOSDC.
[Syntax]
CA78K0R Compiler
__interrupt static
void
r_osdc_interrupt ( void );
CC-RL Compiler
static
void
__near r_osdc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 452 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OSDC_Start
Enables operation of oscillation stop detector.
[Syntax]
void
R_OSDC_Start ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 453 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OSDC_Stop
Disables operation of oscillation stop detector.
[Syntax]
void
R_OSDC_Stop ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 454 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OSDC_Set_PowerOff
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]
void
R_OSDC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 455 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.42 SPI interface
Below is a list of API functions output by the Code Generator for SPI interface use.
Table 3.42
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 456 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAIC_Create
Performs initialization necessary to control the SPI interface.
[Syntax]
void
R_SAIC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 457 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAIC_Create_UserInit
Performs user-defined initialization relating to the SPI interface.
Remark
This API function is called as the R_SAIC_Create callback routine.
[Syntax]
void
R_SAIC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 458 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAIC_Write
Starts SPI data transmission.
[Syntax]
void
R_SAIC_Write ( const smartanalog_t * p_saic_data );
[Argument(s)]
I/O
I
Argument
const smartanalog_t
* p_saic_data;
Description
Pointer to area storing the transmission data
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 459 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_SAIC_Read
Starts SPI data reception.
[Syntax]
void
R_SAIC_Read ( const smartanalog_t * p_saic_data, smartanalog_t *
p_saic_read_buf );
[Argument(s)]
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
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 460 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.43 Operational amplifier
Below is a list of API functions output by the Code Generator for Operational Amplifier use.
Table 3.43
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 461 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMP_Create
Performs initialization necessary to control the comparator.
[Syntax]
void
R_OPAMP_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 462 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMP_Create_UserInit
Performs user-defined initialization relating to the comparator.
Remark
This API function is called as the R_OPAMP_Create callback routine.
[Syntax]
void
R_OPAMP_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 463 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMP_Set_ReferenceCurcuitOn
Enables operational amplifier reference current circuit.
[Syntax]
void
R_OPAMP_Set_ReferenceCircuitOn ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 464 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMP_Set_ReferenceCircuitOff
Disables operational amplifier reference current circuit.
[Syntax]
void
R_OPAMP_Set_ReferenceCircuitOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 465 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMPn_Start
Starts operational amplifier of unit n.
[Syntax]
void
Remark
R_OPAMPn_Start ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 466 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMPn_Stop
Stops operational amplifier of unit n.
[Syntax]
void
Remark
R_OPAMPn_Stop ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 467 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMPn_Set_PrechargeOn
Starts precharging of the external capacitor of the operational amplifier n.
[Syntax]
void
Remark
R_OPAMPn_Set_PrechargeOn ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 468 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_OPAMPn_Set_PrechargeOff
Stops precharging of the external capacitor of the operational amplifier n.
[Syntax]
void
Remark
R_OPAMPn_Set_PrechargeOff ( void );
n is the channel number.
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 469 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
3.2.44 Data operation circuit
Below is a list of API functions output by the Code Generator for comparator use.
Table 3.44
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.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 470 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_Create
Performs initialization necessary to control the data operation circuit.
[Syntax]
void
R_DOC_Create ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 471 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_Create_UserInit
Performs user-defined initialization relating to the data operation circuit.
Remark
This API function is called as the R_DOC_Create callback routine.
[Syntax]
void
R_DOC_Create_UserInit ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 472 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
r_doc_interrupt
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
__interrupt static
void
r_doc_interrupt ( void );
CC-RL Compiler
static
void
__near r_doc_interrupt ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 473 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_SetMode
Configures the operation mode of data operation circuit.
[Syntax]
#include
#include
MD_STATUS
“r_cg_macrodriver.h”
“r_cg_doc.h”
R_DOC_SetMode ( doc_mode_t mode, uint16_t value);
[Argument(s)]
I/O
Argument
Description
I
doc_mode_t mode;
Operation mode of data operation circuit
ADDTION:
Data addition mode
SUBTRACTION:
Data subtraction mode
COMPARE_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 operations
Data comparison :16-bit data for use as a reference
[Return value]
Macro
Description
MD_OK
Normal completion
MD_ARGERROR
Invalid argument specification
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 474 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_WriteData
Writes new data to compare, add or subtract.
Remark
Write data to DODIR register.
[Syntax]
#include
void
“r_cg_macrodriver.h”
R_DOC_WriteData ( uint16_t data );
[Argument(s)]
I/O
O
Argument
uint16_t data;
Description
data to compare, add or subtract
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 475 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_GetResult
Gets result of addition or subtraction.
[Syntax]
#include
void
“r_cg_macrodriver.h”
R_DOC_GetResult ( uint16_t *const data );
[Argument(s)]
I/O
O
Argument
uint16_t *const data
Description
pointer to where result will be stored
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 476 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_ClearFlag
Clears DOPCF flag of DOC control register (DOCR).
[Syntax]
void
R_DOC_ClearFlag ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 477 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_Set_PowerOff
Stops the clock supplied for data operation circuit.
[Syntax]
void
R_DOC_Set_PowerOff ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 478 of 483
e2 studio Code Generator Tool
3.
API FUNCTIONS
R_DOC_Reset
Resets Data operation circuit module.
[Syntax]
void
R_DOC_Reset ( void );
[Argument(s)]
None.
[Return value]
None.
R20UT3127EJ0102 Rev.1.02
Aug 01, 2015
Page 479 of 483
Revision Record
Rev.
Date
Description
Page
Summary
1.00
Aug 01, 2015
-
First Edition issued
1.01
Dec 01, 2014
8
2. OUTPUT FILES
TimerRJ, TimerRD API addition
12
2. OUTPUT FILES
Comparator/Programmable gain amplifier API addition
64 70
3.2.5 Timer RJ
API addition
81 89
3.2.6 Timer RD
API addition
253 263
3.2.24 Comparator/Programmable gain amplifier
chapter addition
8, 11,
12, 16
2. OUTPUT FILES
API addition
・Timer RX
・PGA+DS A/D converter
・Configurable Amp
・D/A converter
・Voltage detector
1.02
Aug 01, 2015
98 105
3.2.8 Timer RX
chapter addition
208 218
3.2.19 PGA+DS A/D converter
chapter addition
235 240
3.2.21 Configurable Amp
chapter addition
265 266
3.2.24 D/A converter
API addition
439 442
3.2.39 Voltage detector
API addition
C-1
e2 studio Code Generator Tool User's Manual:
RL78 API Reference
Publication Date:
Published by:
Rev.1.00
Aug 01, 2014
Rev.1.02
Aug 01, 2015
Renesas Electronics Corporation
http://www.renesas.com
SALES OFFICES
Refer to "http://www.renesas.com/" for the latest and detailed information.
Renesas Electronics America Inc.
2801 Scott Boulevard Santa Clara, CA 95050-2549, U.S.A.
Tel: +1-408-588-6000, Fax: +1-408-588-6130
Renesas Electronics Canada Limited
9251 Yonge Street, Suite 8309 Richmond Hill, Ontario Canada L4C 9T3
Tel: +1-905-237-2004
Renesas Electronics Europe Limited
Dukes Meadow, Millboard Road, Bourne End, Buckinghamshire, SL8 5FH, U.K
Tel: +44-1628-585-100, Fax: +44-1628-585-900
Renesas Electronics Europe GmbH
Arcadiastrasse 10, 40472 Düsseldorf, Germany
Tel: +49-211-6503-0, Fax: +49-211-6503-1327
Renesas Electronics (China) Co., Ltd.
Room 1709, Quantum Plaza, No.27 ZhiChunLu Haidian District, Beijing 100191, P.R.China
Tel: +86-10-8235-1155, Fax: +86-10-8235-7679
Renesas Electronics (Shanghai) Co., Ltd.
Unit 301, Tower A, Central Towers, 555 Langao Road, Putuo District, Shanghai, P. R. China 200333
Tel: +86-21-2226-0888, Fax: +86-21-2226-0999
Renesas Electronics Hong Kong Limited
Unit 1601-1611, 16/F., Tower 2, Grand Century Place, 193 Prince Edward Road West, Mongkok, Kowloon, Hong Kong
Tel: +852-2265-6688, Fax: +852 2886-9022
Renesas Electronics Taiwan Co., Ltd.
13F, No. 363, Fu Shing North Road, Taipei 10543, Taiwan
Tel: +886-2-8175-9600, Fax: +886 2-8175-9670
Renesas Electronics Singapore Pte. Ltd.
80 Bendemeer Road, Unit #06-02 Hyflux Innovation Centre, Singapore 339949
Tel: +65-6213-0200, Fax: +65-6213-0300
Renesas Electronics Malaysia Sdn.Bhd.
Unit 1207, Block B, Menara Amcorp, Amcorp Trade Centre, No. 18, Jln Persiaran Barat, 46050 Petaling Jaya, Selangor Darul Ehsan, Malaysia
Tel: +60-3-7955-9390, Fax: +60-3-7955-9510
Renesas Electronics India Pvt. Ltd.
No.777C, 100 Feet Road, HALII Stage, Indiranagar, Bangalore, India
Tel: +91-80-67208700, Fax: +91-80-67208777
Renesas Electronics Korea Co., Ltd.
12F., 234 Teheran-ro, Gangnam-Gu, Seoul, 135-080, Korea
Tel: +82-2-558-3737, Fax: +82-2-558-5141
© 2015 Renesas Electronics Corporation. All rights reserved.
Colophon 4.0
e studio Code Generator Tool
2
R20UT3127EJ0102
Download PDF