Home
RL78 Design - Renesas Electronics
Contents
1. API Function Name Function R_DAC_Create Performs initialization necessary to control the D A converter R_DAC_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 293 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DAC_Create Performs initialization necessary to control the D A converter Syntax void R_DAC Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 294 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DAC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 295 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DACn_Start Starts D A conversion Syntax void R_DACn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1
2. timer _channel_t channel Pin to read TMCHANNELA TRDIOAn pin TMCHANNELB TRDIOBn pin TMCHANNELC TRDIOCn pin TMCHANNELD TRDIODn pin Return value Macro Description MD_OK Normal completion R20UT2684EJ0100 Rev 1 00 RENESAS Page 151 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 7 Timer RG Below is a list of API functions output by the Code Generator for timer RG use Table C 7 API Functions Timer RG API Function Name Function R_TMR_RGO_Create Performs initialization necessary to control the 16 bit timer RGO R_TMR_RGO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer RGO r_tmr_rgO_interrupt Performs processing in response to the timer interrupt R_TMR_RGO_ Start Starts the count for 16 bit timer RGO R_TMR_RGO_Stop Ends the count for 16 bit timer RGO R_TMR_RGO_Set_PowerOff Halts the clock supplied to the 16 bit timer RGO R_TMR_RGO_Get_PulseWidth Reads the pulse width of the 16 bit timer RGO R20UT2684EJ0100 Rev 1 00 2tENESAS Page 152 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RGO_Create Performs initialization necessary to control the 16 bit timer RGO Syntax void R_TMR_RGO Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 153 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX
3. Syntax void R_DSADC_Set_OperationOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 287 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_ Start Starts A D conversion Syntax void R_DSADC_Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 288 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_ Stop Ends A D conversion Syntax void R_DSADC_Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 289 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_Set_PowerOff Performs electric charge reset for the 24 bit A gt A D converter Remark About 1 4 microseconds of stabilization time is required when electric charge reset is performed for the 24 bit AX A D converter Syntax void R_DSADC_Set_PowerOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 290 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Ad A D conversion result registe
4. 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 R20UT2684EJ0100 Rev 1 00 7tENESAS Page 109 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_Set_CRCOn Starts the CRC operation function Syntax void R_CGC_Set_CRCOn void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 110 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_RAMECC _ Start Starts the RAM ECC function Syntax void R_CGC_RAMECC_ Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 111 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_RAMECC_Stop Ends the RAM ECC function Syntax void R_CGC_RAMECC_Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 112 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_StackPointer_Sitart Starts the CPU stack pointer function Syntax void R_CGC_StackPointer Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 113 of 480 Sep 01 2013 CubeS
5. Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 353 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dalin_interrupt_receive Performs processing in response to the DALI reception end interrupt INTSRDL n Remark This API function is called as the interrupt process corresponding to the DALI reception end interrupt INTSRDL n Syntax __interrupt static void r_dalin_interrupt_receive void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 354 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_dalin_interrupt_error void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 355 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DALIn_ Start Sets DALI communication to standby mode Syntax void R_DALIn Start void Remark nis the channel number Argumeni s None Return value None
6. wig DISCONNECT The following items are explained here How to open Description of each area How to open From the start menu select All Programs gt gt Renesas Electronics CubeSuite gt gt CubeSuite Description of each area 1 Menu bar This area consists of the following menu items a File menu Save Pin List Device Pin List panel dedicated item Saves a report file a file containing information configured using Pin Configurator device pin list overwriting the existing file R20UT2684EJ0100 Rev 1 00 2tENESAS Page 40 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Save Pin List As Device Pin List panel dedicated item Opens the Save As dialog box for naming and saving a report file a file containing information configured using Pin Configurator device pin list Save Top View Device Top View panel dedicated item Saves a report file a file containing information configured using Pin Configurator device top view overwriting the existing file Save Top View As Device Top View panel dedicated item Opens the Save As dialog box for naming and saving a report file a file containing information configured using Pin Configurator device top view Save Code Generator Report Peripheral Functions panel Code Preview panel dedicated item Outputs report files a file containing information configured us
7. Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 165 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TMR_KBm Set_PowerOff void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 166 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KBmn_ForcedOutput_Start Enables input of the trigger signal used for the forced output stop function Syntax void R_TMR_KBmn ForcedOutput_Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 167 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KBmn_ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop function Syntax void R_TMR_KBmn_ ForcedOutput_Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2t
8. 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 inter rupt 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_Set_CRCOn Starts the CRC operation function 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 102 of 480 CubeSuite V2 01 00 APPENDIX C 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 103 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC _Create_Us
9. Figure A 2 Project Tree Panel Project Tree x gt 8 fa U sample Project Es A Pin Configurator Design Tool E ez Code Generator Design Tool A CA78KOR Build Tool 2 RL78 Simulator Debug Tool File The following items are explained here How to open Description of each area Context menu How to open From the View menu select Project Tree Description of each area 1 Project tree area This area displays components of the project microcontroller design tool build tool etc in a tree structure a Pin Configurator Design Tool This node consists of the following pin nodes Device Pin List Opens the Device Pin List panel for entering information on the pins of the microcontroller Device Top View Opens the Device Top View panel that displays the information entered in the Device Pin List panel b Code Generator Design Tool The sub nodes of this node are Peripheral Functions and Code Preview lt 1 gt Peripheral Functions The sub node of this node is the peripheral function node for the peripheral functions clock generator port functions etc supported by the target device R20UT2684EJ0100 Rev 1 00 2tENESAS Page 44 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Peripheral function node Double click on a peripheral function node or press the Enter key after selecting a peripheral
10. R20UT2684EJ0100 Rev 1 00 ztENESAS Page 70 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Device Top View panel This panel displays the information entered in the Device Pin List panel Remark The Device top view area can be zoomed in and out by in the tool bar Figure A 18 Device Top View Panel m User Define To register drag and drop the user define to the top view O PIAHI AYREFU PITHI 1 O Pit SOORA T OLD A00 P12 S000 TdT LTD Pies TOs TOO A MTS S011 Pars Tica Tooa Ss 11 30411 P50 INPS sat 1 ScLt The following items are explained here How to open Description of each area Context menu How to open On the Project Tree panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then press the Enter key From the View menu select Pin Configurator gt gt Device Top View Remark In the Property panel on the Pin Configurator Settings tab gt gt Package gt gt Package type if BGA is selected then this panel cannot be opened Description of each area 1 Toolbar This area consists of the following buttons R20UT2684EJ0100 Rev 1 00 2tENESAS Page 71 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDI
11. Syntax void R_SAIC Write const smartanalog_t p saic data j Argumeni s 1 0 Argument Description const smartanalog_t Pointer to area storing the transmission data p saic data Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 475 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 j Argumeni s VO Argument Description O const smartanalog_t Pointer to area to store the received data p saic da t smartanalog_t p saic _ read buf Pointer to a buffer to store the received data Return value None R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 476 of 480 Revision Record Description Rev Sep 01 2013 Pef First Edition issued CubeSuite V2 01 00 User s Manual RL78 Design Publication Date Rev 1 00 Sep 01 2013 Published by Renesas Electronics Corporation rCENESAS SALES OFFICES Renesas Electronics Corporation http www renesas com Refer to http www renesas com for the latest and detailed information Renesas Electronics America Inc 2880 Scott Boulevard Santa Clara CA 95050 2554 U S A Tel 1 408 588 6000 Fax 1 408 588 6130 Renesas Electronics Canada Limited 1101 Nicholson Road Newmarket Ontario L3Y
12. Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 402 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Set_WakeupOn Enables operation of the address match wakeup function in STOP mode Syntax void R_IICAn Set _WakeupOn void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 403 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Set_WakeupOff Disables operation of the address match wakeup function in STOP mode Syntax void R_IICAn Set _WakeupOff void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 404 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 28 LCD controller driver Below is a list of API functions output by the Code Generator for LCD controller driver use Table C 28 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_Icd_interrupt Performs processing in response to the LCD frame interrupt INTLCD R_LCD_ Start Sets th
13. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 356 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DALIn_Stop Ends DALI communication Syntax void R_DALIn Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 357 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 2 When performing a DALI transmission R_DALIn_Start must be called before this API function is called Syntax include r cg macrodriver h MD_STATUS R_DALIn Send uint8_t const tx buf uint16_t tx_num Remark nis the channel number Argumeni s vO Argument Description l uint8_t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 358 of 480 CubeSuite V2 01 00 APPENDIX C 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 t
14. Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 317 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAUm Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode Syntax void R_SAUm_Set_SnoozeOff void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 318 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_UARTn Create void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 319 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_uartn_interrupt_send void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Re
15. void R_KB2m_TKBOn0O Forced Output Stop Functionl Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 189 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Siart Starts forced output stop function 2 for timer output TKBOn1 Syntax void R_KB2m_TKBOnl Forced Output _Stop Functionl Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 190 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_Forced_Output_Stop_Function1_Stop Ends forced output stop function 2 for timer output TKBOn1 Syntax void R_KB2m_TKBOn1l Forced Output _Stop Functionl Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 191 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_DitheringFunction_Start Starts dithering function for timer output TKBOn0 Syntax void R_KB2m_TKBOn0O DitheringFunction Start void Remark mis the unit number and n is the channel number Argumeni s None Return value Non
16. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 418 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SG_Stop Disables operation of sound generator Syntax void R_SG Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 419 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 30 DMA controller Below is a list of API functions output by the Code Generator for DMA controller use Table C 30 API Functions DMA Controller API Function Name Function R_DMACn_Create Performs initialization necessary to control the DMA controller R_DMACn_Create_Userlnit Performs user defined initialization relating to the DMA controller R_DMAC_Create Performs initialization necessary to control the DMA controller R_DMAC_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 RENESAS Page 420 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMACn_Create Performs initialization necessary to control the DMA controller Syntax void R_DMACn Create void Remark nis t
17. R_FMC_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 222 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_FMC Create Performs initialization necessary to control the subsystem clock frequency measurement circuit Syntax void R_FMC Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 223 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_FMC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 224 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_fmc_interr
18. 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 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 Renesas Electronics products are classified according to the following two quality grades Standard and High Quality The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below Standard Computers office equipment communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots etc High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems and safety equipment etc Renesas Electronics products are neither intended nor
19. None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 161 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KBm _Create_Userlnit 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 R TMR KBm Create UserInit void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 162 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_tmr_kbm_interrupt void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 163 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KBm Start Starts the count for 16 bit timer KB Syntax void R_TMR_KBm Start void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 164 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KBm Stop Ends the count for 16 bit timer KB Syntax void R_TMR_KBm Stop void
20. void R_FMC_Set_PowerOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 228 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 13 12 bit interval timer Below is a list of API functions output by the Code Generator for 12 bit interval timer use Table C 13 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 Userlnit 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_Set_PowerOff Halts the clock supplied to the 12 bit interval timer R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 229 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT_Create Performs initialization necessary to control the 12 bit interval timer Syntax void R_IT Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 230 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT_Create_Userlnit Performs user defined initialization relating to the 12 bit interval
21. 1 Source code display area This area allows you to confirm the source code device driver program that reflects the information configured in the Peripheral Functions panel The following table displays the meaning of the color of the source code text displayed in this area Table A 2 Color of Source Code Green Comment Blue Reserved word for C compiler Red Numeric value Black Code section R20UT2684EJ0100 Rev 1 00 ztENESAS Page 75 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Remarks 1 You cannot edit the source code within this panel 2 For some of the API functions values such as the register value are calculated and finalized when the source code is generated when the l Generate Code button on the Peripheral Functions panel is pressed For this reason the source code displayed in this panel may not be the same as that would actually be generated Context menu The following context menu items are displayed by right clicking the mouse Copy Sends the character string or lines selected with range selection to the clipboard Select All Selects all the messages displayed on the Source code display area R20UT2684EJ0100 Rev 1 00 ztENESAS Page 76 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Output panel This panel displays operation logs for various components design tool build tool etc provided by CubeSuite The mess
22. APPENDIX C 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 r cg macrodriver h include r cg adc h MD_STATUS R_ADC_Set_ADChannel ad_channel_t channel j Argumeni s VO Argument Description l ad_channel_t channel Analog voltage input pin ADCHANNELn Input pin Remark 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 270 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC_ Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode Syntax void R_ADC Set _SnoozeOn void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 271 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC Set _SnoozeOff Disables the switch from STOP mode to SNOOZE mode Syntax void R_ADC Set _SnoozeOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 272 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC _Set_TestChann
23. PinNumber N ch Define POVANITE TOOO RxD1 P01 I O 1 POWANIT7 TIOD TxD1 P00 I O 2 No DAAT ANI A e H Remark To change the display order click the button in the upper left of the device pin list The Column Chooser dialog box opens Drag an item displayed in the dialog s select Items to display area and drop it to the desired destination in the device pin list This will change the display order R20UT2684EJ0100 Rev 1 00 7tENESAS Page 12 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 3 Add column The Pin Configurator is used to add the user s own column to the device pin list using the New Column button in the Column Chooser dialog box that opens by pressing the button in the upper left corner of the device pin list To add a column use the New Column dialog box that opens by pressing the New Column button in the Column Chooser dialog box Figure 2 4 Add Column New Column Ea Name Type Text Remark On the device pin list adding columns to the first level of Macro tab External Peripheral tab is restricted 2 2 4 Delete column The Pin Configurator is used to delete the user s own column from the device pin list using the Delete Column button in the Column Chooser dialog box that opens by pressing the button in the upper left corner of the device pin list To delete a column select the column you want to delete in the displayed item selectio
24. R20UT2684EJ0100 Rev 1 00 tENESAS Page 94 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS APPENDIX C API FUNCTIONS This appendix describes the API functions output by the Code Generator C 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 C 2 Function Reference This section describes the API functions output by the Code Generator using the following notation format Figure C 1 Notation Format of API Functions 4 Argument s 1 0 Argument Description Macro Description 1 Name Indicates the name of the API function 2 Outline Outlines the functions of the API function R20UT2684EJ0100 Rev 1 00 ztENESAS Page 95 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS 3 Syntax Indicates the format to be used when describing an API function to be called in C language 4 Argument s API function arguments are explained in the following format a b c a 1 0
25. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 281 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 20 24 bit DS A D converter APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for 24 bit A A D converter use Table C 20 API Functions 24 bit Ax A D Converter API Function Name Function R_DSADC_Create Performs initialization necessary to control the 24 bit AZ A D converter R_DSADC_Create_Userlnit Performs user defined initialization relating to the 24 bit Ax A D converter r_dsadc_interrupt Performs processing in response to the AX A D conversion end interrupt INTDSAD R_DSADC_Set_OperationOn Enables operation of 24 bit AX A D converter R_DSADC_Set_OperationOff Disables operation of 24 bit Ax 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 Ax 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 282 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_Create Performs initialization necessary to control the 24 bit Ax A D converter Syntax void R_DS
26. 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 208 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_CounterValue Sets the counter value year month weekday day hour minute second of the real time clock Syntax include r cg macrodriver h include ye eg rte sh MD_STATUS R_RTC_Set_CounterValue rtc_counter_value_t counter_write val j Argumeni s VO Argument Description l rtc_counter_value_t Counter value counter write val Remark Below is an example of the structure rtc_counter_value_t counter value for the real time clock uints uints uints uints uints uints uints rtc_coun typedef struct t sec second t min Minute t hour Hour _t day Day _t week Weekday 0 Sunday 6 Saturday t month Month t year Year ter value t 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 M
27. button on the Peripheral Functions panel is pressed For this reason the source code displayed in this panel may not be the same as that would actually be generated R20UT2684EJ0100 Rev 1 00 2tENESAS Page 28 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 5 Output Source Code Output the source code device driver program by pressing the S Generate Code button on the Peripheral Func tions panel The destination folder for the source code is specified by clicking Code Generator Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel Figure 3 5 Output Source Code g T sample Project i R5FLOWMG Microcontroller 5 a 7 Generator Design Tool H Ea Peripheral Functions 5 NE f Code Preview ji 4 Code Generator Design Tool ia Eil Peripheral Functions Code Preview an A CA78KOR Build Tool bi 2 RL78 Simulator Debug Tool oo CAT8KOR Build Tool me RL78 Simulator Debug Tool eal Build tool generated files Code Generator Remark In order to both output source files and add them to the project display the corresponding source file names in the Project Tree panel when you click the S Generate Code button you must open the Property panel and under Code Generator Setting tab gt gt Generate File Mode gt gt Register files specify Register the generated files to the pr
28. gt gt Pin Configurator Design Tool gt gt Device Pin List On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then press the Enter key From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins connected to external peripheral parts Note that items in this area s device pin list are sorted by groups at the external peripheral controller level a First layer The following are the columns comprising the device pin list Column Heading Outline External Peripheral Displays the name of the external peripheral controller To change the name select this field and then press the F2 key Total Displays the total number of pins allocated for connection with the microcontrol ler b Second layer Column Heading Outline Pin Number Displays the pin number of the pin Pin Name Displays the pin name of the pin R20UT2684EJ0100 Rev 1 00 2tENESAS Page 69 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Column Heading Outline Function This area allows you to select which function to use when the pin has more than one functions VO This area allows you to select the I O mode of the pin N ch This area allows
29. 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 R20UT2684EJ0100 Rev 1 00 ztENESAS Page 373 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_burt 2 Actual UARTF reception starts after this API function is called and R_UARTFn_Siart is then called 3 Ifthe 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 R_UARTFn Receive uint8 t const rx buf uintl6 _t rx num Remark nis the channel number Argumenit s VO Argument Description O uints_t const rx buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Return value Macro Description MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 2tENESAS Page 374 of 480 Sep 01 2013 CubeSuite V2 0
30. void R_LVD InterruptMode_ Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 458 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 36 Battery backup function Below is a list of API functions output by the Code Generator for battery backup function use Table C 36 API Functions Battery Backup Function API Function Name Function R_BUP_Create Performs initialization necessary to control the battery backup function R_BUP_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 459 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_BUP_Create Performs initialization necessary to control the battery backup function Syntax void R_BUP Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 460 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_BUP_Create_UserlInit Performs user defined initialization relating to the battery backup function Remark This API function is called as
31. 00 2tENESAS Page 296 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DACn_Stop Ends D A conversion Syntax void R_DACn Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 297 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 298 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 j Remark nis the channel number Argumeni s 1 0 Argument Description uint8_t reg_value D A conversion value 0x0 to OxFF Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 299 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 22 Programmable gain amplifier Below is a list of API functions output by the Code Generator for programm
32. 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m Start Starts the count for 16 bit timer KB2 Syntax void R_KB2m Start void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 181 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Stop Ends the count for 16 bit timer KB2 Syntax void R_KB2m_ Stop void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 182 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Set_PowerOff Halts the clock supplied to the 16 bit timer KB2 Syntax void R_KB2m_ Set _PowerOff void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 183 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Simultaneous_ Start Starts the simultaneous start stop mode Syntax void R_KB2m Simultaneous Start void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 184 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Simultaneous_Stop Ends the simultaneous start stop mode Syntax void R_KB2m
33. 48 i v MHz High speed system clock setting Operation X1 oscillation X Extemal clock input FEX Frequency 1007 O M Stable time 218X 262144 us Information of valid input value range 1 20 Subsystem clock fSUB setting EY See R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 26 of 480 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 3 3 Icon indicating pin conflict If a conflict occurs between the pins while setting various peripheral functions in the Peripheral Functions panel the A icon is displayed at the location where the conflict occurs to warn the user of a conflict between the pins Remark If the mouse cursor is moved over the icon information regarding the conflict between the pins tips for avoiding the conflict popups Figure 3 3 Icon Indicating Pin Conflict PeripheralFunciors ooo O k C a aa o B Unused Unused Unused In Out E Pullup E TTL buffer C Output 1 P04 Unused In Out P E Pullup E N ch Output 1 P05 Unused In Out HE Pulup C TTLbufer F N ch utput 1 POG Unused In O Out E Pullup E TTLbufer E N ch Output 1 P07 Unused In Out A Pullup M Nch Output 1 The following pin conflicts have been detected You must change the setting in that module before you can use it for other purpose P07 w
34. 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_COMP_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 307 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_compn_interrupt void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 308 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_COMPn _ Start Begins comparison of reference input voltage and analog input voltage Syntax void R_COMPn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 309 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_COMPn_ Stop Stops comparison of reference input voltage and analog input voltage Syntax void R_COMPn Stop void Remark nis
35. 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 void r_iican_callback_master_sendend void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 392 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 void r_iican_callback_master_receiveend void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 393 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 j Remark nis the channel number Argumeni s VO A
36. 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 _ interrupt static void r_osdc_interrupt void j Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 468 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_OSDC _Start Enables operation of oscillation stop detector Syntax void R_OSDC_Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 469 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_OSDC_Stop Disables operation of oscillation stop detector Syntax void R_OSDC_Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 470 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None
37. API function is called and R_UARTn_ Start is then called Syntax include r cg macrodriver h MD_STATUS R_UARTn Receive uint8_t const rx buf uint16_t rx num Remark nis the channel number Argumeni s VO Argument Description O uints_t const rx buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 2tENESAS Page 326 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_uartn_callback_sendend Performs processing in response to the UART transmission end interrupt INTSTn This API function is called as the callback routine of interrupt process r_uartn_interrupt_send corresponding Remark 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 void r_uartn_callback_sendend void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 327 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_in
38. Argument Description O uint8_t err type Trigger for CSI reception error interrupt 00000xx1B Overrun error Return value None R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 340 of 480 CubeSuite V2 01 00 APPENDIX C 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 R_IICmn_Create void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 341 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_iicmn_interrupt Performs processing in response to the simple IIC communication end interrupt INTIIC mn Remark This API function is called as the interrupt process corresponding to the simple IIC communication end interrupt INTIIC mn Syntax _ interrupt static void r_iicmn_interrupt void Remark mis the unit number and n is the channel number Argument s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 342 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICmn_StartCondition Generates start conditions Remark This API function is used as an inte
39. Change Output Format Property EJ 4 Generate File Mode API output control Output all API functions according to the setting Output folder C imp sample File generation control Merge file Register files Register the generated files to the project HTML file 4 Product Information Release date Version Report type Selects the format of report file Code Generator Setting Remark The output format of the report file is selected from the two types shown below Table 3 7 Output Format of Report File Report Type Outline HTML file Outputs in the HTML format CSV file Outputs in the CSV format R20UT2684EJ0100 Rev 1 00 2tENESAS Page 37 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 6 2 Change output destination folder The Code Generator is used to change the output destination folder for the report file by selecting Code Generator Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel Figure 3 16 Change Output Destination Folder eti Code Generator Property 4 Generate File Mode API output control Output all API functions according to the setting C imp sample File generation control Merge file Register files Register the generated files to the project Report type HTML file 4 Product Information Release date adiVitiyyyy Version VA AE AR AE Output folder Specifies the folder to which
40. Explorer OW G tmp sample Function html v gt X ol Bing P a we Favorites CAtmp sample Function htm MCU name RL78L13_128KB 128KB Chip name R5F10WMG Common r_cg_main c void main void void R_MAIN_Userlnit void r_cg_systeminit c void R_Systeminit void void hdwinit void f_cg_macrodriver h r ena userdefine h m R20UT2684EJ0100 Rev 1 00 2tENESAS Page 35 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator Figure 3 14 Output Example of Report File Macro HTML File Ee C tmp sample Macro html Windows Internet Explorer Ou amp C tmp sample Macro html v 4 x S Bing Pr Uy Favorites E C tmp sample Macro html MCU name RL78L13_128KB 128KB Chip name R5F10WMG Cet aeo sane es se ee O o oo cec pokra POR e Port setting PIOR register PIORO ee ae Pot iria PIOR register PIORO Function TI02 T002 Pon a PIOR register PIORO E inctionn Part R20UT2684EJ0100 Rev 1 00 7tENESAS Page 36 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 6 1 Change output format The Code Generator is used to change the output format HTML file or CSV file of the report file by selecting Code Generator Setting tab gt gt Generate File Mode gt gt Report type in the Property panel Figure 3 15
41. How to open On the Project Tree panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then press the Enter key From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller The device pin list in this area is organized in the order of pin number The following are the columns comprising the device pin list Column Heading Outline Pin Number Displays the pin number of the pin Pin Name This area allows you to select which function to use when the pin has more than one functions Function This area allows you to select which function to use when the pin has more than one functions VO This area allows you to select the I O mode of the pin N ch This area allows you to select which output mode to apply when using the pin in the output mode R20UT2684EJ0100 Rev 1 00 2tENESAS Page 65 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Column Heading Outline Define Name This area allows you to assign a user defined pin name to the pin wITHIN 256 characters can be entered in the Define Name Description Displ
42. None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 206 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 207 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_HourSystem Sets the clock type 12 hour or 24 hour clock of the real time clock Syntax include r cg macrodriver h include ty eg rte sh MD_STATUS R_RTC_Set_HourSystem rtc_hour_system_t hour_system Argumeni s VO Argument Description l rtc_hour_system_t hour _ system Clock type HOUR12 12 hour clock HOUR24 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
43. Normal completion R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 159 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 8 16 bit timer KB Below is a list of API functions output by the Code Generator for 16 bit timer KB use Table C 8 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_UserlInit 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_BatchOverwriteRequestOn Enables batch overwriting of the compare register R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 160 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KB_Create Performs initialization necessary to control the 16 bit timers KB Syntax void R_TMR_KB Create void Argumenit s None Return value
44. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 252 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PCLBUZn_Siart Starts clock buzzer output Syntax void R_PCLBUZn Start void Remark nis the output pin Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 253 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PCLBUZn_Stop Ends clock buzzer output Syntax void R_PCLBUZn Stop void Remark nis the output pin Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 254 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 255 of 480 Sep 01 201
45. Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node and then select Property from the context menu Remarks 1 If this panel is already open selecting a different Pin Configurator Design Tool in the Project Tree panel changes the content displayed accordingly If this panel is already open selecting a different Device Pin List in the Project Tree panel changes the content displayed accordingly If this panel is already open selecting a different Device Top View in the Project Tree panel changes the content displayed accordingly If this panel is already open selecting a different Code Generator Design Tool in the Project Tree panel changes the content displayed accordingly If this panel is already open selecting Peripheral Functions gt gt Peripheral function node in the Project Tree panel changes the content displayed to that corresponding to the selected node If this panel is already open selecting Code Preview gt gt Peripheral function node gt gt source code node gt gt API function node in the Project Tree panel changes the content displayed to that corre sponding to the selected node Description of each area 1 Detail information display change area This area al
46. Simultaneous_Stop void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 185 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Synchronous _Siart Starts the timer start clear mode Syntax void R_KB2m Synchronous Start void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 186 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Synchronous_Stop Ends the timer start clear mode Syntax void R_KB2m Synchronous Stop void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 187 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Start Starts forced output stop function 1 for timer output TKBOn0 Syntax void R_KB2m_TKBOn0O Forced Output Stop Functionl Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 188 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_Forced_Output_Stop_Function1_Stop Ends forced output stop function 1 for timer output TKBOn0 Syntax
47. The API function is not output R20UT2684EJ0100 Rev 1 00 2tENESAS Page 61 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Default name Selects whether or not to restore the default name of the API function Note that the default name of the API function can be restored by selecting Default from the context menu after selecting the source code node in the Project Tree panel Yes The default name is restored No The default name is not restored R20UT2684EJ0100 Rev 1 00 Sep 01 2013 ztENESAS Page 62 of 480 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Device Pin List panel This panel allows you to enter information on each pin of the microcontroller Remark The Device pin list area can be zoomed in and out by 50 in the tool bar or by operating the mouse wheel while holding down the Ctrl key Figure A 14 Device Pin List Panel Device Pin List Eg 0 iE Beh eS Pin Name 2 Function I O N ch 4 Define Name Description EPOTANITE TOOD RxD1 Free 2 POO ANIT7 TIOD TxD1 Free 3 P40 TOOLO Free External Peripheral The following items are explained here How to open Description of each area How to open On the Project Tree panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List On the Project Tree panel select Project name Project gt gt Pin Configu
48. WUTM use Table C 15 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_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 243 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WUTM Create Performs initialization necessary to control the 16 bit wakeup timer Syntax void R_WUTM Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 244 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WUTM_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 245 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_wutm_interrupt Performs process
49. are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node and then select Property from the context menu Remark If this panel is already open selecting the API function node in the Project Tree panel changes the content displayed to that corresponding to the selected node Description of each area 1 Function Information category This area allows you to view the information Function name Function used and Default name on and change the setting for the API function node selected in the Project Tree panel Function name Inputs the name of the API function Note that the name of the API function can be changed by selecting Rename from the context menu after selecting the API function node in the Project Tree panel Function used Selects whether or not to output the API function when the Generate Code but ton in the Peripheral Functions panel is clicked Generated The API function is output Ungenerated
50. coding build and debug for developing application systems This chapter gives an overview of the design tool Pin Configurator Code Generator 1 1 Overview The design tool which is one of the components provided by CubeSuite 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 microcon troller by configuring various information using the GUI 1 2 Features The design tool Pin Configurator Code Generator 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 con tained in the source code R20UT2684EJ0100 Rev 1 00 ztENESAS Page 7 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator CHAPTER 2 FUNCTIONS Pin Configurator This chapter describes the key f
51. 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_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_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output R20UT2684EJ0100 Rev 1 00 2tENESAS Page 120 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TAUm_Create Performs initialization necessary to control the timer array unit Syntax void R_TAUm_ Create void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 121 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TAUm_Create_Userlnit 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 R_TAUm_Create_UserInit void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 122 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_taum_
52. 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
53. function node to open the Peripheral Functions panel which is used to make settings for control of the corresponding peripheral function Icons that are displayed immediately to the left of each peripheral function node have the meanings listed below le Operation in the corresponding Peripheral Functions panel has been car ried out le Operation in the corresponding Peripheral Functions panel has not been carried out ler The problem occurs on the settings became the manipulation to the other peripheral function node influences lt 2 gt Code Preview The sub node of this node is the peripheral function node for the peripheral functions clock generator port functions etc supported by the target device Peripheral function node Double click on a source code node API function node in the level of the hierarchy below this node or select a source code node API function node and press the Enter key to open the Code Preview panel which is used to confirm that the source code corresponds to the settings in the Peripheral Functions panel Icons that are displayed immediately to the left of each peripheral function node have the meanings listed below le Operation in the corresponding Peripheral Functions panel has been car ried out le Operation in the corresponding Peripheral Functions panel has not been carried out Context menu The following context men
54. generated it is impossible to change the icon to al l Source code for the currently selected API function is gener ated J Source code for the currently selected API function is not gen erated 3 5 2 Change file name In the Code Generator select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node in the Project Tree panel The name of the file can be changed by select ing Rename from the context menu which is displayed by right clicking the mouse Figure 3 9 Change File Name Project Tree Eg s D 8 sample Project S i RSFLOWMG Microcontroller H nl Code Generator Design Tool i Peripheral Functions Zw Code Preview Common E Clock Generator H a Port Function X H H Remark To restore the default file name defined by the Code Generator select Default from the context menu R20UT2684EJ0100 Rev 1 00 2tENESAS Page 31 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 5 3 Change API function name In the Code Generator select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node in the Project Tree panel The name of the API func tion can be changed by selecting Rename from the conte
55. in response to the alarm interrupt INTRTC Remark This API function is called as the callback routine of interrupt process r_ric_interrupt corresponding to the alarm interrupt INTRTC Syntax static void r_rtc_callback_ alarm void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 219 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 220 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 221 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 12 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 C 12 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
56. 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 441 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_intcn_interrupt void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 442 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTCn_Start Enables the acceptance of the external maskable interrupts INTPn Syntax void R_INTCn Start void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 443 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTCn_Stop Disables the acceptance of the external maskable interrupts INTPn Syntax void R_INTCn_Stop void Remark nis the interrupt factor number Argumeni s None Return value None R20U
57. not been detected Input error Illegal settings have been detected Peripheral function used Indicates whether or not to use the peripheral function Note that whether or not a function is to be used depends on the settings in the Peripheral Functions panel corresponding to the selected node Used The peripheral function is to be used No The peripheral function is not to be used R20UT2684EJ0100 Rev 1 00 2tENESAS Page 56 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Preview Information tab Product Information This tab allows you to view the information Product Information for the Code Preview selected in the Project Tree panel Figure A 10 Code Preview Information Tab Product Information Property x J Code Preview Property P 4 Product Information eee nee COVA yyy version V AAA AK AR Release date This is the release date of the product The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview and then select Property from the context menu Remark If this panel is already open select
58. output forced cutoff for 16 bit timer RDn R_TMR_RDn_Get_PulseWidth Reads the pulse width of the 16 bit timer RDn R20UT2684EJ0100 Rev 1 00 2tENESAS Page 142 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RDn_Create Performs initialization necessary to control the 16 bit timer RDn Syntax void R_TMR_RDn Create void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 143 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RDn_Create_Userlnit 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 R TMR RDn Create UserInit void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 144 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_tmr_rdn_ interrupt void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 145 of 480 Sep 01 2013 CubeSuite
59. start function for timer output TKBOn1 R_KB2m_Set_BatchOverwriteRequestOn Enables batch overwriting of the compare register R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 177 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Create Performs initialization necessary to control the 16 bit timer KB2 Syntax void R_KB2m Create void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 178 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_Create_Userlnit 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 R_KB2m Create _UserInit void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 179 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_kb2m_interrupt void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 180 of 480 Sep
60. the Device Top View panel where you can confirm the information entered for the pins a Select shape of microcontroller Allows you to select the shape of the microcontroller displayed in the Device Top View panel R20UT2684EJ0100 Rev 1 00 2tENESAS Page 8 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 5 6 7 lt b Select color Allows you to select colors used to distinguish the type of pins power pins special pins used pins etc whose information is displayed in the Device Top View panel c Select popup information Allows you to select the type of information that popups when you move the mouse cursor over each pin in the Device Top View panel d Select additional information Select the type of information to display in Pin area of the Device Top View panel Enter Information Enter information on the pins of the microcontroller in the Device Pin List panel Output Report Files Output report files files containing configured information using Pin Configurator device pin list and device top view to the specified folder a Output device pin list Output a device pin list b Output device top view Output a device top view Save project Save a project Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Save project R20UT2684EJ0100 Rev 1 00 ztENESAS Page 9 of 480 Sep 01 2013 CubeSuite V2 01 0
61. the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the context menu Remark _ If this panel is already open selecting a different Pin Configurator Design Tool in the Project Tree panel changes the content displayed accordingly Description of each area 1 Product Information category This area displays product information Version and Release date on Pin Configurator Version Displays the version of Pin Configurator Pin Configurator Plug in Release date Displays the release date of Pin Configurator Pin Configurator Plug in 2 Package category Change the shape Package type and settings of the microcontroller to display as the device top view in the Device Top View panel Package type Selects the shape of the microcontroller displayed in the device top view R20UT2684EJ0100 Rev 1 00 ztENESAS Page 49 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Device Pin List Information tab This tab displays information Product Information on the Device Pin List selected in the Project Tree panel Figure A 5 Device Pin List Information Tab ts gf Device Pin List Property e 4 Product Information Version VA AE A AE R
62. the R_BUP_ Create callback routine Syntax void R_BUP Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 461 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_bup_interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 462 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_BUP_Start Enables operation of battery backup function Syntax void R_BUP Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 463 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_BUP_Stop Disables operation of battery backup function Syntax void R_BUP Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 464 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 37 Oscillation stop detector Below is a list of API functions output by the Code Generator for oscillation stop detector use Table C 37 A
63. the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 310 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 311 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 24 Serial array unit APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for serial array unit use Table C 24 API Functions Serial Array Unit API Function Name Function R_SAUm_Create Performs initialization necessary to control the serial array unit R_SAUm_Create_Userlnit Performs user defined initialization related to 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
64. the clock supplied to the 16 bit timer RGO Remark Calling this API function changes the 16 bit timer RGO to reset status For this reason writes to the control registers after this API function is called are ignored Syntax void R_TMR_RGO Set _PowerOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 158 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RGO_Get_PulseWidth Reads the pulse width of the 16 bit timer RGO Remarks 1 This API function can only be called when the 16 bit timer RGO is being used for input capture function 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_RGO Get _PulseWidth uint32_t const active_width uint32_t const inactive_width timer_channel_t channel j Argumeni s VO 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 timer _channel_t channel Return value Pin to read TMCHANNELA TRGIOAO pin TMCHANNELB TRGIOBO pin Macro Description MD_OK
65. the generated files are saved Code Generator Setting R20UT2684EJ0100 Rev 1 00 ztENESAS Page 38 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE APPENDIX A WINDOW REFERENCE This appendix explains in detail the functions of the windows panels and dialog boxes of the design tool A 1 Description The design tool has the following windows panels and dialog boxes Table A 1 Window Panel Dialog Box List Window Panel Dialog Box Name Function Main window This is the first window to open when CubeSuite is launched This window is used to operate various components design tool build tool etc provided by CubeSuite Project Tree panel This panel displays the components of the project microcontroller design tool build tool etc in a tree structure Property panel This panel allows you to view the information on and change the setting for the node selected in the Project Tree panel Device Pin List panel This panel allows you to enter information on each pin of the microcontroller Device Top View panel Peripheral Functions panel This panel displays the information entered in the Device Pin List panel This panel allows you to configure the information necessary to control the peripheral functions clock generator port functions etc provided Code Preview panel This panel allows you to confirm the source code in accord with the settings
66. timer Remark This API function is called as the R_IT Create callback routine Syntax void R_IT Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 231 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_it_interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 232 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT_Start Starts the count of the 12 bit interval timer Syntax void R_IT_ Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 233 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT_Stop Ends the count of the 12 bit interval timer Syntax void R_IT_Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 234 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT_Set_PowerOff Halts the clock supplied to the 12 bit interval timer Remarks 1 Calling this API function chan
67. 0 APPENDIX C API FUNCTIONS R_IT8bitm_Channeln_Sitart Starts the count of the 8 bit interval timer Syntax void R_IT8bitm_Channeln Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 240 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT8bitm_Channeln_Stop Ends the count of the 8 bit interval timer Syntax void R_IT8bitm_Channeln Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 241 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 242 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 15 16 bit wakeup timer Below is a list of API functions output by the Code Generator for 16 bit wakeup timer
68. 0 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 Open Device Pin List Panel Open the Device Pin List panel where you enter information on the pins of the microcontroller To open the Device Pin List panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List in the Project Tree panel Figure 2 1 Open Device Pin List Panel A 2 POO ANI7 TIONTxD1 Free 3 P40 TOOLO Free Pin Number External Peripheral Remarks 1 If an unsupported microcontroller is defined in the project for Pin Configurator then Pin Configurator Design Tool node will hide under Project name Project in the Project Tree panel 2 The Device Pin List panel consists of three tabs Selecting one of the tabs changes the order in which information on each pin of the microcontroller is displayed Pin Number tab Information on each pin of the microcontroller is displayed in the order of pin number Macro tab Information on each pin of the microcontroller is displayed in the order it was grouped into peripheral functions External Peripheral tab Information about the pins connected to external peripherals is displayed in order grouped at the external peripheral component level R20UT2684EJ0100 Rev 1 00 2tENESAS Page 10 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 1 Select item The Pin Configurator is used to select items to be disp
69. 01 2013 2tENESAS Page 435 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ELC Create Performs initialization necessary to control the event link controller ELC Syntax void R_ELC Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 436 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ELC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 437 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ELC Stop Disables operation of the event link controller ELC Syntax void R_ELC Stop uint32_t event Argumeni s VO Argument Description l uint32_t event Disabled event source Remark Below is shown the format for specifying disabled event source event In case of setting the event to 0x01010101 the event link operations of event source 00 08 16 24 are pro hibited 31 0 B31 B25 B24 BO Event source 00 Event source 24 Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 438 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C A
70. 1 While the item is being edited Undo Cancels the effect of an edit operation to restore the previous state Cut Sends the character string or lines selected with range selection to the clipboard and deletes them Copy Sends the character string or lines selected with range selection to the clipboard Paste Inserts the contents of the clipboard at the caret position Delete Deletes the character string or the lines selected with the range selection Select All Selects all strings displayed in the item being edited 2 While the item is not being edited Property Reset to Default The selected items are returned to their default settings Property Reset All to Default All items displayed in this tab are returned to their default settings R20UT2684EJ0100 Rev 1 00 ztENESAS Page 48 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Pin Configurator Settings tab This tab displays information Product Information and Package on the Pin Configurator Design Tool selected in the Project Tree panel Figure A 4 Pin Configurator Settings Tab Property x Pin Configurator Property e 4 Product Information VA AK AR AE Release date dd iViVi yyyy 4 Package Package type SP Version Pin configurator version information The following items are explained here How to open Description of each area How to open On
71. 1 00 APPENDIX C 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 R_UARTFn Set _DataComparisonOn void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 375 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_UARTFn Set _DataComparisonOff void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 376 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 correspond ing to the LIN UART transmission end interrupt INTLT performed when number of transmission data spec ified by R_UARTFn_Send argument tx_num has been completed Syntax static void r_uartfn_callback_sendend void Rem
72. 100 Rev 1 00 2tENESAS Page 202 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 203 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void y rte interrupt void j Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 204 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 205 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s
73. 11 C 2 12 C 2 13 C 2 14 C 2 15 C 2 16 C 2 17 C 2 18 C 2 19 C 2 20 C 2 21 C 2 22 C 2 23 C 2 24 C 2 25 C 2 26 C 2 27 C 2 28 C 2 29 C 2 30 C 2 31 C 2 32 C 2 33 C 2 34 C 2 35 C 2 36 C 2 37 C 2 38 Common 97 Clock generator 102 Port functions 117 Timer array unit 120 Timer RJ 134 Timer RD 142 Timer RG 152 16 bit timer KB 160 16 bit timer KCO 170 16 bit timer KB2 177 Real time clock 201 Subsystem clock frequency measurement circuit 222 12 bit interval timer 229 8 bit interval timer 236 16 bit wakeup timer 243 Clock output buzzer output controller 250 Watchdog timer 256 A D converter 261 Temperature sensor 276 24 bit DS A D converter 282 D A converter 293 Programmable gain amplifier 300 Comparator 305 Serial array unit 312 Serial array unit 4 DALI UART4 351 Asynchronous serial interface LIN UART UARTF 364 Serial interface IICA 383 LCD controller driver 405 Sound generator 414 DMA controller 420 DTC 429 Event link controller ELC 435 Interrupt functions 439 Key interrupt function 448 Voltage detector 454 Battery backup function 459 Oscillation stop detector 465 SPI interface 472 CubeSuite V2 01 00 CHAPTER 1 GENERAL CHAPTER 1 GENERAL CubeSuite is an integrated development environment used to carry out tasks such as design
74. 3 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 17 Watchdog timer Below is a list of API functions output by the Code Generator for watchdog timer use Table C 17 API Functions Watchdog Timer API Function Name Function R_WDT_Create Performs initialization necessary to control the watchdog timer R_WDT_Create_Userlnit Performs user defined initialization relating to the watchdog timer r_wadt_interrupt Performs processing in response to the interval interrupt INTWDTI R_WDT_Restart Clears the watchdog timer counter and resumes counting R20UT2684EJ0100 Rev 1 00 2tENESAS Page 256 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WDT Create Performs initialization necessary to control the watchdog timer Syntax void R_WDT Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 257 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WDT_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 258 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_wdt_interrupt Performs processing in response to th
75. 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SG_Create Performs initialization necessary to control the sound generator Syntax void R_SG Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 415 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SG _Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 416 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 log arithmic decrement interrupt INTSG Syntax _ interrupt static void r_sg_interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 417 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SG_Start Enables operation of sound generator Syntax void R_SG_ Start void Argumenit s None Return value None
76. 9C3 Canada Tel 1 905 898 5441 Fax 1 905 898 3220 Renesas Electronics Europe Limited Dukes Meadow Millboard Road Bourne End Buckinghamshire SL8 5FH U K Tel 44 1628 651 700 Fax 44 1628 651 804 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 Dusseldorf Germany Tel 49 211 65030 Fax 49 211 6503 1327 Renesas Electronics China Co Ltd 7th Floor Quantum Plaza No 27 ZhiChunLu Haidian District Beijing 100083 P R China Tel 86 10 8235 1155 Fax 86 10 8235 7679 Renesas Electronics Shanghai Co Ltd Unit 204 205 AZIA Center No 1233 Lujiazui Ring Rd Pudong District Shanghai 200120 China Tel 86 21 5877 1818 Fax 86 21 6887 7858 7898 Renesas Electronics Hong Kong Limited Unit 1601 1613 16 F Tower 2 Grand Century Place 193 Prince Edward Road West Mongkok Kowloon Hong Kong Tel 852 2886 9318 Fax 852 2886 9022 9044 Renesas Electronics Taiwan Co Ltd 13F No 363 Fu Shing North Road Taipei 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 penosas Electronics Malaysia Sdn Bhd ni Tel 60 3 7955 9390 Fax 60 3 7955 9510 Renesas Electronics Korea Co Ltd 11F Samik Lavied or Bldg 720 2 Yeoksam Dong Kangnam Ku Seoul 135 080 Korea Tel 82 2 558 3737 Fax 82 2 558 5141 it 906 Block B Menara Amcorp Amcorp
77. ADC_Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 283 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC Create_Userlnit Performs user defined initialization relating to the 24 bit Ax A D converter Remark This API function is called as the R_DSADC_ Create callback routine Syntax void R_DSADC_ Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 284 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dsadc_interrupt Performs processing in response to the Ad A D conversion end interrupt INTDSAD Remark This API function is called as the interrupt process corresponding to the A A D conversion end interrupt INTDSAD Syntax _ interrupt static void r_dsadc_interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 285 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_Set_OperationOn Enables operation of 24 bit AX A D converter Syntax void R_DSADC_Set_OperationOn void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 286 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DSADC_Set_OperationOff Disables operation of 24 bit A A D converter
78. APTER 2 FUNCTIONS Pin Configurator 2 3 1 Select shape of microconiroller Select the shape of the microcontroller displayed in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the shape of the microcontroller click Pin Configurator Settings tab gt gt Package gt gt Package type in the Property panel and select the desired shape Figure 2 7 Select Shape of Microcontroller Property Eg A Pin Configurator Property 4 Product Information Version VA AK AK A Release date ddi NIVEYYYY 4 Package EEN SP Package type Select package image displayed in the device top view panel Pin Configurator Settings Remark Selection of the shape of the microcontroller is made using the order name such as GC and GF R20UT2684EJ0100 Rev 1 00 Sep 01 2013 ztENESAS Page 15 of 480 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 2 Select color Select the colors used to distinguish the type of pins power pins special pins unused pins etc whose information is displayed in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the color to be displayed click Device Top View Settings tab gt gt Color in the Property panel and select the color Figure 2 8 Select Color I Device Top View Property 4 Color Cer Me Red Special pins cae Unused pins E Clack Used pins C Whit
79. APTER 2 FUNCTIONS Pin Configurator 8 2 1 Overview 8 2 2 Open Device Pin List Panel 10 2 2 1 Select item 11 2 2 2 Change display order 12 2 2 3 Add column 13 2 2 4 Delete column 13 2 3 Open Device Top View Panel 14 2 3 1 Select shape of microcontroller 15 2 3 2 Select color 16 2 3 3 Select popup information 18 2 3 4 Select additional information 19 2 4 Enter Information 20 2 5 Output Report Files 21 2 5 1 Output device pin list 21 2 5 2 Output device top view 22 CHAPTER 3 FUNCTIONS Code Generator 23 3 1 Overview 23 3 2 Open Peripheral Functions Panel 24 3 3 Enter Information 25 3 3 1 Input rule 25 3 3 2 Icon indicating incorrect entry 26 3 3 3 Icon indicating pin conflict 27 3 4 Confirm Source Code 28 3 5 Output Source Code 29 3 5 1 Set whether or not to generate source code 30 3 5 2 Change file name 31 3 5 3 Change API function name 32 3 5 4 Change output mode 33 3 5 5 Change output destination folder 34 3 6 Output Report Files 35 3 6 1 Change output format 37 3 6 2 Change output destination folder 38 APPENDIX A WINDOW REFERENCE 39 A 1 Description 39 APPENDIX B OUTPUT FILES 84 B 1 Description 84 APPENDIX C API FUNCTIONS 95 C 1 Overview 95 C 2 Function Reference 95 C 2 1 C 2 2 C 2 3 C 2 4 C 2 5 C 2 6 C 2 7 C 2 8 C 2 9 C 2 10 C 2
80. Argument classification 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 a Macro Macro of return value b Description Description of return value R20UT2684EJ0100 Rev 1 00 ztENESAS Page 96 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 1 Common Below is a list of API functions output by the Code Generator for common use Table C 1 API Functions Common API Function Name Function hdwinit Performs initialization necessary to control the various hardwares R_Systeminit Performs initialization necessary to control the various peripheral functions main This is a main function R_MAIN_Userlnit Performs user defined initialization R20UT2684EJ0100 Rev 1 00 ztENESAS Page 97 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS hdwinit Performs initialization necessary to control the various hardwares Remark Call this API function from the startup routine Syntax void hdwinit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 98 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_Systeminit Performs initialization necessary to control the various peripheral functions Remark This API functi
81. B6 BS B4 B3 B2 Bi BO pos a c Slave address lt Device type Device address R20UT2684EJ0100 Rev 1 00 Sep 01 2013 7tENESAS Page 347 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_iicmn_callback_master_sendend Performs processing in response to the simple IC mn 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 INTIIC mn performed when number of transmission data specified by R_ ICmn_Master_Send argument tx_num has been completed Syntax static void r_iicmn_callback_master_sendend void j Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 348 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_iicmn_callback_master_receiveend Performs processing in response to the simple IIC mn 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 IIC mn master reception end interrupt INTIIC mn performed when number of received data specified by R_ ICmn_Master_Receive argument rx_num has been completed Syntax static void r_iicmn_callback_master_receiveend void j Rem
82. C O D aes Cp lt 5 D CtENESAS CubeSuite V2 01 00 Integrated Development Environment User s Manual RL78 Design 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 Renesas Electronics Www renesas com Rev 1 00 Sep 2013 10 11 12 Notice 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 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
83. C API FUNCTIONS R_TMR_RGO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer RGO Remark This API function is called as the R_TMR_RGO_Create callback routine Syntax void R TMR RGO Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 154 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_tmr_rgO_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 __interrupt static void r_tmr_rgO interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 155 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RGO_Start Starts the count for 16 bit timer RGO Syntax void R_TMR_RGO Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 156 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RGO_Stop Ends the count for 16 bit timer RGO Syntax void R_TMR_RGO Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 157 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RGO_Set_PowerOff Halts
84. C_Create R_DTCn_Start R_DTCn_Stop R_DTC_Set_PowerOff r_cg_dtc_user c R_DTC_Create_Userlnit r_cg_dtc h Event link controller ELC r_cg_elc c R_ELC_Create R_ELC_Stop r_cg_elc_user c R_ELC_Create_Userlnit r_cg_elc h Interrupt functions r_cg_intc c r_cg_intc_user c R_INTC_Create R_INTCn_Start R_INTCn_Stop R_INTCLRn_Start R_INTCLRn_Stop R_INTC_Create_Userlnit r_intcn_interrupt r_intclrn_interrupt r_cg_intc h Key interrupt function 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 Voltage detector r_cg_lvd c R_LVD_Create R_LVD_InterruptMode_Start r_cg_lvd_user c R_LVD_Create_Userlnit r_lvd_interrupt r_cg_lvd h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 tENESAS Page 93 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Battery backup function r_cg_bup c R_BUP_Create R_BUP_ Start R_BUP_Stop r_cg_bup_user c R_BUP_Create_Userlnit r_bup_interrupt t_cg_bup h Oscillation stop detector 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_UserlInit r_osdc_interrupt r_cg_osdc h SPI interface r_cg_saic c R_SAIC_Create R_SAIC_Write R_SAIC_Read r_cg_saic_user c R_SAIC_Create_Userlnit r_cg_saic h
85. D Syntax __interrupt static void r led interrupt void Argument s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 408 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_ Start Sets the LCD controller driver to display on status Syntax void R_LCD Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 409 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_Stop Sets the LCD controller driver to display off status Syntax void R_LCD_Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 410 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_Set_VoltageOn Enables operation of internal voltage boost circuit and capacitor split circuit Syntax void R_LCD Set _VoltageOn void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 411 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_Set_VoltageOff Disables operation of internal voltage boost circuit and capacitor split circuit Syntax void R_LCD Set _VoltageOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 412 of 480 Sep 01 2013 CubeS
86. D_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 R20UT2684EJ0100 Rev 1 00 tENESAS Page 209 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Get_CounterValue Reads the counter value year month weekday day hour minute second of the real time clock Syntax include r cg macrodriver h include ty eg rte ch MD_STATUS R_RTC_Get_CounterValue rtc_counter_value_t const counter _read_val j Argumeni s VO Argument Description O rtc counter value t Pointer to structure in which to store the counter value being read const counter _ read_val Remark 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 210 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC
87. EJ0100 Rev 1 00 2tENESAS Page 106 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_cgc_clockmonitor interrupt void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 107 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_Get_ResetSource Performs processing in response to RESET signal Syntax void R_CGC_Get_ResetSource void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 108 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_Set_ClockMode Changes the CPU clock peripheral hardware clock Syntax include r cg macrodriver h include tr eg egc h MD STATUS R_CGC_Set_ClockMode clock_mode_t mode Argumenit s VO Argument Description l clock_mode_t mode Clock generator type SYSX1CLK X1 clock SUBXT1CLK XT1 clock HIOCLK High speed onchip oscillator SYSEXTCLK External main system clock SUBEXTCLK External subsystem clock Return value
88. ENDIX C 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 R_KB2m_ Set_BatchOverwriteRequestOn void j Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 200 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 11 Real time clock APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for real time clock use Table C 11 API Functions Real time Clock API Function Name Function R_RTC_Create Performs initialization necessary to control the real time clock R_RTC_Create_Userlnit 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_Siart 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
89. ENESAS Page 168 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TMR_KBm_ BatchOverwriteRequestOn void j Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 169 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 9 16 bit timer KCO Below is a list of API functions output by the Code Generator for 16 bit timer KCO use Table C 9 API Functions 16 bit Timer KCO API Function Name Function R_TMR_KCO_Create Performs initialization necessary to control the 16 bit timer KCO R_TMR_KCO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer KCO r_tmr_kcO_interrupt Performs processing in response to the timer interrupt R_TMR_KCO_ Start Starts the count for 16 bit timer KCO R_TMR_KCO_Stop Ends the count for 16 bit timer KCO R_TMR_KCO_Set_PowerOff Halts the clock supplied to the 16 bit timer KCO R20UT2684EJ0100 Rev 1 00 2tENESAS Page 170 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KCO_Creat
90. File name and Save as type to the folder specified in the Folder location Cancel Ignores the setting and closes this dialog box R20UT2684EJ0100 Rev 1 00 ztENESAS Page 83 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES APPENDIX B OUTPUT FILES This appendix describes the files output by the Code Generator B 1 Description Below is a list of output file files by the Code Generator Table B 1 Output File List Peripheral Function File Name API Function Name Common r_main c or r_cg_main c main R_MAIN_Userlnit r_systeminit c or hdwinit r_cg_systeminit c R_Systeminit r_cg_macrodriver h r_cg_userdefine h r_cg_lk dr Clock generator r_cg_cgc c R_CGC_Create R_CGC_Set_ClockMode R_CGC_Set_CRCOn 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_Userlnit r_cgc_ram_ecc_interrupt r_cgc_stackpointer_interrupt r_cgc_clockmonitor_interrupt R_CGC_Get_ResetSource r_cg_cgc h Port functions r_cg_port c R_PORT_Create r_cg_port_user c R_PORT_Create_Userlnit r_cg_port h R20UT2684EJ0100 Rev 1 00 tENESAS Page 84 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Timer array unit r_cg_timer c or r_cg_tau c R_TAUm_Create R_TAUm_Cha
91. ICAn_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_Userlnit r_iican_interrupt r_iican_callback_master_sendend r_lican_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 LCD controller driver r_cg_Icd c R_LCD_Create R_LCD_ Start R_LCD_Stop R_LCD_Set_VoltageOn R_LCD_Set_VoltageOff R_LCD_Set_PowerOff r_cg_Icd_user c R_LCD_Create_UserInit r_lcd_interrupt r_cg_Icd h Sound generator r_cg_sg c R_SG_Create R_SG_Start R_SG_Stop r_cg_sg_user c R_SG_Create_Userlnit r_sg_interrupt r_cg_sg h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 92 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name DMA controller r_cg_dmac c R_DMACn_Create R_DMAC_ Create R_DMACn_ Start R_DMACn_Siop R_DMACn_Set_SoftwareTriggerOn r_cg_dmac_user c R_DMACn_Create_Userlnit R_DMAC_Create_Userlnit r_dmacn_interrupt r_cg_dmac h DTC r_cg_dtc c R_DT
92. J0100 Rev 1 00 2tENESAS Page 149 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TMR_RDn ForcedOutput_Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 150 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 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 j Remark nis the channel number Argumeni s VO Argument O uint32 t const active_width Description Pointer to an area storing the active level width that was read uint32_t const inactive _ width Pointer to an area storing the inactive level width that was read
93. List panel click the button In the External Peripheral tab of the Device Pin List panel click the button Description of each area 1 Operational object selection area This area allows you to select the device pin list to be configured in this dialog box Pin Number Configures the device pin list corresponding to the Pin Number tab Macro Configures the device pin list belonging to the first layer of the Macro tab Macro Pin Configures the device pin list belonging to the second layer of the Macro tab External Peripheral Configures the device pin list belonging to the first layer of the External Peripheral tab External Peripheral Pin Configures the device pin list belonging to the second layer of the External Periph eral tab R20UT2684EJ0100 Rev 1 00 tENESAS Page 79 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE 2 Displayed item selection area Select whether or not to display the item selected in the Operational object selection area in the device pin list Checked Displays the selected item in the device pin list Not checked Hides the selected item in the device pin list Function buttons Button Function New Column Opens the New Column dialog box for adding columns to the device pin list Delete Column Deletes the selected columns from the device pin list You can only delete the column which you added using the New Column dialog
94. MR_KBmn_ForcedOutput_Start R_TMR_KBmn_ForcedOutput_Stop R_TMR_KBm_BatchOverwriteRequestOn r_cg_timer_user c R_TMR_KBm_Create_Userlnit r_tmr_kbm_interrupt r_cg_timer h 16 bit timer KCO 16 bit timer KB2 r_cg_timer c R_TMR_KCO_Create R_TMR_KCO_Sitart R_TMR_KCO_Stop R_TMR_KCO_Set_PowerOff r_cg_timer_user c R_TMR_KCO_Create_Userlnit r_tmr_kcO_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_TKBOn0O_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_Userlnit r_kb2m_interrupt r_cg_kb2 h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 86 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Real time clock Subsystem clock
95. NDIX C API FUNCTIONS C 2 31 DTC Below is a list of API functions output by the Code Generator for DTC use Table C 31 API Functions DTC API Function Name Function R_DTC_Create Performs initialization necessary to control the DTC R_DTC_Create_Userlnit Performs user defined initialization relating to the DTC R_DTCn_Start Enables operation of the DTC R_DTCn_Stop Disables operation of the DTC R_DTC_Set_PowerOff Halts the clock supplied to the DTC R20UT2684EJ0100 Rev 1 00 2tENESAS Page 429 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DTC_Create Performs initialization necessary to control the DTC Syntax void R_DTC Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 430 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DTC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 431 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DTCn Start Enables operation of the DTC Syntax void R_DTCn Start void Remark nis the channel number Argumeni s None
96. PI FUNCTIONS C 2 33 Interrupt functions Below is a list of API functions output by the Code Generator for interrupt functions use Table C 33 API Functions Interrupt Functions API Function Name Function R_INTC_Create Performs initialization necessary to control the interrupt functions R_INTC_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 439 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTC_Create Performs initialization necessary to control the interrupt functions Syntax void R_INTC_ Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 440 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTC_Create_Userlnit Performs user defined
97. PI Functions Oscillation Stop Detector API Function Name Function R_OSDC_Create Performs initialization necessary to control the oscillation stop detector R_OSDC_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 465 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_OSDC_ Create Performs initialization necessary to control the oscillation stop detector Syntax void R_OSDC_Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 466 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_OSDC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 467 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C
98. Page 371 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_UARTFn Set _PowerOff void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 372 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 2 When performing a UARTF transmission R_UARTFn_Start must be called before this API function is called 3 Ifthe 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 R_UARTFn Send uint8 t const tx_buf uintl6 _t tx_num Remark nis the channel number Argumenit s po uint8 t const tx buf Pointer to a buffer storing the transmission data a uintl
99. Product Information Release date ddiViiyyyy Version Vise se AR ae API output control Selects whether to output All API function necessary to operation according to GUI setting of each peripheral or to output only initialization API function according to GUI setting of each peripheral Code Generator Setting The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the context menu Remark _ If this panel is already open selecting a different Code Generator Design Tool in the Project Tree panel changes the content displayed accordingly Description of each area 1 Generate File Mode category This area allows you to view the information API output control Output folder File generation control Register files and Report type on and change the setting for the Code Generator Design Tool selected in the Project Tree panel R20UT2684EJ0100 Rev 1 00 2tENESAS Page 53 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE API output control Select the type of API functions to be output Output all API functions All API functions for the periphera
100. Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node and then select Property from the context menu Remark _ If this panel is already open selecting peripheral function node in the Project Tree panel changes the con tent displayed to that corresponding to the selected node Description of each area 1 Peripheral Function Information category This area allows you to view the information Peripheral function name and Peripheral function used for the peripheral function node selected in the Project Tree panel Peripheral function name Displays the name of the peripheral function Peripheral function used Indicates whether or not to use the peripheral function Note that whether or not a function is to be used depends on the settings in the Peripheral Functions panel corresponding to the selected node Yes The peripheral function is to be used No The peripheral function is not to be used R20UT2684EJ0100 Rev 1 00 7tENESAS Page 58 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Preview Setting tab File Information This tab allows you to view the information File Information on and change the setting for the source code node selected in the Project Tree panel Figure A 12 Code Preview Setting Tab File Information Property _ B W r_cg_main c Property 2 l 4 File Information File name r_
101. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 387 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Stop Ends IICA communication Syntax void R_IICAn Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 388 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_lICAn_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 R_IICAn Set _PowerOff void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 389 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 uint1l6 _t tx_num uint8 t wait Remark nis the channel number Argumeni s VO Argument Description
102. R20UT2684EJ0100 Rev 1 00 2tENESAS Page 471 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 38 SPI interface Below is a list of API functions output by the Code Generator for SPI interface use Table C 38 API Functions SPI Interface API Function Name Function R_SAIC_Create Performs initialization necessary to control the SPI interface R_SAIC_Create_Userlnit Performs user defined initialization relating to the SPI interface R_SAIC_Write Starts SPI data transmission R_SAIC_Read Starts SPI data reception R20UT2684EJ0100 Rev 1 00 2tENESAS Page 472 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAIC_Create Performs initialization necessary to control the SPI interface Syntax void R_SAIC Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 473 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAIC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 474 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAIC_Write Starts SPI data transmission
103. R_DAC_Set_PowerOff R_DACn_Set_ConversionValue r_cg_dac_user c R_DAC_Create_Userlnit r_cg_dac h Programmable gain amplifier Comparator r_cg_pga c r_CQ_pga_user c r_cg_pga h r_cg_comp c R_PGA_Create R_PGA_Start R_PGA_Stop R_PGA_Create_Userlnit R_COMP_Create R_COMPn_ Start R_COMPn_Stop R_COMP_Set_PowerOff r_cg_comp_user c R_COMP_Create_Userlnit r_compn_interrupt r_cg_comp h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 89 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Serial array unit r_cg_serial c or r_cg_sau c r_cg_serial_user c or r_cg_Sau_user 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_SAUm_Create_Userlnit 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_iicm
104. Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 432 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DTCn_Stop Disables operation of the DTC Syntax void R_DTCn_ Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 433 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 434 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 32 Event link controller ELC Below is a list of API functions output by the Code Generator for event link controller ELC use Table C 32 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_Userlnit Performs user defined initialization relating to the event link controller ELC R_ELC_Stop Disables operation of the event link controller ELC R20UT2684EJ0100 Rev 1 00 Sep
105. SREDLn 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 351 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DALIn_Create Performs initialization necessary to control the serial array unit 4 DALI UART4 Syntax void R_DALIn Create void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 352 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 INTSTDL n Syntax __interrupt static void r_dalin_interrupt_send void
106. T2684EJ0100 Rev 1 00 2tENESAS Page 444 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_intclrn_interrupt void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 445 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTCLRn Start Enables the acceptance of the external maskable interrupts INTPLRn Syntax void R_INTCLRn Start void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 446 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_INTCLRn_Stop Disables the acceptance of the external maskable interrupts INTPLRn Syntax void R_INTCLRn Stop void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 447 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 34 Key interrupt function Below is a list of API functions output by the Code Generator for key interrupt function u
107. Trade Centre No 18 Jin Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia 2013 Renesas Electronics Corporation and Renesas Solutions Corp Colophon 1 3 CubeSuite V2 01 00 tENESAS Renesas Electronics Corporation R20UT2684EJ0100
108. V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RDn Start Starts the count for 16 bit timer RDn Syntax void R_TMR_RDn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 146 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RDn Stop Ends the count for 16 bit timer RDn Syntax void R_TMR_RDn Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 147 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TMR_RDn Set _PowerOff void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 148 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RDn_ForcedOutput_Siart Starts the pulse output forced cutoff for 16 bit timer RDn Syntax void R_TMR_RDn ForcedOutput_Start void Remark nis the channel number Argumeni s None Return value None R20UT2684E
109. X A WINDOW REFERENCE W Clicks this button to enable changing of the display in the Device top view area by drag and drop By pressing this button the shape of the mouse cursor in the Device top view area changes from the arrow to the hand o Clicks this button to enable moving external peripheral components in the Device top view area to arbitrary locations and select pins By pressing this button the shape of the mouse cursor which has changed into the hand by pressing the lt button reverts back to the arrow Rotates the content in the Device top view area 90 degrees counter clockwise K5 K Rotates the content in the Device top view area 90 degrees clockwise Expands or reduces the content in the Device top view area 2 User Define area Drag and drop the E button from this area to the Device top view area to creat and display an external peripheral controller 3 Device top view area This area displays the pin assignment of the microcontroller Settings of the pin assignment are displayed using the colors specified by selecting Device Top View Settings tab gt gt Color in the Property panel Remark Ifthe pin name in the diagram is double clicked the Device Pin List panel opens and the focus moves to the clicked pin in the list Context menu When you right click on a pin or external peripheral controller in the Device top view area the following context menu displays 1 Wh
110. _ADC_Set_ADChannel Configures the analog voltage input pin for A D conversion R_ADC_Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode R_ADC_Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode R_ADC_Set_TestChannel Sets the operation mode of A D converter R_ADC_Get_Result Reads the results of A D conversion 10 bits R_ADC_Get_Result_8bit Reads the results of A D conversion 8 bits most significant 8 bits of 10 bit res olution R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 261 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC Create Performs initialization necessary to control the A D converter Syntax void R_ADC Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 262 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 263 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_adc_interrupt Performs processing in response to the A D conversion end interrupt INTAD Remark This API function i
111. _Set_ConstPeriodInterruptOn Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function Syntax include r cg macrodriver h include ye eg rte sh MD_STATUS R_RTC_Set_ConstPeriodInterruptOn rtc_int_period_t period Argumenit s vO Argument Description l rtc_int_period_t period 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 R20UT2684EJ0100 Rev 1 00 ztENESAS Page 211 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_ConstPeriodinterruptOff Ends the cyclic interrupt function Syntax void R_RTC_Set_ConstPeriodInterruptOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 212 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_ric_interrupt corresponding to the cyclic interrupt INTRTC Syntax static void r_rtc_callback_constperiod void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Pa
112. able gain amplifier use Table C 22 API Functions Programmable Gain Amplifier API Function Name Function R_PGA_Create Performs initialization necessary to control the programmable gain amplifier R_PGA_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 300 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PGA_Create Performs initialization necessary to control the programmable gain amplifier Syntax void R_PGA_ Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 301 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PGA_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 302 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PGA_Siart Starts the operation of programmable gain amplifier Syntax void R_PGA Start void Argumenit s None Retur
113. ages are classified by the message origination tool and displayed on the individual tabs Remark The Message area can be zoomed in and out by 100 gt in the tool bar or by operating the mouse wheel while holding down the Cirl key Figure A 21 Output Panel The following items are explained here How to open Description of each area Context menu How to open From the View menu select Output Description of each area 1 Message area The output messages of each tool are displayed Note that the character colors background colors of the message differ with the type of output message and depend on the settings in the General Font and Color category in the Option dialog box 2 Tab selection area Select the tab that indicates the origin of message The following tabs are available for the debug tool Tab Name Description All Messages Displays operation logs for all components design tool build tool etc provided by CubeSuite in order of output Code Generator Display only operation logs for the Code Generator out of those for various components design tool build tool etc provided by CubeSuite Caution Even if anew message is output on a deselected tab tab selection will not automatically switch In this case mark will be added in front of the tab name indicating that a new message has been output Context menu The following context menu items are d
114. ame Total Used Used by other function Pin Number Pin Name Description Recommend Connection for Unused and Attention col umns because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired col umn to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which opens by pressing the g button in the upper left corner of the device pin list R20UT2684EJ0100 Rev 1 00 2tENESAS Page 68 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE External Peripheral tab This tab displays information about the pins connected to external peripherals in order grouped at the external periph eral component level Figure A 17 External Peripheral Tab Device Pin List x 28 SSS G External Periph Total Pin Number The following items are explained here How to open Description of each area How to open On the Project Tree panel double click Project name Project
115. and the Pin Number tab 2 Click the E button to remove the external peripheral component in question from the Device top view area if the Device Top View panel 2 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller 3 Tab selection area Selecting the tab changes the order in which information on each pin of the microcontroller is displayed This panel has the following tabs Pin Number tab This tab displays information on each pin of the microcontroller in the order of pin number Macro tab This tab displays information on each pin of the microcontroller in the order it was grouped into peripheral functions External Peripheral tab This tab displays information about the pins connected to external peripherals in order grouped at the external peripheral component level R20UT2684EJ0100 Rev 1 00 ztENESAS Page 64 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Pin Number tab This tab displays information on each pin of the microcontroller in the order of pin number Figure A 15 Pin Number Tab Device Pin List Eg ee ee Pin Name 2 Function I O N ch 4 Define Name Description E POWVANITE TOOO RxD1 Free 2 POO ANIT7 TIODTxD1 Free 3 P40 TOOLO Free _ Pin Number 4 Macro 4 External Peripheral The following items are explained here How to open Description of each area
116. ark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 349 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 mis the unit number and nis the channel number Argumenit s VO Argument Description O MD STATUS flag Cause of communication error MD_NACK Acknowledge not detected Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 350 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 25 Serial array unit 4 DALI UART4 APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for serial array unit 4 DALI UART4 use Table C 25 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 INT
117. ark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 377 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 corre sponding to the LIN UART reception end interrupt INTLR performed when number of received data speci fied by R_UARTFn_Receive argument rx_num has been completed Syntax static void r_uartfn_callback receiveend void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 378 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 correspond Syntax ing to the LIN UART reception status interrupt INTLS static void r_uartfn_callback error uint8_t err type Remark nis the channel number Argumeni s VO Argument Description O uint8_t err _ type Trigger for LIN UART reception status interrupt 00000xx1B Overrun error 00000x1xB Parity error 000001xxB Framing err
118. as used as SEG50 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 27 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 4 Confirm Source Code Confirm the source code device driver program that reflects the information configured as described in 3 3 Enter Information To confirm the source code use the Code Preview panel that opens by double clicking Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node in the Project Tree panel Figure 3 4 Confirm Source Code void main void R_MAIN UserInit Start user code Do not edit comment generated here while 10 End user code Do not edit comment generated here v 4 m p Remarks 1 You can change the source code to be displayed by selecting the source file name or API function name in the Project Tree panel 2 The following table displays the meaning of the color of the source code text displayed in the Code Pre view panel Table 3 3 Color of Source Code Color Outline Comment Reserved word for C compiler Numeric value Code section File name 3 You cannot edit the source code within the Code Preview panel 4 For some of the API functions values such as the register value are calculated and finalized when the source code is generated when the O Generate Code
119. ation necessary to control the port functions Syntax void R_PORT_ Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 118 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PORT_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 119 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 4 Timer array unit Below is a list of API functions output by the Code Generator for timer array unit use Table C 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
120. 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 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 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 su
121. ax static void r_csimn_callback_sendend void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 338 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_csimn_callback_receiveend Performs processing in response to the CSI reception end interrupt INTCSImn 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 Remark Syntax static void r_csimn_callback_receiveend void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 339 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 mis the unit number and n is the channel number Argumeni s VO
122. ay category Select whether to display additional information about the pin in the device top view Define name Selects whether to display the Define Name string of the device pin list appended to the pin in the device top view Display Displays the Define Name string of the device pin list in appended format Not display Hides the Define Name string of the device pin list Pin function Selects whether to also display unselected functions in the device top view when a function has been selected from the device pin list s Function feature Display all Displays functions selected via the device pin list s Function feature in parentheses Selected function only Only display functions selected via the device pin list s Function feature in the device top view R20UT2684EJ0100 Rev 1 00 2tENESAS Page 52 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Generator Setting tab This tab allows you to view the information Generate File Mode and Product Information on and change the setting for the Code Generator Design Tool selected in the Project Tree panel Figure A 7 Code Generator Setting Tab eii Code Generator Property 4 Generate File Mode EGR Output all API functions according to the setting Output folder C imp sample File generation control Merge file Register files Register the generated files to the project Report type HTML file 4
123. ays the help of Project Tree panel Open Help for Property Panel Property panel dedicated item Displays the help of Property panel Open Help for Device Pin List Panel Device Pin List panel dedicated item Displays the help of Device Pin List panel Open Help for Device Top View Panel Device Top View panel dedicated item Displays the help of Device Top View panel Open Help for Code Genera tor panel Peripheral Functions panel dedicated item Displays the help of Peripheral Functions panel Open Help for Code Generator Preview panel Code Preview panel dedicated item Displays the help of Code Preview panel Open Help for Output Panel Output panel dedicated item Displays the help of Output panel 2 Panel display area This area consists of multiple panels each dedicated to a different purpose See the following sections for details on this area Project Tree panel Property panel Device Pin List panel Device Top View panel Peripheral Functions panel Code Preview panel R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 42 of 480 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Output panel R20UT2684EJ0100 Rev 1 00 ztENESAS Page 43 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Project Tree panel This panel displays components of the project microcontroller design tool build tool etc in a tree structure
124. ays the summary of function of the pin Recommend Connection for Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Function column Attention Displays the precaution on using the pin External Parts This area is for selecting which external peripheral controller to connect the pin to Remarks 1 You cannot add information in the Pin Number column Pin Name column Description col umn Recommend Connection for Unused column and Attention column because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired column to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which opens by pressing the Z3 button in the upper left corner of the device pin list R20UT2684EJ0100 Rev 1 00 ztENESAS Page 66 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Macro tab This tab displays information on eac
125. b Highlight color for external periph eral pins Selects the background color of pins selected in the Device Pin List panel on the External Peripheral tab R20UT2684EJ0100 Rev 1 00 Sep 01 2013 ztENESAS Page 17 of 480 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 3 Select popup information Select the type of information that popups when you move the mouse cursor over each pin in the Device Top View panel which is opened as described in 2 3 Open Device Top View Panel To select the popup information click Device Top View Settings tab gt gt Tool Tip gt gt Tool tip in the Property panel and select the desired type of information Figure 2 9 Select Popup Information a Device Top View Property 4 Color Power pins Special pins Unused pins Used pins Device Highlight color for a selected pin Highlight color for macro pins 4 Tool Tip 4 Pin Name Display Define name Pin function Tool tip Select contents displayed in the tool tip Device Top View Settings MM Red E Yellow Highlight color for external peripheral pins J Green Display all Display all Description recommended connection for unused pin only Attention only Not display Remark Popup information is selected from the following four types Table 2 3 Select Popup Information Popup Information Outline Display all Displays the Description Recommend Conne
126. bject 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 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 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 u
127. box Default Restores the column order to the default settings Close Closes this dialog box R20UT2684EJ0100 Rev 1 00 ztENESAS Page 80 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE New Column dialog box This dialog box allows you to add your own column to the device pin list Figure A 23 New Column Dialog Box New Column E Function buttons T The following items are explained here How to open Description of each area Function buttons How to open Click the New Column button in the Column Chooser dialog box Description of each area 1 Name This area allows you to enter column headings of the columns added to the device pin list Witnin 256 characters can be entered in the Name 2 Type Select the input format of the column to add to the device pin list Text Only character strings can be entered in the column Cehck box Adds a column of check boxes Whole number Only integers can be entered in the column Real number Only real numbers can be entered in the column Date Only dates in YYYYMMDD format can be entered in the column Function buttons Button Function OK Adds a column that has the column heading specified in the Name to the right end of the device pin list Cancel Ignores the setting and closes this dialog box R20UT2684EJ0100 Rev 1 00 2tENESAS Page 81 o
128. cg_main c 1 4 File usec Yes Default name Yes Output folder C imp sample cg_src File name Indicates specifies the file name The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node and then select Property from the context menu Remark If this panel is already open selecting the source code node in the Project Tree panel changes the content displayed to that corresponding to the selected node Description of each area 1 File Information category This area allows you to view the information Fine name File used Default name and Output folder on and change the setting for the source code node selected in the Project Tree panel File name Inputs the name of the file The name of the file can be changed by selecting Rename from the context menu after selecting the source code node in the Project Tree panel File used Indicates whether or not output to a file is to proceed when the button in the Peripheral Functions panel is clicked Note that whether or n
129. 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 __interrupt static void r_taum_channeln interrupt void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 123 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_taum_channel n_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 __interrupt static void r_taum_channeln higher8bits_ interrupt void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 124 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TAUm_Channeln Start void Remark mis the unit number and nis the channel number Argumeni s None Return
130. ction for Unused and Attention strings for the device pin list Description recommended con nection for unused pin only Displays the Description and Recommend Connection for Unused strings for the device pin list Attention only Displays the Attention string for the device pin list Not display Hides tooltips when the mouse cursor hovers over a pin R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 18 of 480 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 4 Select additional information Select the type of information to display in Pin area in the Device Top View panel opened in 2 3 Open Device Top View Panel Note that additional information is selected from the Property panel on the Device Top View Settings tab by selecting the corresponding information under Pin Name Display Figure 2 10 Select Additional Information Property EJ ye Device Top View Property 4 Color Power pins Special pins Unused pins Used pins Device Highlight color for a selected pin Highlight color for macro pins Highlight color for external peripheral pins Tool Tip Tool tip Pin Name Display Define name Pin function Define name Select to show or hide the define name Device Top View Settings Remarks 1 Select one of the following two types for Define name whether to display the Define Name string of the Device Pin List in appended format Dis
131. dual use pins with no use set in the Device Pin List panel Used pins Selects the display color for used pins dual use pins with a use set in the Device Pin List panel Device Selects the display color of the microcontroller Highlight color for a selected pin Selects the background color of a pin selected in the Device Pin List panel on the Pin Number tab Highlight color for macro pins Selects the background color of pins selected in the Device Pin List panel on the Macro tab Highlight color for external Selects the background color of pins selected in the Device Pin List panel on the peripheral pins External Peripheral tab 2 Tool Tip category Select whether to display a tooltip with information about a pin when the mouse cursor is moved over the pin in the device top view Tool tip Selects whether to display a tooltip with information about a pin when the mouse cursor is moved over the pin in the device top view panel Display all Displays the Description Recommend Connection for Unused and Attention strings for the device pin list Description recommended Displays the Description and Recommend connection for unused pin Connection for Unused strings for the device pin list only Attention only Displays the Attention string for the device pin list Not display Hides tooltips when the mouse cursor hovers over a pin 3 Pin Name Displ
132. e R20UT2684EJ0100 Rev 1 00 2tENESAS Page 192 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_DitheringFunction_Stop Ends dithering function for timer output TKBOn0 Syntax void R_KB2m_TKBOn0 DitheringFunction Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 193 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_DitheringFunction_Start Starts dithering function for timer output TKBOn1 Syntax void R_KB2m_TKBOn1 DitheringFunction Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 194 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_DitheringFunction_Stop Ends dithering function for timer output TKBOn1 Syntax void R_KB2m_TKBOn1 DitheringFunction Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 195 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_SmoothStartFunction_Start Starts smooth start function for timer output TKBOn0 Syntax void R_KB2m_TKBOn0O SmoothS
133. e Performs initialization necessary to control the the 16 bit timer KCO Syntax void R_TMR_KCO Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 171 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KCO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer KCO Remark This API function is called as the R_TMR_KCO_ Create callback routine Syntax void R TMR KCO Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 172 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_tmr_kcO_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 __interrupt static void r_tmr_kcO_ interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 173 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KCO_ Start Starts the count for 16 bit timer KCO Syntax void R_TMR_KCO Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 174 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KCO_Stop Ends t
134. e Device E DimGray Highlight color for a selected pin E Gray Highlight color for macro pins E DarkGray ighli z E Silver Highlight color for external peripheral pins E LightGray pantie E Gainsboro Tool tip C WhiteSmoke z E Maroon Piae Dugin EE DarkRed Define name Pin function HS Brown MBB Firebrick E IndianRed Power pins Select text color of power pins Device Top View Settings Remark Select the colors to be displayed for the following eight types of items Table 2 2 Select Color Item Outline Power pins Selects the display color for power pins pins whose use is limited to power Special pins Selects the display color for special pins pins with specified uses Unused pins Selects the display color for unused pins dual use pins with no use set in the Device Pin List panel Used pins Selects the display color for used pins dual use pins with a use set in the Device Pin List panel Device Selects the display color of the microcontroller Highlight color for a selected pin Selects the background color of a pin selected in the Device Pin List panel on the Pin Number tab R20UT2684EJ0100 Rev 1 00 2tENESAS Page 16 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator Item Outline Highlight color for macro pins Selects the background color of pins selected in the Device Pin List panel on the Macro ta
135. e 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 405 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_Create Performs initialization necessary to control the LCD controller driver Syntax void R_LCD Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 406 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LCD_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 407 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_Icd_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 INTLC
136. e Top View X Device Top View Ok Qe U ore PO1 ANI 16 TO00 RxD1 P21 ANI 1 AVREFM a u 5 T o o N a P22 ANI2 P01 ANI 16 TO00 RxD1 a eRe amp T ss o z Z N w N N a a P22 ANI 2 POO ANI 17 T100 TxD1 RL78 C P00 ANI 17 T100 TxD1 Pa TOOLO ROM 1 Pad TOOLO _RESET R5F 101 RESET NZIMA mm NIZINA os g R20UT2684EJ0100 Rev 1 00 7tENESAS Page 20 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 5 Output Report Files Output report files files containing information configured using Pin Configurator device pin list and device top view to the specified folder 2 5 1 Output device pin list Select File menu gt gt Save Pin List As to output a report file a file containing information configured using Pin Con figurator device pin list The destination folder for the device pin list is specified in the Save As dialog box which opens by selecting File menu gt gt Save Pin List As Figure 2 12 Output Device Pin List a G5 Save As JG m Local Disk C gt tmp sample v Search sample p Organize New folder D x Favorites Name Date modified gt Sy Libraries 4 Computer b amp Local Disk C p th Network No items match your search File name mi Save as type Microsoft Office Excel Book xls z Hide Folders Save Remarks 1 If a d
137. e interval interrupt INTWDTI Remark This API function is called as the interrupt process corresponding to the interval interrupt INTWDTI Syntax __interrupt static void r_wdt_interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 259 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WDT_Restart Clears the watchdog timer counter and resumes counting Syntax void R_WDT_Restart void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 260 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 18 A D converter APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for A D converter use Table C 18 API Functions A D Converter API Function Name Function R_ADC_Create Performs initialization necessary to control the A D converter R_ADC_Create_Userlnit 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_Set_PowerOff Halts the clock supplied to the A D converter R
138. e 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_Fu nction1_ Start Starts forced output stop function 1 for timer output TKBOn0 R_KB2m_TKBOn0_Forced_Output_Stop_Fu nction1_Stop Ends forced output stop function 1 for timer output TKBOn0 R_KB2m_TKBOn1_Forced_Output_Stop_Fu nction1_ Start Starts forced output stop function 2 for timer output TKBOn1 R_KB2m_TKBOn1_Forced_Output_Stop_Fu nction1_Stop Starts forced output stop function 2 for timer output TKBOn1 R_KB2m_TKBOn0_DitheringFunction_Start Starts dithering function for timer output TKBOn0 R_KB2m_TKBOn0_DitheringFunction_Stop Ends dithering function for timer output TKBOn0 R_KB2m_TKBOn1_DitheringFunction_Start Starts dithering function for timer output TKBOn1 R_KB2m_TKBOn1_DitheringFunction_Stop Ends dithering function for timer output TKBOn1 R_KB2m_TKBOn0_SmoothStartFunction_St art Starts smooth start function for timer output TKBOn0 R_KB2m_TKBOn0_SmoothStartFunction_St op Ends smooth start function for timer output TKBOn0 R_KB2m_TKBOn1_SmoothStartFunction_St art Starts smooth start function for timer output TKBOn1 R_KB2m_TKBOn1_SmoothStartFunction_St op Ends smooth
139. ea in which to store the results of A D conversion Remark 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 i gt Results of A D conversion to be stored in buffer Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 275 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 19 Temperature sensor Below is a list of API functions output by the Code Generator for temperature sensor use Table C 19 API Functions Temperature Sensor API Function Name Function R_TMPS_Create Performs initialization necessary to control the temperature sensor R_TMPS_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 276 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMPS_Create Performs initialization necessary to control the temperature sensor Syntax void R_TMPS Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 277 of 480 S
140. ec Special pins Unused pins 1 Used pins Device Highlight color for a selected pin Highlight color for macro pins L Highlight color for external peripheral pins Omg Tool Tip Tool tip I Pin Name Display 3 4 Define name L Pin function Dsiplay all Power pins Select text color of power pins The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the context menu Remark _ If this panel is already open selecting a different Device Top View in the Project Tree panel changes the content displayed accordingly Description of each area 1 Color category Select the display colors to differentiate the pin groups Power pins Special pins etc in the device top view Power pins Selects the display color for power pins pins whose use is limited to power R20UT2684EJ0100 Rev 1 00 7tENESAS Page 51 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Special pins Selects the display color for special pins pins with specified uses Unused pins Selects the display color for unused pins
141. een 0 and 9 and the numeric value 0 Hex number A numeric value that starts with Ox and followed by a combination of numbers from 0 to 9 and characters from A to F characters are not case sensitive R20UT2684EJ0100 Rev 1 00 2tENESAS Page 25 of 480 Sep 01 2013 CubeSuite V2 01 00 3 3 2 Icon indicating incorrect entry CHAPTER 3 FUNCTIONS Code Generator When performing code generation if you enter an invalid string in the Peripheral Functions panel or a required input is missing then a icon displays next to the incorrect input and the text is displayed in red to warn that there is a problem with the input Remark If the mouse cursor is moved over the icon information regarding the string that should be entered tips for correcting the entry popups Figure 3 2 Icon Indicating Incorrect Entry PeripheralFuncioms O B fe Generate Code S s G 1 a Si MP me we A Operation mode setting gt High speed main mode 4 0 V lt VDD lt 5 5 V High speed main mode 3 6 V lt VDD lt 5 5 V High speed main mode 2 7 V lt VDD lt 5 5 V High speed main mode 2 4 V lt VDD lt 5 5 V Low speed main mode 1 8 V lt VDD lt 5 5 V Low voltage main mode 1 6 V lt VDD lt 5 5 V Main system clock fMAIN setting m High speed OCO FIH High speed system clock MX High speed OCO clock setting V Operation Frequency
142. egister the file files to the project Report type Selects the output format for the report files two files Function and Macro that are output when Save Code Generator Report is selected from the File menu HTML file Outputs the files in the HTML format CSV file Outputs the files in the CSV format Remark Note that if the Merge file is selected in File generate control the number of left braces and right braces must match in the parts to be merged When the numbers do not match processing for cor rect merging is not possible 2 Product Information category This area allows you to view the information Release Date and Version for the Code Generator Design Tool selected in the Project Tree panel Release Date Displays the release date of the Code Generator Design Tool Version Displays the version number of the Code Generator Design Tool R20UT2684EJ0100 Rev 1 00 ztENESAS Page 54 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Peripheral Function Information tab Product Information This tab allows you to view the information Product Information for the Peripheral Functions selected in the Project Tree panel Figure A 8 Peripheral Function Information Tab Product Information ca Peripheral Functions Property 2 An 4 Product Information GESTE COVA yyy Version V E AK RH AK Release date This
143. el Sets the operation mode of A D converter Syntax include r cg macrodriver h include xy cg ade h MD_STATUS R_ADC Set _TestChannel test _channel_t channel Argumeni s VO Argument Description l test_channel_t channel 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 R20UT2684EJ0100 Rev 1 00 RENESAS Page 273 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumeni s VO Argument Description O uintl _t const buffer Pointer to area in which to store read results of A D conversion Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 274 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumeni s VO Argument Description O uints_t const buffer Pointer to ar
144. elease date ddi VIVEYYYY Version Pin configurator version information The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then select Property from the context menu Remark If this panel is already open selecting a different Device Pin List in the Project Tree panel changes the content displayed accordingly Description of each area 1 Product Information category This area displays product information Version and Release date on Pin Configurator Version Displays the version of Pin Configurator Pin Configurator Plug in Release date Displays the release date of Pin Configurator Pin Configurator Plug in R20UT2684EJ0100 Rev 1 00 2tENESAS Page 50 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Device Top View Settings tab This tab allows you to view the information Color Tool Tip and Pin Name Display on and change the setting for the Device Top View selected in the Project Tree panel Figure A 6 Device Top View Settings Tab Property x gf Device Top View Property a 4 Color er R
145. en a pin is right clicked Use as If the pin has multiple functions select which function to use Connect to External Peripheral Selects which external peripheral controller to connect the pin to 2 When an external peripheral controller is right clocked Disconnect Pin Disconnects from the pin Delete External Peripheral Removes the external peripheral controller R20UT2684EJ0100 Rev 1 00 2tENESAS Page 72 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Peripheral Functions panel This panel allows you to configure the information necessary to control the peripheral functions clock generator port functions etc provided Figure A 19 Peripheral Functions Panel M 6 Generate Code s 4 1 a BO Si im Pot Oe we A _Fin assignment Clock setting On chip debug setting Confirming reset source Safety functions Pin assignment setting SSS Once the pin assignments have been fixed it is not possible to change them later Anew project must be created to change the settings TI00 TOOO T101 T001 T102 T002 TI03 T003 REMOOUT TI04 T004 T105 T005 TxD1 S010 RxD1 SDA10 SI10 ScLIO _SCKIO PCLBUZO INTP7 4 The following items are explained here How to open Description of each area How to open On the Project Tree panel double click Project name Project gt gt Code G
146. enerator Design Tool gt gt Peripheral Functions gt gt Peripheral function node On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node and then press the Enter key From the View menu gt gt Code Generator 2 select Peripheral Functions Remark _ If this panel is already open pressing a different peripheral function button 5 etc changes the content displayed in the Information setting area accordingly R20UT2684EJ0100 Rev 1 00 2tENESAS Page 73 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Description of each area 1 Toolbar This area consists of the following peripheral function buttons When there is peripheral function target microcontroller is not supporting peripheral functionbutton is not disokayed Generate Code Outputs the source code device driver program to the folder specified by selecting Code Generator Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel i etc Changes the content displayed in the Information setting area to information required for controlling peripheral functions 2 Information setting area The content displayed in this area differs depending on the peripheral function node or peripheral function but ton selected or pressed when opening this panel See user s
147. ep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMPS _Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 278 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMPS _ Start Starts measurement of the temperature that uses the temperature sensor Syntax void R_TMPS Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 279 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMPS_ Stop Ends measurement of the temperature that uses the temperature sensor Syntax void R_TMPS Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 280 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None
148. eption end interrupt INTSRn process performed when the amount of data received is greater than the argument rx_num specified for R_UARTn_Receive Syntax static void include r cg macrodriver h r_uartn_callback_softwareoverrun uint16_t rx data Remark nis the channel number Argumeni s VO Argument Description O uint16_t rx data Receive data greater than the argument rx_num specified for R_UARTn_Receive Return value None R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 330 of 480 CubeSuite V2 01 00 APPENDIX C 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 R_CSImn_ Create void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 331 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 void r_csimn_interrupt void Rema
149. erlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 104 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_cgc_ram_ecc_interrupt void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 105 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_cgc_stackpointer_ interrupt void Remark nis the interrupt factor number Argumeni s None Return value None R20UT2684
150. escription O uints_t const rx buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 396 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 void r_iican_callback_slave_sendend void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 397 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 void r_iican_callback_slave_receiveend void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 398 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_iican_callback_slave_error Per
151. escription l uint8 t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 335 of 480 CubeSuite V2 01 00 APPENDIX C 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_bur 2 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 Receive uint8_t const rx buf uint16_t rx num Remark mis the unit number and n is the channel number Argumeni s VO Argument Description O uints_t const rx buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 2tENESAS Page 336 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 t
152. evice pin list has been already output that list will be overwritten by selecting File menu gt gt Save Pin List 2 The output format for the device pin list is limited to Microsoft Office Excel Book R20UT2684EJ0100 Rev 1 00 2tENESAS Page 21 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 5 2 Output device top view Select File menu gt gt Save Top View As to output a report file a file containing information configured using Pin Configurator device top view The destination folder for the device top view is specified in the Save As dialog box which opens by selecting File menu gt gt Save Top View As Figure 2 13 Output Device Top View m G5 Save As OO dJi Local Disk C gt tmp sample v Search sample p Organize New folder gt Yr Favorites Date modified Type gt Sy Libraries 4 Computer b amp Local Disk C p C Network No items match your search File name i Save as type Bitmap bmp X Hide Folders Save Remark If a device top view has been already output that view will be overwritten by selecting File menu gt gt Save Top View R20UT2684EJ0100 Rev 1 00 ztENESAS Page 22 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator CHAPTER 3 FUNCTIONS Code Generator This chapter describes the key functions provided by the design tool Code Generator along with operati
153. f 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT8bitm_Channeln_Create Performs initialization necessary to control the 8 bit interval timer Syntax void R_IT8bitm_Channeln Create void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 237 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IT8bitm_Channeln_Create_Userlnit Performs user defined initialization relating to the 8 bit interval timer Remark This API function is called as the R_ T8bitm_Channeln_Create callback routine Syntax void R_IT8bitm_Channeln Create _UserInit void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 238 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_it8bitm_channeln interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 239 of 480 Sep 01 2013 CubeSuite V2 01 0
154. f 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Save As dialog box This dialog box allows you to name and save a file Figure A 24 Save As Dialog Box 1 z 69 Save As AA Ww Ie Local Disk C gt tmp sample v Search sample Organize New folder lugeto buttone J ow Jr Favorites Name Date modified Type Size Sg Libraries 2 sll Computer gt No items match your search gt amp Local Disk C tu Network 3 Filename Output All Messages 4 Save as type Text file txt X Hide Folders Save Function buttons The following items are explained here How to open Description of each area Function buttons How to open From the File menu select Save Output Tab Name From the File menu select Save Output Tab Name As Description of each area 1 Folder location This is for selection of the output destination folder folder name 2 List of files This area displays a list of files matching the conditions selected in Folder location and Save as type 3 File name Specify the name of the file file name R20UT2684EJ0100 Rev 1 00 2tENESAS Page 82 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE 4 Save as type Select the type of the file file type Function buttons Save Outputs a file having the name specified in the
155. f overrun error Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond ing 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 static void include r cg macrodriver h r_dalin_callback_softwareoverrun uint16_t rx data Remark nis the channel number Argumeni s VO Argument Description O uint16_t rx data Receive data greater than the argument rx_num specified for R_DALIn_Receive Return value None R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 363 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 26 Asynchronous serial interface LIN UART UARTF Below is a list of API functions output by the Code Generator for asynchronous serial interface LIN UART UARTF use Table C 26 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_Userlnit 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 p
156. forms 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 j Remark nis the channel number Argumeni s VO Argument Description l MD_STATUS flag Cause of communication error MD_ERROR Address mismatch detected MD_NACK Acknowledge not detected Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 399 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_iican_callback_getstopcondition Performs processing in response to detection of stop condition Syntax static void r_iican_callback_getstopcondition void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 400 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Set_SnoozeOn Enables operation of the address match wakeup function in STOP mode Syntax void R_IICAn Set_SnoozeOn void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 401 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Set_SnoozeOff Disables operation of the address match wakeup function in STOP mode Syntax void R_IICAn Set _SnoozeOff void
157. frequency measurement circuit 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_cg_rtc h r_cg_fme c r_cg_fmc_user c R_RTC_Create_UserInit r_rtc_interrupt r_rtc_callback_constperiod r_rtc_callback_alarm R_FMC_Create R_FMC_Start R_FMC_Stop R_FMC_Set_PowerOff R_FMC_Create_Userlnit r_fmc_interrupt r_cg_fmce h 12 bit interval timer r_cg_it c R_IT_Create R_IT_Start R_IT_Stop R_IT_Set_PowerOff r_cg_it_user c R_IT_Create_Userlnit r_it_interrupt r_cg_it h 8 bit interval timer 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_Userlnit r_it8bitm_channeln_interrupt r_cg_it8bit h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 87 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name 16 bit wakeup timer 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_Userlnit r_wutm_interrupt r_cg_t
158. function is called as the interrupt process corresponding to the DMA transfer end interrupt INTDMAn Syntax _ interrupt static void r_dmacn_interrupt void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 425 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMACn_Start Enables operation of channel n Syntax void R_DMACn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 426 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMACn_ Stop Disables operation of channel n Remarks 1 This API function does not forcibly terminate DMA transfer 2 Before using this API function you must confirm that transmission has ended Syntax void R_DMACn Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 427 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMACn_Set_SoftwareTriggerOn Starts DMA transfer Syntax void R_DMACn Set _SoftwareTriggerOn void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 428 of 480 Sep 01 2013 CubeSuite V2 01 00 APPE
159. ge 213 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_AlarmOn Starts the alarm interrupt function Syntax void R_RTC_ Set _AlarmOn void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 214 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_AlarmOff Ends the alarm interrupt function Syntax void R_RTC_ Set _AlarmOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 215 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Set_AlarmValue Sets the alarm conditions weekday hour minute Syntax include r cg macrodriver h include treg rtee h void R_RTC_Set_AlarmValue rtc_alarm_value_t alarm _val Argumeni s VO Argument Description rtc_alarm value t alarm val Alarm conditions weekday hour minute Remark Below is shown the structure rtc_alarm_value_t alarm conditions typedef struct uints t alarmwm Minute uints8 t alarmwh Hour uints8 t alarmww Weekday rtc_alarm value t alarmwm Minute Below are shown the meanings of each bit of the structure member alarmwm L BOD code minute digit 1 BCD code minute digit 10 0 Fixed alarmwh Hour Below are
160. ges the 12 bit interval timer to reset status For this reason writes to the control registers after this API function is called are ignored 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 235 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 14 8 bit interval timer Below is a list of API functions output by the Code Generator for 8 bit interval timer use Table C 14 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 INTIT nO 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 236 o
161. h pin of the microcontroller in the order it was grouped into peripheral functions Figure A 16 Macro Tab E Macro Name Toal Used UsedinOtherMacro gt AID Converter ADC a Clock Generator CLOCK 2 Interrupt Controller INTC 3 On chip Debug Function OCD 1 Port 0 PORTO 2 5 3 1 1 H A T 4 Port 1 PORT 1 Port 2 PORT2 Port 3 PORT3 TER EE gt E e EE EE EE coo Go E EE EE e EE e EE EE EE oo Fihi ort 4 PORT4 Pt 4 ry Pin Number h i External Peripheral The following items are explained here How to open Description of each area How to open On the Project Tree panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then press the Enter key From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Device pin list area This area displays the device pin list for entering information on the pins of the microcontroller The device pin list in this area is organized in the order the pins were grouped into peripheral functions a First layer The following are the columns comprising the device pin list Column Heading Outline Macro Name Displays the name of the pe
162. he argument rx_num and stores the data in the buffer specified by the argument rx_buf 2 Actual DALI reception starts after this API function is called and R_DALIn_ Start is then called Syntax include r cg macrodriver h MD_STATUS R_DALIn Receive uint8_t const rx buf uint16_t rx num Remark nis the channel number Argumeni s VO Argument Description O uints_t const rx buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 2tENESAS Page 359 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dalin_callback_sendend Performs processing in response to the DALI transmission end interrupt INTSTDLn 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 Remark Syntax static void r_dalin_callback_sendend void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 360 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dalin_callback_receiveend Performs processing in respo
163. he channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 421 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMACn _Create_Userlnit Performs user defined initialization relating to the DMA controller Remark This API function is called as the R_DMACn_ Create callback routine Syntax void R_DMACn Create UserInit void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 422 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMAC Create Performs initialization necessary to control the DMA controller Syntax void R_DMAC Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 423 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_DMAC_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 424 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dmacn_interrupt Performs processing in response to the DMA transfer end interrupt INTDMAn Remark This API
164. he count for 16 bit timer KCO Syntax void R_TMR_KCO_ Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 175 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_KCO_Set_PowerOff Halts the clock supplied to the 16 bit timer KCO Remark Calling this API function changes the 16 bit timer KCO to reset status For this reason writes to the control registers after this API function is called are ignored Syntax void R_TMR_KCO_ Set _PowerOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 176 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIXC API FUNCTIONS C 2 10 Below is a list of API functions output by the Code Generator for 16 bit timer KB2 use 16 bit timer KB2 Table C 10 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_Userlnit Performs user defined initialization relating to the 16 bit timer KB2 r_kb2m_interrupt Performs processing in response to the timer interrupt INTTKB2 m 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 th
165. he number of times specified in argument tx_num 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 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 uintl6_t tx_num uint8 t const rx buf Remark mis the unit number and n is the channel number Argumeni s VO Argument Description uint8_ t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send receive O uints_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 R20UT2684EJ0100 Rev 1 00 7tENESAS Page 337 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_csimn_callback_sendend Performs processing in response to the CSI transmission end interrupt INTCSImn 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_CSlmn_Send_Receive argument tx_num has been completed Remark Synt
166. his API function is called as the interrupt process corresponding to the key interrupt INTKR Syntax __interrupt static void r_key_interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 451 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KEY_ Start Enables the acceptance of the key interrupt INTKR Syntax void R_KEY Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 452 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KEY_Stop Disables the acceptance of the key interrupt INTKR Syntax void R_KEY Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 453 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 35 Voltage detector Below is a list of API functions output by the Code Generator for voltage detector use Table C 35 API Functions Voltage Detector API Function Name Function R_LVD_Create Performs initialization necessary to control the voltage detector R_LVD_Create_Userlnit 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 interrup
167. ile Register files Register the generated files to the project Report type HTML file 4 Product Information Release date adiVitiyyyy Version VA AE AR AE Output folder Specifies the folder to which the generated files are saved Code Generator Setting R20UT2684EJ0100 Rev 1 00 ztENESAS Page 34 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 6 Output Report Files Output report files a file containing information configured using Code Generator and a file containing information regarding the source code by first activating the Peripheral Functions panel or Code Preview panel then selecting File menu gt gt Save Code Generator Report The destination folder for the report file is specified by clicking Code Generator Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel Remarks 1 You can only use Function or Macro as a name of the report file See 3 6 1 Change output format for details on the output format Table 3 6 Output Report Files File Name Outline Function xxx A file that contains the information regarding the source code Macro xxx A file that contains the information configured using Code Generator 2 The output mode of the report file is defined in Overwrite file Figure 3 13 Output Example of Report File Function HTML File F CAtmp sample Function html Windows Internet
168. imer h controller Clock output buzzer output 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_Userlnit r_cg_pclbuz h Watchdog timer r_cg_wdt c R_WDT_Create R_WDT_Restart r_cg_wdt_user c R_WDT_Create_Userlnit r_wdt_interrupt r_cg_wdt h A D converter 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_Userlnit r_adc_interrupt r_cg_adc h Temperature sensor 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_Userlnit r_cg_tmps h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 88 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name 24 bit DS A D converter r_cg_dsadc c R_DSADC_Create R_DSADC_Set_OperationOn R_DSADC_Set_OperationOff R_DSADC_ Start R_DSADC_Siop R_DSADC_Set_PowerOff R_DSADC_Channeln_Get_Result R_DSADC_Channeln_Get_Result_16bit r_cg_dsadc_user c R_DSADC_Create_Userlnit r_dsadc_interrupt r_cg_dsadc h D A converter r_cg_dac c R_DAC_Create R_DACn_ Start R_DACn_Stop
169. ing Peripheral Functions in the Project Tree panel changes the content displayed to that corresponding to the selected node Description of each area 1 Product Information category This area allows you to view the information Release Date and Version for the Code Preview selected in the Project Tree panel Release Date Displays the release date of the Code Generator Design Tool Version Displays the version number of the Code Generator Design Tool R20UT2684EJ0100 Rev 1 00 tENESAS Page 57 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Preview Information tab Peripheral Function Information This tab allows you to view the information Peripheral Function Information for the peripheral function node selected in the Project Tree panel Figure A 11 Code Preview Information Tab Peripheral Function Information Common Property e 4 Peripheral Function Information 1 4 SL Rent COMMON Peripheral function used Yes Peripheral function name Indicates Peripheral function name The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node and then select Property from the View menu On the Project Tree panel select Project name
170. ing Code Gener ator and a file containing information regarding the source code The output format for the report file either HTML file or CSV file is selected by clicking Code Generator Setting tab gt gt Generate File Mode gt gt Report type in the Property panel The destination folder for the report file is specified by clicking Code Genera tor Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel Save Output Tab Name Output panel dedicated item Saves the message corresponding to the specified tab overwriting the existing file Save Output Tab Name As b Edit menu Output panel dedicated item Opens the Save As dialog box for naming and saving the message correspond ing to the specified tab Undo Cut Property panel dedicated item Cancels the effect of an edit operation to restore the previous state Property panel dedicated item Sends the character string or lines selected with range selection to the clip board and deletes them Copy Property panel Output panel dedicated item Sends the character string or lines selected with range selection to the clip board Paste Property panel dedicated item Inserts the contents of the clipboard at the caret position Delete Property panel dedicated item Deletes the character string or the lines selected with the range selection Select All Property panel Output pane
171. ing in response to match ID parity Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error correspond ing to the LIN UART reception status interrupt INTLS performed when ID parity has been matched Syntax static void r_uartfn_callback_idmatch void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 382 of 480 Sep 01 2013 CubeSuite V2 01 00 C 2 27 Serial interface IICA APPENDIX C API FUNCTIONS Below is a list of API functions output by the Code Generator for serial interface IICA use Table C 27 API Functions Serial Interface IICA API Function Name Function R_IICAn_Create Performs initialization necessary to control the serial interface IICA R_IICAn_Create_UserlInit 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 transmissio
172. ing in response to the timer interrupt Remark This API function is called as the interrupt process corresponding to the timer interrupt Syntax __interrupt static void r_wutm_interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 246 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WUTM Siart Starts the count for 16 bit wakeup timer Syntax void R_WUTM Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 247 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_WUTM_Stop Ends the count for 16 bit wakeup timer Syntax void R_WUTM_ Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 248 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 249 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 16 Clock output buzze
173. intl6 _t tx_num Remark mis the unit number and n is the channel number Argumeni s 1 0 Argument Description l uint8_t adr Device address l uint8_ t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send Remark Below is shown the format for specifying device address adr T 0 B7 B6 BS B4 B3 B2 Bi BO c Slave address Device type lt Device address Return value None R20UT2684EJ0100 Rev 1 00 7tENESAS Page 346 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_lICmn_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 void r cg macrodriver h R_IICmn Master Receive uint8 t adr uint8_t const rx buf uintl6 _t rx num Remark mis the unit number and n is the channel number Argumeni s VO Argument Description uints8 _t adr Device address O uints t const rx_buf Pointer to a buffer to store the received data l uint16_t rx num Total amount of data to receive Remark Below is shown the format for specifying device address adr Return value None T 0 B7
174. ion API function according to GUI setting of each peripheral Code Generator Setting In the Code Generator select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node in the Project Tree panel Setting That Determines Whether or Not to Generate Source Code can be set in units of API functions by selecting Generate Code Not Generate Code from the context menu which is displayed by right clicking the mouse Figure 3 8 Setting That Determines Whether or Not to Generate Source Code gt 2 a 5 B sample Project RSFLOWMG Microcontroller i a e Generator Design Tool 6 Ea Peripheral Functions B Ej Code Preview a Common Tu r cg_main c p E R Ea Generate Code owes P Not Generate Code m R20UT2684EJ0100 Rev 1 00 2tENESAS Page 30 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator Remark Setting That Determines Whether or Not to Generate Source Code can be confirmed by the types of icons that are displayed immediately to the left of the API function nodes Table 3 4 Setting That Determines Whether or Not to Generate Source Code Type of Icon Outline al Source code for the currently selected API function is gener ated If this icon is displayed next to the API function the correspond ing source code must be
175. is the release date of the product The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions and then select Property from the context menu Remark If this panel is already open selecting Peripheral Functions in the Project Tree panel changes the content displayed to that corresponding to the selected node Description of each area 1 Product Information category This area allows you to view the information Release date and Version for the Peripheral Functions selected in the Project Tree panel Displays the release date of the Code Generator Design Tool Release Date Displays the version number of the Code Generator Design Tool Version R20UT2684EJ0100 Rev 1 00 tENESAS Page 55 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Peripheral Function Information tab Peripheral Function Information This tab allows you to view the information Peripheral Function Information for the peripheral function node selected in the Project Tree panel Figure A 9 Peripheral Function Information Tab Peripheral Fu
176. isplayed by right clicking the mouse R20UT2684EJ0100 Rev 1 00 7tENESAS Page 77 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Copy Sends the character string or lines selected with range selection to the clipboard Select All Selects all the messages displayed on the Message area Clear Deletes all the messages displayed on the Message area Tag Jump Jumps to the caret line in the editor indicated by the message file line and column Open Help for Message Displays help for the message on the current caret location This only applies to warning messages and error messages R20UT2684EJ0100 Rev 1 00 ztENESAS Page 78 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Column Chooser dialog box This dialog box allows you to choose whether or not to display the item listed in this dialog box in the device pin list and add columns to or delete columns from the device pin list Figure A 22 Column Chooser Dialog Box Column Chooser i Pin Number Pin Name Function I O N ch Define Name Description Recommend Connection for Unused Attention L V External Peripheral Function buttons T The following items are explained here How to open Description of each area Function buttons How to open In the Pin Number tab of the Device Pin List panel click the button In the Macro tab of the Device Pin
177. l dedicated item Selects all the strings displayed in the item being edited or all the strings dis played in the Message area Search Device Pin List panel Code Preview panel Output panel dedicated item Opens the Search and Replace dialog box for searching strings with the Quick Search tab selected Replace Output panel dedicated item Opens the Search and Replace dialog box for replacing strings with the Whole Replace tab selected R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 41 of 480 CubeSuite V2 01 00 c View menu APPENDIX A WINDOW REFERENCE Project Tree Project Tree panel dedicated item Opens the Project Tree panel Property Property panel dedicated item Opens the Property panel Output Output panel dedicated item Opens the Output panel Pin Configurator The cascading menu shown below is displayed Device Pin List Device Pin List panel dedicated item Opens the Device Pin List panel Device Top View Device Top View panel dedicated item Opens the Device Top View panel Code Generator 2 d Help menu Open Help for Project Tree Panel The cascading menu shown below is displayed Peripheral Functions Peripheral Functions panel dedicated item Opens the Peripheral Functions panel Code Preview Code Preview panel dedicated item Opens the Code Preview panel Project Tree panel dedicated item Displ
178. l functions clock according to the setting generation circuit voltage detection circuit etc that is set for use in the Peripheral Functions panel are output Output only initialization Of the API functions for the peripheral functions API function clock generation circuit voltage detection circuit etc that are set for use in the Peripheral Functions panel only those relating to initialization are output Output folder Inputs the output destination folder File generation control Click on this option to select the reaction to cases where a file having the same file name exists when the Generate Code button of the Peripheral Functions panel is clicked Do nothing if file exists If a file with the same name exists a new file will not be output Merge file If a file with the same name exists a new file is merged with the existing file Only the section between Start user code Do not edit comment generated here and End user code Do not edit comment generated here will be merged Overwrite file If a file with the same name exists the existing file is overwritten by a new file Register files Click on this option to select whether or not to register the output file in the project when the F Generate Code button of the Peripheral Functions panel is clicked Register the generated files Registers the file to the project Not register the generated Does not r
179. l uint8_t adr Slave address l uint8 t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send l uints_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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 390 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_burt Syntax include r cg macrodriver h MD_STATUS R_IICAn Master Receive uint8 _t adr uint8_t const rx buf uintl6 _t rx num uint8 t wait Remark nis the channel number Argumeni s VO Argument Description l uint8_t adr Slave address O uints_t const rx_buf Pointer to a buffer to store the received data l uint16_t rx_num Total amount of data to receive l 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 391 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C
180. layed in the device pin list using the button in the upper left corner of the device pin list To select the item to be displayed use the Column Chooser dialog box that opens by pressing the button in the upper left corner of the device pin list Figure 2 2 Select Item Column Chooser E Define Name Description Recommend Connection for Unused Attention External Peripheral i Delete Column Default Close g 9 Sg ssaes Remark To select the item to be displayed check the check box that corresponds to the item Table 2 1 Select Item Checked Displays the selected item in the device pin list Not checked Hides the selected item in the device pin list R20UT2684EJ0100 Rev 1 00 2tENESAS Page 11 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 2 2 Change display order In Pin Configurator you can change the display order of columns in the device pin list move columns by dragging and dropping columns Figure 2 3 Change Display Order eae ea Pin Name A Function I O N ch 1 POVANITE amp TOOO RxD1 P01 VO 2 POO ANIT7 TIOO TxD1 P00 VO 2 panrtmanin l Define ca A Function O 4 N ch Define 1 POVANIT6 TOOO RxD1_ PO1 WO 2 POO ANIT7 TIOOTxD No 2 BANTANIN Eres A Functi 1 POVANIT6 TOOO RxD1 PO1 2 POO ANIT7 TIOWTxD1 POO 2 panrranin Pin Name q Function I O
181. lows you to view the information on and change the setting for the node selected in the Project Tree panel The content displayed in this area differs depending on the node selected in the Project Tree panel The following table displays the meaning of and amp displayed to the left of each category Indicates that the items within the category are displayed as a collapsed view E Indicates that the items within the category are displayed as an expanded view Remark To switch between and H click this mark or double click the category name 2 Tab selection area In this panel following tabs are contained see the section explaining each tab for details on the display setting on the tab Pin Configurator Settings tab Device Pin List Information tab Device Top View Settings tab Code Generator Setting tab Peripheral Function Information tab Product Information Peripheral Function Information tab Peripheral Function Information Code Preview Information tab Product Information Code Preview Information tab Peripheral Function Information Code Preview Setting tab File Information Code Preview Setting tab Function Information Context menu The following context menu items are displayed by right clicking the mouse R20UT2684EJ0100 Rev 1 00 2tENESAS Page 47 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE
182. manual for microcontroller for details on the items to be set R20UT2684EJ0100 Rev 1 00 ztENESAS Page 74 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Preview panel This panel allows you to confirm the source code in accord with the settings of the Peripheral Functions panel Figure A 20 Code Preview Panel void main void R_MAIN UseriInit Start user code Do not edit comment generated here while 1U r End user code Do not edit comment generated here v E i T The following items are explained here How to open Description of each area Context menu How to open On the Project Tree panel double click Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function mode and then press the Enter key From the View menu gt gt Code Generator 2 select Code Preview Remark _ If this panel is already open double clicking the source code node gt gt API function node changes the con tent displayed in the Source code display area to that corresponding to the selected node Description of each area
183. mation configured in the Peripheral Func tions panel Output Source Code Output the source code device driver program to the specified folder Output Report Files Output report files a file containing information configured using Code Generator and a file containing information regarding the source code to the specified folder Save project Save a project R20UT2684EJ0100 Rev 1 00 2tENESAS Page 23 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Save project 3 2 Open Peripheral Functions Panel The Peripheral Functions panel is opened to set the information necessary to control the peripheral functions clock generator pin functions etc provided in the device To open the Peripheral Functions panel double click Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node in the Project Tree panel Figure 3 1 Open Peripheral Functions Panel Once the pin assignments have been fixed it is not possible to change them later Anew project must be created to change the settings Function T100 TOO0 TI01 TO01 T102 TO02 TxD1 S010 RxD1 SDA10 SI10 SCL10 _SCK10 PCLBUZO INTP7 Remark If an unsupported device is defined in the project for Code Generator then C
184. n area of the Column Chooser dialog box and press the Delete Column button Figure 2 5 Delete Column Column Chooser Define Name Description Recommend Connection for Unused Attention External Peripheral New Column SeSsisSsSssSsaSaeSesags i Delete Colum Default Close Remark You can only delete the column which you added using the New Column dialog box R20UT2684EJ0100 Rev 1 00 7tENESAS Page 13 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 3 Open Device Top View Panel Open the Device Top View panel where you can confirm the information entered for the pins of the microcontroller To open the Device Top View panel double click Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View in the Project Tree panel Figure 2 6 Open Device Top View Panel O PANAHI ANTEP O PIAHI AEEY PATA 1 E user Define To register drag and drop the user define to the top Pit SIOA PO T LRD SDAD 0 P12 S000 TdT LTD Pres TiO TOD MEPS Sot Pity TIOR Toaa Ss 111 0411 PSO NTRS Sa 1 S0L01 Remark In the Property panel on the Pin Configurator Settings tab if BGA is selected for the Package type then Device Top View panel cannot be opened R20UT2684EJ0100 Rev 1 00 ztENESAS Page 14 of 480 Sep 01 2013 CubeSuite V2 01 00 CH
185. n 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 383 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Create Performs initialization necessary to contr
186. n value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 303 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PGA_Stop Ends the operation of programmable gain amplifier Syntax void R_PGA_ Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 304 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 23 Comparator Below is a list of API functions output by the Code Generator for comparator use Table C 23 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_Set_PowerOff Halts the clock supplied to the comparator R20UT2684EJ0100 Rev 1 00 2tENESAS Page 305 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_COMP_Create Performs initialization necessary to control the comparator Syntax void R_COMP_ Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 306 of
187. n_callback_master_receiveend r_iicmn_callback_master_error r_cg_serial h or r_cg_sau h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 90 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Serial array unit 4 DALI r_cg_serial c R_DALIn_Create UARTA4 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 Asynchronous serial interface LIN UART UARTF r_cg_serial c r_cg_serial_user c R_UARTFn_Create R_UARTFn_Siart R_UARTFn_Stop R_UARTFn_Set_PowerOff R_UARTFn_Send R_UARTFn_Receive R_UARTFn_Set_DataComparisonOn R_UARTFn_Set_DataComparisonOff R_UARTFn_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 91 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name Serial interface IICA r_cg_serial c or r_cg_iica c R_I
188. nction Information Clock Generator Property 4 Peripheral Function Information Zek Oa Clock Generator Peripheral function error No error Peripheral function used Used Peripheral function name Indicates Peripheral function name The following items are explained here How to open Description of each area How to open On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node and then select Property from the context menu Remark If this panel is already open selecting peripheral function node in the Project Tree panel changes the con tent displayed to that corresponding to the selected node Description of each area 1 Peripheral Function Information category This area allows you to view the information Peripheral function name Peripheral function error and Peripheral function used for the peripheral function node selected in the Project Tree panel Peripheral function name Displays the name of the peripheral function Peripheral function error Displays whether or not the settings in the Peripheral Functions panel are correct No error Illegal settings have
189. nction is called as the interrupt process corresponding to the LIN UART reception end interrupt INTLR Syntax _ interrupt static void r_uartfn_interrupt_receive void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 368 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 inter rupt INTLS Syntax _ interrupt static void r_uartfn_interrupt_error void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 369 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTFn_Start Sets LIN communication to standby mode Syntax void R_UARTFn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 370 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTFn_Stop Ends LIN communication Syntax void R_UARTFn_ Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS
190. nneln_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_Userlnit r_taum_channeln_interrupt r_taum_channeln_higher8bits_interrupt r_cg_timer h or r_cg_tau h Timer RJ r_cg_timer c R_TMR_RJO_Create R_TMR_RJO_Start R_TMR_RJO_Stop R_TMR_RJO_Set_PowerOff R_TMR_RJO_Get_PulseWidith r_cg_timer_user c R_TMR_RJO_Create_Userlnit r_tmr_rjO_interrupt r_cg_timer h Timer RD 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_cg_timer_user c R_TMR_RDn_Create_Userlnit r_tmr_rdn_interrupt r_cg_timer h Timer RG r_cg_timer c R_TMR_RGO_Create R_TMR_RGO_Start R_TMR_RGO_Stop R_TMR_RGO_Set_PowerOff R_TMR_RGO_Get_PulseWidth r_cg_timer_user c R_TMR_RGO_Create_UserlInit r_tmr_rgO_interrupt r_cg_timer h R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 85 of 480 CubeSuite V2 01 00 APPENDIX B OUTPUT FILES Peripheral Function File Name API Function Name 16 bit timer KB r_cg_timer c R_TMR_KB _ Create R_TMR_KBm_Start R_TMR_KBm_Sitop R_TMR_KBm_Set_PowerOff R_T
191. nse to the DALI reception end interrupt INTSRDLn Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond ing 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 void r_dalin_ callback _receiveend void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 361 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 nis the channel number Argumeni s VO Argument Description O uint8_t err_type Trigger for DALI reception error interrupt 00000xx1B Overrun error 00000x1xB Parity error 000001xxB Framing error Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 362 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_dalin_callback_softwareoverrun Performs processing in response to detection o
192. o control the asynchronous serial interface LIN UART UARTF Syntax void R_UARTFn Create void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 365 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTFn_Create_Userlnit 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 R UARTFn Create UserInit void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 366 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 inter rupt INTLT Syntax _ interrupt static void r_uartfn_interrupt_send void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 367 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_uartfn_interrupt_receive Performs processing in response to the LIN UART reception end interrupt INTLR Remark This API fu
193. ode Generator Design Tool node will hide under Project name Project in the Project Tree panel R20UT2684EJ0100 Rev 1 00 2tENESAS Page 24 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 3 Enter Information Configure the information necessary to control the peripheral functions clock generator port functions etc in the information setting area of the Peripheral Functions panel which is opened as described in 3 2 Open Peripheral Func tions Panel Remark When controlling multiple peripheral functions repeat the procedures described in 3 2 Open Peripheral Functions Panel through 3 3 Enter Information 3 3 1 Input rule Following is the rules for input to the Peripheral Functions panel 1 Character set Character sets that are allowed to input are as follows Table 3 1 List of Character Set Character Set Outline ASCII 1 byte alphabet number symbol Shift JIS 2 byte alphabet number symbol Hiragana Katakana Kanji and 1 byte Kata kana EUC JP 2 byte alphabet number symbol Hiragana Katakana Kanji and 1 byte Kata kana UTF 8 2 byte alphabet number symbol Hiragana Katakana Kanji include Chinese character and 1 byte Katakana 2 Number Notations allowed when entering numbers are as follows Table 3 2 List of Notation Notation Outline Decimal number A numeric value that starts with a number between 1 and 9 and followed by numbers betw
194. of the Peripheral Functions panel Output panel This panel displays operation logs for various components design tool build tool etc provided by CubeSuite Column Chooser dialog box This dialog box allows you to choose whether or not to display the item listed in this dialog box in the device pin list and add columns to or delete columns from the device pin list New Column dialog box This dialog box allows you to add your own column to the device pin list Save As dialog box This dialog box allows you to name and save a file R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 39 of 480 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE This is the first window to open when CubeSuite is launched This window is used to operate various components design tool build tool etc provided by CubeSuite Figure A 1 Main Window f sample CubeSuite Property 1 4 File Edit View Project Build Debug Tool Window Help sor Pod x dB 9 oC REA Em GR DefaultBuild Project Tree B Fa sample Project 4 R5F1006A Microcontroller a sample mtpj E A Pin Configurator Design Tool i Absolute path C tmp sample sample mtpj p P Code Generator Design Tool A CAT8KOR Build Tool Bj E gt RL78 Simulator Debug Tool man b File This is the name of the file to which the information of this main LSR S project is to be saved Si Startup
195. oject Figure 3 6 Configure Whether to Register e Code G tor P t 4 Generate File Mode API output control Output folder Output all API functions according to the settinn C imp sample File generation control Merge file Release date Version ie HHH HH Register files Selects whether to register the generated file to the project R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 29 of 480 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 5 1 Set whether or not to generate source code You can set the type of output API functions all API functions or only initialization API functions by selecting Output all API functions according to the setting Output only initialization API function from Code Generator Setting tab gt gt Generate File Mode gt gt API output control in the Property panel Figure 3 7 Setting That Determines Type of API Functions Property x e i Code Generator Property 4 Generate File Mode EGET Output all API functions according to the setting w Output folder Output all API functions according to the setting File generation control 2 n initialization API function Register files Report type HTML fie Product Information Release date daiViViyyyy Version V E aK Ae AE API output control Selects whether to output All API function necessary to operation according to GUI setting of each peripheral or to output only initializat
196. ol the serial interface IICA Syntax void R_IICAn Create void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 384 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_Create_Userlnit 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 R_IICAn Create UserInit void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 385 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_iican_interrupt void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 386 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICAn_StopCondition Generates stop conditions Syntax void R_IICAn StopCondition void Remark nis the channel number Argumeni s None Return value None
197. ommunication Syntax void R_UARTn_ Stop void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 324 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 2 When performing a UART transmission R_UARTn_Start must be called before this API function is called Syntax include r cg macrodriver h MD_STATUS R_UARTn Send uint8_t const tx buf uint16_t tx_num Remark nis the channel number Argumeni s VO Argument Description l uint8 t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send Return value Macro Description MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT2684EJ0100 Rev 1 00 2tENESAS Page 325 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_bur 2 Actual UART reception starts after this
198. on 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 267 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 268 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 269 of 480 Sep 01 2013 CubeSuite V2 01 00
199. on Code Generator Setting The output mode is selected from the following three types Table 3 5 Output Mode of Source Code Output Mode Outline Do nothing if file exists If a file with the same name exists a new file will not be output Merge file If a file with the same name exists a new file is merged with the existing file Only the section between Start user code Do not edit comment generated here and End user code Do not edit comment generated here will be merged Overwrite file If a file with the same name exists the existing file is overwritten by a new file Remark Note that if the Merge file option is selected the number of left braces and right braces must match in the parts to be merged When the numbers do not match processing for correct merging is not possible R20UT2684EJ0100 Rev 1 00 2tENESAS Page 33 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 5 5 Change output destination folder The Code Generator is used to change the output destination folder for the source code by selecting Code Generator Setting tab gt gt Generate File Mode gt gt Output folder in the Property panel Figure 3 12 Change Output Destination Folder eti Code Generator Property 4 Generate File Mode API output control Output all API functions according to the setting C imp sample File generation control Merge f
200. on is called as the hdwinit callback routine Syntax void R_Systeminit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 99 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS main This is a main function Remark Call this API function from the startup routine Syntax void main void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 100 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_MAIN_Userlnit Performs user defined initialization Remark This API function is called as the main callback routine Syntax void R_MAIN UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 101 of 480 Sep 01 2013 CubeSuite V2 01 00 C 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 APPENDIX C API FUNCTIONS Table C 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_Userlnit Performs user defined initialization relating to the clock generator include reset function on chip debug function etc
201. on proce dures Remark In this chapter an example where an RL78 L13 ROM 128KB R5F10 WMG 80pin is the target device is 3 1 used to explain the key functions Overview The Code Generator outputs source code device driver programs based on information selected entered on CubeSu ite panels that is needed to control the peripheral functions clock generator port functions etc provided by the device The following sections describe the operation procedures for Code Generator 1 2 3 4 5 6 7 8 Start CubeSuite Launch CubeSuite from the Start menu of Windows Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Start CubeSuite Create Open project Create a new project that defines a kind of project device to be used build tools to be used etc or load an exist ing project Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Create Open project Open Peripheral Functions Panel Open the Peripheral Functions panel used to configure the information necessary to control the peripheral func tions clock generator port functions etc Enter Information Configure the information necessary to control the peripheral functions clock generator port functions etc in the Peripheral Functions panel Confirm Source Code Confirm the source code device driver program that reflects the infor
202. only be called when the 16 bit timer RJO is being used for pulse width measurement mode pulse period measurement mode 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_RJO_Get_PulseWidth uint32_t const active_width Argumeni s VO Argument Description O uint32 t const active width Pointer to an area storing the active level width that was read from the TRJOIO pin Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 141 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 6 Timer RD Below is a list of API functions output by the Code Generator for timer RD use Table C 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_Userlnit 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
203. or Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 379 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 corre sponding to the LIN UART reception end interrupt INTLR performed when number of received data speci fied by R_UARTFn_Receive argument rx_num has been completed Syntax static void r_uartfn_callback_softwareoverrun void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 380 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 correspond ing to the LIN UART reception status interrupt INTLS performed when expansion bit has been detected Syntax static void r_uartfn_callback_expbitdetect void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 381 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_uartfn_callback_idmatch Performs process
204. orms initialization necessary to control the serial array unit Syntax void R_SAUm_ Create void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 314 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAUm Create_Userlnit 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 R_SAUm_Create_UserInit void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 315 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 func tion is called are ignored Syntax void R_SAUm_Set_PowerOff void Remark mis the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 316 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAUm _ Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode Syntax void R_SAUm_Set_SnoozeOn void
205. ot this option is used depends on the settings in the Peripheral Functions panel corre sponding to the selected node Yes A file is output No A file is not output R20UT2684EJ0100 Rev 1 00 2tENESAS Page 59 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Default name Selects whether or not to restore the default name of the file Note that the default name of the file can be restored by selecting Default from the context menu after selecting the source code node in the Project Tree panel Yes The default name is restored No The default name is not restored Output folder Displays the output destination folder Note that the output destination folder can be changed by using Generate File Mode gt gt Output folder in the Code Generator Setting tab R20UT2684EJ0100 Rev 1 00 ztENESAS Page 60 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Code Preview Setting tab Function Information This tab allows you to view the information Function Information on and change the setting for the API function node selected in the Project Tree panel Figure A 13 Code Preview Setting Tab Function Information Property nmn _ B a main Property la 4 Function Information o EE man Function used Ungenerated Default name Yes Function name Indicates the function name The following items
206. play Displays the Define Name string of the device pin list in appended format Not display Hides the Define Name string of the device pin list 2 Select one of the following two types for Pin function whether to display it whether or not a function is selected for Function on the Device Pin List Display all Displays functions selected via the device pin list s Function feature in parentheses Selected function only Only display functions selected via the device pin list s Function feature in the device top view R20UT2684EJ0100 Rev 1 00 2tENESAS Page 19 of 480 Sep 01 2013 CubeSuite V2 01 00 CHAPTER 2 FUNCTIONS Pin Configurator 2 4 Enter Information Enter information on the pins of the microcontroller in the Device Pin List panel which is opened as described in 2 2 Open Device Pin List Panel Remarks 1 You cannot add information in the Pin Number column Pin Name column Description column Recommend Connection for Unused column and Attention column because they contain fixed infor mation 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color repre senting the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel Figure 2 11 Change in Displayed Color Devic
207. r n after AZ A D conversion end interrupt INTDSAD is generated Syntax include r cg macrodriver h void R_DSADC_Channeln Get_Result uint32_t const buffer j Remark nis the channel number Argumeni s VO Argument Description O uint32_t const buffer Pointer to area in which to store read results of A D conversion Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 291 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 AX A D conversion result register n after A A D conversion end interrupt INTDSAD is generated Syntax include r cg macrodriver h void R_DSADC_Channeln Get_Result_1 6bit uint16 _t const buffer j Remark nis the channel number Argumeni s VO Argument Description O uint1i6_t const buffer Pointer to area in which to store the results of A D conversion Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 292 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 21 D A converter Below is a list of API functions output by the Code Generator for D A converter use Table C 21 API Functions D A Converter
208. r output controller Below is a list of API functions output by the Code Generator for clock output buzzer output controller use Table C 16 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 R20UT2684EJ0100 Rev 1 00 2tENESAS Page 250 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PCLBUZn_Create Performs initialization necessary to control the clock buzzer output controller Syntax void R_PCLBUZn Create void Remark nis the output pin Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 251 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PCLBUZn_Create_Userlnit 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 R PCLBUZn Create UserInit void Remark nis the output pin Argumeni s None Return value None
209. rator Design Tool gt gt Device Pin List and then press the Enter key From the View menu select Pin Configurator gt gt Device Pin List Description of each area 1 Toolbar This area consists of the following buttons Displays the information in the Device pin list area in an expanded view Displays the information in the Device pin list area in a folded view only a Clicks this button to automatically process the configuration information in the selected function I O N ch and other fields after selecting one of the peripheral functions displayed in the first level on the Macro tab Ei Clicks this button to initialize the selected function I O N ch and other fields after selecting one of the peripheral functions displayed in the first level on the Macro tab R20UT2684EJ0100 Rev 1 00 7tENESAS Page 63 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE E Clicks this button to create an external peripheral controller from the external periph eral controller information on the External Peripheral tab and display it in the Device Top View panel E Clicks this button to delete the information for the external peripheral controller dis played on the External Peripheral tab on the first layer Remarks 1 Click the button to add the information in question as a choice in the External Parts column of the Macro tab
210. rgument Description l MD_STATUS flag Cause of communication error MD_SPT Stop condition detected MD_NACK Acknowledge not detected Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 394 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 nis the channel number Argumeni s VO Argument Description l uint8_ t const tx buf Pointer to a buffer storing the transmission data l uint16_t tx num Total amount of data to send Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 395 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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_burt Syntax include r cg macrodriver h void R_IICAn Slave Receive uint8_t const rx buf uint16_t rx num Remark nis the channel number Argumeni s VO Argument D
211. ripheral function Total Displays the total number of pins assigned to the peripheral function Used Displays the total number of pins for which the purpose has been set Used in Other Macro Displays the total number of pins for which the purpose has been set by other peripheral functions R20UT2684EJ0100 Rev 1 00 2tENESAS Page 67 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE b Second layer Column Heading Outline Pin Number Displays the pin number of the pin Pin Name Displays the pin name of the pin Function This area allows you to select which function to use when the pin has more than one functions VO This area allows you to select the I O mode of the pin N ch This area allows you to select which output mode to apply when using the pin in the output mode Define Name This area allows you to assign a user defined pin name to the pin Within 256 characters can be entered in the Define Name Description Displays the summary of function of the pin Recommend Connection for Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Function column Attention Displays the precaution on using the pin External Parts This area is for selecting which external peripheral controller to connect the pin to Remarks 1 You cannot add information in the Macro N
212. rk mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 332 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CSImn_Start Sets 3 wire serial I O communication to standby mode Syntax void R_CSImn_ Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 333 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CSImn_Stop Ends 3 wire serial I O communication Syntax void R_CSImn_Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 334 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CSImn_Send Starts CSI data transmission Remarks 1 the number of times specified in argument tx_num This API function repeats the byte level CSI transmission from the buffer specified in argument tx_buf 2 When performing a CSI transmission R_CSImn_Start must be called before this API function is called Syntax include r cg macrodriver h MD_STATUS R_CSImn_ Send uint8_t const tx buf uint16_t tx_num Remark mis the unit number and n is the channel number Argumeni s VO Argument D
213. rmation requiring particular attention Remark Supplementary information Numeric representation Decimal XXXX Hexadecimal 0xXXXX Related Documents The related documents indicated in this publication may include preliminary versions However preliminary versions are not marked as such Document Name Document No CubeSuite Start R20UT2682E Integrated Development Environment RX Design R20UT2683E User s Manual V850 Design R20UT2134E R8C Design R20UT2135E RL78 Design This manual 78KOR Design R20UT2137E 78K0 Design R20UT2138E RH850 Coding R20UT2584E RX Coding R20UT2470E V850 Coding R20UT0553E Coding for CX Compiler R20UT2659E R8C Coding R20UT0576E RL78 78KOR Coding R20UT2140E 78K0 Coding R20UT2141E RH850 Build R20UT2585E RX Build R20UT2472E V850 Build R20UT0557E Build for CX Compiler R20UT2142E R8C Build R20UT0575E RL78 78KOR Build R20UT2143E 78KO Build R20UT0783E RH850 Debug R20UT2685E RX Debug R20UT2702E V850 Debug R20UT2446E R8C Debug R20UT0770E RL78 Debug R20UT2445E 78KOR Debug R20UT0732E 78K0 Debug R20UT0731E Analysis R20UT2686E Message R20UT2687E Caution The related documents listed above are subject to change without notice Be sure to use the latest edition of each document when designing All trademarks or registered trademarks in this document are the property of their respective owners TABLE OF CONTENTS CHAPTER 1 GENERAL 7 1 1 Overview 7 1 2 Features 7 CH
214. rnal function of R_ ICmn_Master_Send and R_ ICmn_Masier_Receive For this reason there is normally no need to call it from a user program Syntax void R_IICmn_StartCondition void Remark mis the unit number and nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 343 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IlICmn_StopCondition Generates stop conditions Syntax void R_IICmn_StopCondition void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 344 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_IICmn_Stop Ends simple IIC communication Syntax void R_IICmn_Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 345 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 u
215. rocessing 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 364 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTFn_Create Performs initialization necessary t
216. s called as the interrupt process corresponding to the A D conversion end interrupt INTAD Syntax _ interrupt static void r_adc_interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 264 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 opera tion 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 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 265 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC_Set_OperationOff Disables operation of voltage converter Syntax void R_ADC Set _Operationoff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 266 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_ADC Siart Starts A D conversi
217. s the unit number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 131 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TAUm_Channeln_Get_PulseWidth Captures the high low level width measured between pulses of the signal pulses input to the TIlmn pin Syntax include r cg macrodriver h void R_TAUm_Channeln Get _PulseWidth uint32_t const width Remark mis the unit number and n is the channel number Argumenit s 1 0 Argument Description O uint32_t const width Pointer to an area to store the measurement width 0x0 to 0x1FFFF Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 132 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TAUm_Channeln_Set_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output Syntax void R_TAUm_Channeln Set_SoftwareTriggerOn void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 133 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 5 Timer RJ Below is a list of API functions output by the Code Generator for timer RJ use Table C 5 API Functions Timer RJ API Function Name Function R_TMR_RJO_Create Performs ini
218. se Table C 34 API Functions Key Interrupt Function API Function Name Function R_KEY_Create Performs initialization necessary to control the key interrupt function R_KEY_Create_Userlnit 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 448 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KEY_Create Performs initialization necessary to control the key interrupt function Syntax void R_KEY Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 449 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KEY_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 450 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_key_interrupt Performs processing in response to the key interrupt INTKR Remark T
219. se 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 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 This document may not be reproduced or duplicated in any form in whole or in part without prior written consent of Renesas Electronics Please contact a Renesas Electronics sales office if you have any questions regarding the information contained in this document or Renesas Electronics products or if you have any other inquiries Note 1 Renesas Electronics as used in this document means Renesas Electronics Corporation and also includes its majority owned subsidiaries Note 2 Renesas Electronics product s means any product developed or manufactured by or for Renesas Electronics 2012 4 How to Use This Manual This manual describes the role of the CubeSuite integrated developmen
220. 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 BCD code hour digit 1 L BOD code hour digit 10 00 Fixed R20UT2684EJ0100 Rev 1 00 2tENESAS Page 216 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS alarmww Weekday Below are shown the meanings of each bit of the structure member alarmww 7 6 5 4 3 2 1 0 mn e 1 Sunday 1 Monday 1 Tuesday 1 Wednesday 1 Thursday 1 Friday 1 Saturday 0 Fixed Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 217 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Get_AlarmValue Reads the alarm conditions weekday hour minute Syntax include r cg macrodriver h include en eg rech 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 VO Argument Description O rtc_alarm_ value _t Pointer to structure in which to store the conditions being read const alarm _val Return value None R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 218 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_rtc_callback_alarm Performs processing
221. ss corresponding to the timer interrupt Syntax __interrupt static void r_tmr_rj0O_ interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 137 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Start Starts the count for 16 bit timer RJO Syntax void R_TMR_RJO Start void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 138 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Stop Ends the count for 16 bit timer RJO Syntax void R_TMR_RJO_ Stop void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 139 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Set_PowerOff Halts the clock supplied to the 16 bit timer RJO Remark Calling this API function changes the 16 bit timer RJO to reset status For this reason writes to the control registers after this API function is called are ignored Syntax void R_TMR_RJO_ Set _PowerOff void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 140 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Get_PulseWidth Reads the pulse width of the 16 bit timer RJO Remarks 1 This API function can
222. st and then select Property from the context menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Top View and then select Property from the context menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool and then select Property from the context menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Peripheral Functions gt gt Peripheral function node and then select Property from the context menu On the Project Tree panel select Project name Project gt gt Code Generator Design Tool gt gt Code Preview gt gt Peripheral function node gt gt Source code node gt gt API function node and then select Property from the View menu R20UT2684EJ0100 Rev 1 00 7tENESAS Page 46 of 480
223. t environment for developing applications and systems for RL78 family and provides an outline of its features CubeSuite is an integrated development environment IDE for RL78 family integrating the necessary tools for the development phase of software e g design implementation and debugging into a single platform By providing an integrated environment it is possible to perform all development using just this product without the need to use many different tools separately Readers Purpose Organization How to Read This Manual Conventions This manual is intended for users who wish to understand the functions of the CubeSuite and design software and hardware application systems This manual is intended to give users an understanding of the functions of the CubeSuite to use for reference in developing the hardware or software of systems using these devices This manual can be broadly divided into the following units CHAPTER 1 GENERAL CHAPTER 2 FUNCTIONS Pin Configurator CHAPTER 3 FUNCTIONS Code Generator APPENDIX A WINDOW REFERENCE APPENDIX B OUTPUT FILES APPENDIX C API FUNCTIONS It is assumed that the readers of this manual have general knowledge of electricity logic circuits and microcontrollers 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 Info
224. t mode and interrupt amp reset mode R20UT2684EJ0100 Rev 1 00 2tENESAS Page 454 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LVD_Create Performs initialization necessary to control the voltage detector Syntax void R_LVD Create void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 455 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LVD_Create_Userlnit 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 456 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_lvd_interrupt void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 457 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_LVD_InterruptMode_Start Starts voltage detection when in interrupt mode and interrupt amp reset mode Syntax
225. tartFunction Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 196 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn0_SmoothSiartFunction_Stop Ends smooth start function for timer output TKBOn0 Syntax void R_KB2m_TKBOn0O SmoothStartFunction_ Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 197 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_SmoothStartFunction_Start Starts smooth start function for timer output TKBOn1 Syntax void R_KB2m_TKBOnl1 SmoothStartFunction Start void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 198 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_KB2m_TKBOn1_SmoothStartFunction_Stop Ends smooth start function for timer output TKBOn1 Syntax void R_KB2m_TKBOn1 SmoothStartFunction_ Stop void Remark mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 199 of 480 Sep 01 2013 CubeSuite V2 01 00 APP
226. terrupt_receive correspond ing 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 void r_uartn_callback_receiveend void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 328 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 nis the channel number Argumeni s VO Argument Description O uint8_t err_type Trigger for UART reception error interrupt 00000xx1B Overrun error 00000x1xB Parity error 000001xxB Framing error Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 329 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 correspond ing to the UART rec
227. the CSI transmission end interrupt INTCSImn 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 inter rupt INTIIC mn R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 312 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS API Function Name Function R_IIlCmn_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_lICmn_Master_Receive Starts simple IIC master reception r_iicmn_callback_master_sendend Performs processing in response to the simple IC mn master transmission end interrupt INTIIC mn r_iicmn_callback_master_receiveend Performs processing in response to the simple IIC mn master reception end interrupt INTIIC mn r_iicmn_callback_master_error Performs processing in response to detection of parity error ACK error R20UT2684EJ0100 Rev 1 00 2tENESAS Page 313 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_SAUm Create Perf
228. tialization necessary to control the 16 bit timer RJO R_TMR_RJO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer RJO r_tmr_rjO_interrupt Performs processing in response to the timer interrupt R_TMR_RJO_Start Starts the count for 16 bit timer RJO R_TMR_RJO_Stop Ends the count for 16 bit timer RJO R_TMR_RJO_Set_PowerOff Halts the clock supplied to the 16 bit timer RJO R_TMR_RJO_Get_PulseWidth Reads the pulse width of the 16 bit timer RJO R20UT2684EJ0100 Rev 1 00 2tENESAS Page 134 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Create Performs initialization necessary to control the 16 bit timer RJO Syntax void R_TMR_RJO Create void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 135 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TMR_RJO_Create_Userlnit Performs user defined initialization relating to the 16 bit timer RJO Remark This API function is called as the R_TMR_RJO_ Create callback routine Syntax void R TMR RJO Create UserInit void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 136 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS r_tmr_rjO_interrupt Performs processing in response to the timer interrupt Remark This API function is called as the interrupt proce
229. 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 R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 201 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_RTC_Create Performs initialization necessary to control the real time clock Syntax void R_RTC_ Create void Argumenit s None Return value None R20UT2684EJ0
230. u items are displayed by right clicking the mouse Return to Reset Value The default settings of the selected node are restored Property Opens the Property panel corresponding to the selected node R20UT2684EJ0100 Rev 1 00 ztENESAS Page 45 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX A WINDOW REFERENCE Property panel This panel allows you to view the information on and change the setting for the node selected in the Project Tree panel Figure A 3 Property Panel Property x Pin Configurator Property e 4 Product Information VA AK AR AE Release date ddViiliiyyyy 4 Package Package type SP Version Pin configurator version information The following items are explained here How to open Description of each area Context menu How to open On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool and then select Property from the context menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin List and then select Property from the View menu On the Project Tree panel select Project name Project gt gt Pin Configurator Design Tool gt gt Device Pin Li
231. uite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_StackPointer_Stop Ends the CPU stack pointer function Syntax void R_CGC_StackPointer Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 114 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_ClockMonitor_Start Starts the clock monitor Syntax void R_CGC_ClockMonitor Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 115 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_CGC_ClockMonitor_Stop Ends the clock monitor Syntax void R_CGC_ClockMonitor Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 ztENESAS Page 116 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 3 Port functions Below is a list of API functions output by the Code Generator for port functions use Table C 3 API Functions Port Functions API Function Name Function R_PORT_Create Performs initialization necessary to control the port functions R_PORT_Create_Userlnit Performs user defined initialization relating to the port functions R20UT2684EJ0100 Rev 1 00 Sep 01 2013 ztENESAS Page 117 of 480 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_PORT_Create Performs initializ
232. uite V2 01 00 APPENDIX C 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 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 Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 413 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS C 2 29 Sound generator Below is a list of API functions output by the Code Generator for sound generator use Table C 29 API Functions Sound Generator API Function Name Function R_SG_Create Performs initialization necessary to control the sound generator R_SG_Create_Userlnit Performs user defined initialization relating to the sound generator r_sg_interrupt Performs processing in response to the threshold value detection of the loga rithmic decrement interrupt INTSG R_SG_Start Enables operation of sound generator R_SG_Stop Disables operation of sound generator R20UT2684EJ0100 Rev 1 00 2tENESAS Page 414 of
233. umber Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 128 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 129 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 130 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TAUm_Set_PowerOff void Remark mi
234. unctions provided by the design tool Pin Configurator along with operation proce dures Remark In this chapter an example where an RL78 G13 ROM 16KB R5F1006A 20pin is the target device is used to explain the key functions 2 1 Overview The Pin Configurator is used to output report files such as a device pin list and a device top view by entering pin assign ment information of the microcontroller The following sections describe the operation procedures for Pin Configurator 1 Start CubeSuite Launch CubeSuite from the Start menu of Windows Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Start CubeSuite 2 Create Open project Create a new project that defines a kind of project microcontroller to be used build tools to be used etc or load an existing project Remark See CubeSuite Integrated Development Environment User s Manual Start for details on Create Open project 3 Open Device Pin List Panel Open the Device Pin List panel where you enter information on the pins of the microcontroller a Select item Allows you to select items displayed in the device pin list b Change display order Allows you to change the order in which items are displayed in the device pin list c Add column Allows you to add columns to the device pin list d Delete column Allows you to delete columns from the device pin list 4 Open Device Top View Panel Open
235. upt 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 _ interrupt static void r_fmc_interrupt void Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 225 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_FMC _Siart Starts measurement of the frequency that uses the subsystem clock frequency measurement circuit Syntax void R_FMC_ Start void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 226 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_FMC_Stop Ends measurement of the frequency that uses the subsystem clock frequency measurement circuit Syntax void R_FMC_Stop void Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 227 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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
236. v 1 00 2tENESAS Page 320 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 _ interrupt static void r_uartn_interrupt_receive void j Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 321 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 __interrupt static void r_uartn_interrupt_error void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 322 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTn_Start Sets UART communication to standby mode Syntax void R_UARTn Start void Remark nis the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 323 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_UARTn_Stop Ends UART c
237. value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 125 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 R_TAUm_Channeln Higher8bits Start void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 126 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C 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 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 mis the unit number and n is the channel number Argumeni s None Return value None R20UT2684EJ0100 Rev 1 00 2tENESAS Page 127 of 480 Sep 01 2013 CubeSuite V2 01 00 APPENDIX C API FUNCTIONS R_TAUm_Channeln_Stop Ends the count for channel n Syntax void R_TAUm_Channeln Stop void Remark mis the unit number and n is the channel n
238. xt menu which is displayed by right clicking the mouse Figure 3 10 Change API Function Name Project Tree 8 fz g B ample Project 2 eij Generator Design Tool J RSFLOWMG Microcontroller a al Peripheral Functions a Y Code Preview i e Common B y r_cg_ main c m c K Timer KB20 Remarks 1 the context menu 2 Some API functions main etc can not be changed the API function name To restore the default name of the API function defined by the Code Generator select Default from R20UT2684EJ0100 Rev 1 00 Sep 01 2013 2tENESAS Page 32 of 480 CubeSuite V2 01 00 CHAPTER 3 FUNCTIONS Code Generator 3 5 4 Change output mode The Code Generator is used to change the output mode Do nothing if file exists Merge file Overwrite file for the source code by selecting Code Generator Setting tab gt gt Generate File Mode gt gt File generation control in the Prop erty panel Figure 3 11 Change Output Mode Property x 8 Code Generator Property e 4 Generate File Mode API output control Output all API functions according to the setting Output folder C imp sample Merge file Register files Report type Merge file Product Information Release date Version VA AK AR AK File generation control Selects the operation of file generation when the file of the same name exists already at the time of code generati
239. you to select which output mode to apply when using the pin in the output mode Define Name This area allows you to assign a user defined pin name to the pin Within 256 characters can be entered in the Define Name Description Displays the summary of function of the pin Recommend Connection for Displays instructions on how to handle the pin when it is not used Unused This column displays information only when the Free is selected in the Func tion column Attention Displays the precaution on using the pin Remarks 1 You cannot add information in the External Peripheral Name Connected Pins Pin Number Pin Name Description Recommend Connection for Unused and Attention columns because they contain fixed information 2 Ifthe Free in the Function column is changed to a specific pin name color of the corresponding pin in the Device Top View panel changes from the color representing the unused pins to the color representing the used pins selected by clicking Device Top View Settings tab gt gt Color in the Property panel 3 To move columns change the display order in the device pin list drag and drop the desired col umn to the desired location 4 To add the user s own column use the New Column dialog box which opens by pressing the New Column button in the Column Chooser dialog box which opens by pressing the Za button in the upper left corner of the device pin list
Download Pdf Manuals
Related Search
Related Contents
Notice Ecosalt BMSC Transcend JetFlash 110 256MB Green Manual de instrucciones Comedero automático TX4 Plus manual de usuario TVAC14010A D Bedienungsanleitung User guide F Notice d WR202_M_EN_FR_ES R7.indd Samsung HT-C350 Manuel de l'utilisateur Nxt Back User Manual Technical Service Guide - Allied HVAC Distributors Copyright © All rights reserved.
Failed to retrieve file