Home
Applilet3 Device Driver Configurator User`s Manual
Contents
1. R_RTC_Set_PowerOff Halts the clock supplied to the real time clock R_RTC_Set_HourSystem Sets the clock type 12 hour or 24 hour clock of the real time clock R_RTC_Set_CounterValue Sets the counter value year month weekday day hour minute second of the real time clock R_RTC_Get_CounterValue Reads the counter value year month weekday day hour minute second of the real time clock R_RTC_Set_ConstPeriodInterruptOn Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function R_RTC_Set_ConstPeriodInterruptOff Ends the cyclic interrupt function r_ttc_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 Interval Timer R_IT_Create Performs initialization necessary to control interval timer functions R_IT_Create_UserInit Performs user defined initialization r
2. r_cg_dmac c Syntax void R_DMACn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 246 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DMACn _Set_SoftwareTriggerOn Starts DMA transfer when DMA operation is enabled Classification r_cg_dmac c Syntax void R_DMACn_Set_SoftwareTriggerOn void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 247 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 16 Voltage Detector Below is a list of API functions output by the Applilet3 for voltage detector use Table 3 17 API Functions Voltage Detector API Function Name Function R_LVD_Create Performs initialization necessary to control voltage detector functions 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 interrupt mode and interrupt amp reset mode R20UT0758EJ0100 Rev 1 00 2tENESAS Page 248 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_LVD_Create Performs initialization necessary to control voltage detector functions Classification r_cg_lvd c Syntax
3. Remark nis the output pin Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 227 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PCLBUZn _Create_Userlnit Performs user defined initialization relating to the clock buzzer output control circuits Remark This API function is called as the R_PCLBUZn_Create callback routine Classification r_cg_pclbuz_user c Syntax void R_PCLBUZn_Create_UserInit void Remark nis the output pin Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 228 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PCLBUZn_Start Starts clock buzzer output Classification r_cg_pclbuz c Syntax void R_PCLBUZn_Start void Remark nis the output pin Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 229 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PCLBUZn_Stop Ends clock buzzer output Classification r_cg_pclbuz c Syntax void R_PCLBUZn_Stop void Remark nis the output pin Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 230 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 13 Data Transfer Controller Below is a list of API functions output by the Applilet3 for data transfer controller use
4. o mwe o oo o SOS uint16_t rx data Receive data greater than the parameter rx_num specified for R_DALIn_Receive Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 94 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Create Performs initialization of the serial interface IICA 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 Classification r_cg_serial c Syntax void R_IICAn_Create void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 95 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Create_Userlnit Performs user defined initialization of the serial interface IICA Remark This API function is called as the R_IICAn_Create callback routine Classification r_cg_serial_user c Syntax void R_IICAn_Create_UserInit void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 96 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_interrupt Performs processing in response to the IICA communication end interrupt INTIICAn Remark This API function is called as the interrupt process corresponding to the IICA communication end interrupt INTIICAn Classification
5. Remark See the header file r_cg_adc h for details about the analog voltage input pin ADCHANNELn Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 2tENESAS Page 121 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_ Set _SnoozeOn Enables the switch from STOP mode to SNOOZE mode Classification r_cg_adc c Syntax void R_ADC_Set_SnoozeOn void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 122 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode Classification r_cg_adc c Syntax void R_ADC_Set_SnoozeOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 123 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_ Set_TestChannel Sets the operaiton mode of A D converter Classification r_cg_adc c Syntax include r_cg_macrodriver h include r_cg_adc h MD_STATUS R_ADC_Set_TestChannel test_channel_t channel Argument s Argument Description 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 MD_OK Normal comp
6. r_cg_serial_user c Syntax interrupt static void r_iican_interrupt void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 97 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_StopCondition Generates stop conditions Classification r_cg_serial c Syntax void R_IICAn_StopCondition void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 98 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Stop Ends IICA communication Classification r_cg_serial c Syntax void R_IICAn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 99 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Set_PowerOff Halts the clock supplied to the serial interface IICA Remark Calling this API function changes the serial interface IICA to reset status For this reason writes to the control registers e g IICA control register n IICCTLn after this API function is called are ignored Classification r_cg_serial c Syntax void R_IICAn_Set_PowerOff void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev
7. void R_LVD_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 249 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_lvd_user c Syntax void R_LVD_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 250 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_lvd_interrupt Performs processing in response to the voltage detection interrupt INTLVI Remark This API function is called as the interrupt process corresponding to the voltage detection interrupt INTLVI Classification r_cg_lvd_user c Syntax __interrupt static void r_lvd_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 251 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_LVD_InterruptMode_Start Starts voltage detection when in interrupt mode and interrupt amp reset mode Classification r_cg_lvd c Syntax void R_LVD_InterruptMode_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 252 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3
8. Classification r_cg_timer c Syntax void R_TMR_RDn_ForcedOutput_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 156 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_Get_PulseWidth Reads the pulse width of the 16 bit timer RDn Remarks 1 This API function can only be called when the 16 bit timer RDn is being used for input capture function 2 If there is an overflow 2 pulses or more during pulse width measurement then the pulse width will not be read correctly Classification r_cg_timer c Syntax include r cg _macrodriver h g include r cg _timer h MD_STATUS R_TMR_RDn_Get_PulseWidth uint32_t active_width uint32_t inactive_width timer_channel_t channel Remark nis the channel number Argument s 1 0 Argument Description uint32_t active_width Pointer to an area storing the active level width that was read uint32_t inactive_width Pointer to an area storing the inactive level width that was read l timer_channel_t channel Pin to read TMCHANNELA TRDIOAn pin TMCHANNELB TRDIOBn pin TMCHANNELC TRDIOCn pin TMCHANNELD TRDIODn pin Return value MD_OK Normal completion R20UT0758EJ0100 Rev 1 00 2tENESAS Page 157 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RGO_Create Performs initialization necessar
9. None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 104 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_master_error Performs processing in response to detection of IICA master communication error Classification r_cg_serial_user c Syntax include Yr cg _macrodriver h static void r_iican_callback_master_error MD_STATUS flag Remark nis the channel number Argument s VO Argument Description l MD_STATUS flag Cause of communication error MD_SPT Stop condition detected MD_NACK Acknowledge not detected Return value None R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 105 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Slave_Send Starts IICA slave transmission Remark This API function repeats the byte level IICA slave transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num Classification r_cg_serial c Syntax include r cg _macrodriver h void R_IICAn_Slave_Send uint8_t tx buf uint1l6_t tx_num Remark nis the channel number Argumenit s VO Argument Description uint8_t tx_buf Pointer to a buffer storing the transmission data l uintl6_t tx num Total amount of data to send Return value None R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 106 of 267 Applilet3 CHAPTER 3 API FUNCTIONS
10. Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 80 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iicmn_callback_master_receiveend Performs processing in response to the simple IIC mn master reception end interrupt INTIIC mn 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_IICmn_Masiter_Receive parameter rx_num has been completed Classification r_cg_serial_user c Syntax Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 81 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iicmn_callback_master_error Performs processing in response to detection of parity error ACK error Classification r_cg_serial_user c Syntax include Yr cg _macrodriver h static void r_iicmn_callback_master_error MD_STATUS flag Remark mis the unit number and nis the channel number Argument s 1 0 Argument Description O MD_STATUS flag Cause of communication error MD_NACK Acknowledge not detected Return value None R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 82
11. 105 iican_callback_master_receiveend 104 a iican_callback_master_sendend 103 iican_callback_slave_error 110 iican_callback_slave_receiveend 109 iican_callback_slave_sendend 108 R_IICAn_Create 95 R_IICAn_Create_Userlnit 96 r_iican_interrupt 97 R_IICAn_Master_Receive 102 R_lIICAn_Master_Send 101 R_IICAn_Set_PowerOff 100 R_IICAn_Slave_Receive 107 R_IICAn_Slave_Send 106 R_IICAn_Stop 99 R_IICAn_StopCondition 98 r_licmn_callback_master_error 82 r_iicmn_callback_master_receiveend 81 r_iicmn_callback_master_sendend 80 R_IICmn_Create 73 r_iicmn_interrupt 74 R_lICmn_Master_Receive 79 R_IICmn_Master_Send 78 R_IICmn_StartCondition 75 R_IICmn_Stop 77 R_IICmn_StopCondition 76 R_INTC_Create 33 R_INTC_Create_Userlnit 34 r_intcn_interrupt 35 R_INTCn_Start 36 R_INTCn_Stop 37 R_IT_ Create 213 R_IT_Create_Userlnit 214 r_it_interrupt 215 R_IT_Set_PowerOff 218 R_IT_Start 216 R_IT_Stop 217 R_KEY_Create 38 R_KEY_Create_Userlnit 39 r_key_interrupt 40 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 260 of 267 Applilet3 R_KEY_Start 41 R_KEY_Stop 42 R_LVD_Create 249 R_LVD_Create_Userlnit 250 r_lvd_interrupt 251 R_LVD_InterruptMode_Start 252 R_PCLBUZn_ Create 227 R_PCLBUZn_Cr
12. Disables the switch from STOP mode to SNOOZE mode R_UARTn_Create Performs initialization of the serial interface UART channel r_uartn_interrupt_send Performs processing in response to the UART transmission end interrupt INTSTn r_uartn_interrupt_receive Performs processing in response to the UART reception end interrupt INTSRn r_uartn_interrupt_error Performs processing in response to the reception error interrupt INTSREn R_UARTn_ Start Sets UART communication to standby mode R_UARTn_Stop Ends UART communication R_UARTn_Send Starts UART data transmission R_UARTn_Receive Starts UART data reception r_uartn_callback_sendend Performs processing in response to the UART trans mission end interrupt INTSTn r_uartn_callback_receiveend Performs processing in response to the UART recep tion cend 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 of the serial interface CSI chan nel r_csimn_interrupt Performs processing in response to the CSI communication end interrupt INTCSImn R_CSImn_Start Sets CSI communication to standby mode R_CSImn_Stop Ends CSI communication R_CSImn_Send Starts CSI data transmiss
13. None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 173 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_tmr_kbm_interrupt Performs processing in response to the timer interrupt Remark This API function is called as the interrupt process corresponding to the timer interrupt Classification r_cg_timer_user c Syntax interrupt static void r_tmr_kbm_interrupt void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 174 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KB m Start Starts the count for 16 bit timer KBm Classification r_cg_timer c Syntax void R_TMR_KBm_Start void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 175 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KBm_Stop Ends the count for 16 bit timer KBm Classification r_cg_timer c Syntax void R_TMR_KBm_Stop void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 176 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KBm _Set_PowerOff Halts the clock supplied to the 16 bit timer KBm Remark Calling this API function changes the 16 bit timer KBm to reset status For this reason writes to the control
14. Performs processing in response to the key interrupt INTKR R_KEY_ Start Enables the acceptance of the key interrupts INTKR R_KEY_Stop Disables the acceptance of the key interrupts INTKR R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 32 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_INTC_Create Performs initialization necessary to control the external maskable interrupt INTPn functions Classification r_cg_intc c Syntax void R_INTC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 33 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_INTC_Create_Userlnit Performs user defined initialization relating to the external maskable interrupt INTPn functions Remark This API function is called as the R_INTC_ Create callback routine Classification r_cg_intc_user c Syntax void R_INTC_Create_UserInit void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 34 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS Performs processing in response to the external maskable interrupt INTPn Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTPn Classification r_cg_intc_user c Syntax __interrupt static void rinten_interrupt void Remark nis the interrupt factor number A
15. R_CGC _Create Performs initialization required to control the clock generator on chip debug and etc Classification r_CQg_cgc c Syntax void R_CGC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 24 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CGC _Create_Userlnit Performs user defined initialization relating to the clock generator on chip debug and etc Remark This API function is called as the R_CGC_Create callback routine Classification r_cg_cgc_user c Syntax void R_CGC_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 25 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CGC_Get_ResetSource Performs processing in response to RESET signal Classification r_cg_cgc_user c Syntax void R_CGC_Get_ResetSource void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 26 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CGC_Set_ClockMode Changes the CPU clock peripheral hardware clock Classification f_Cg_cgc c Syntax include r cg _macrodriver h include yr og cge h MD_STATUS R_CGC_Set_ClockMode clock_mode_t mode Argument s 1 0 Argument Description l clock_mode_t mode Clock generator type HIOCLK
16. 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 parameter rx_num and stores the data in the buffer specified by the parameter rx_buf Classification r_cg_serial c Syntax include r cg _macrodriver h void R_IICAn_Slave_Receive uint8_t rx buf uint1l6_t rx_num Remark nis the channel number Argumenit s 1 0 Argument Description O uint8_t rx_buf Pointer to a buffer to store the received data l uintl6_t rx_ num Total amount of data to receive Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 107 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_slave_sendend Performs processing in response to the IICA slave transmission end interrupt INTIICAn Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA slave transmission end interrupt INTIICAn Classification r_cg_serial_user c Syntax static void r_iican_callback_slave_sendend void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 108 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_slave_receiveend Performs processing in response to the IICA slave reception end interrupt IN
17. Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 149 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer_user c Syntax void R_TMR_RDn_Create_UserInit void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 150 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_tmr_rdn_interrupt Performs processing in response to the timer interrupt Remark This API function is called as the interrupt process corresponding to the timer interrupt Classification r_cg_timer_user c Syntax interrupt static void r_tmr_rdn_interrupt void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 151 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn Start Starts the count for 16 bit timer RDn Classification r_cg_timer c Syntax void R_TMR_RDn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 152 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_ Stop Ends the count for 16 bit ti
18. uint8_t rx buf uintl6_t rx_num Remark mis the unit number and nis the channel number Argument s uint8_t rx_buf Pointer to a buffer to store the received data uintl6_t rx_ num Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 68 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Send_Receive Starts CSI data transmission reception Remarks 1 This API function repeats the byte level CSI transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num 2 This API function performs byte level CSI reception the number of times specified by the parameter tx_num and stores the data in the buffer specified by the parameter rx_bur 3 When performing a CSI reception R_CS Imn_Start must be called before this API function is called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_CSImn_Send_Receive uint8_t tx buf uintl6_t tx num uint8_t rx buf Remark mis the unit number and nis the channel number Argumenit s 1 0 Argument Description l uint8_t tx_buf Pointer to a buffer storing the transmission data l uintl6_t tx num Total amount of data to send receive O uint8_t rx buf Pointer to a buffer to store the received data Return
19. 180 R_TMR_KCO_Create_Userlnit 181 r_tmr_kcO_interrupt 182 R_TMR_KCO_Set_PowerOff 185 R_TMR_KCO_Start 183 R_TMR_KCO_Stop 184 R_TMR_RDn_Create 149 R_TMR_RDn_Create_Userlnit 150 R_TMR_RDn_ForcedOutput_Start 155 R_TMR_RDn_ForcedOutput_Stop 156 R_TMR_RDn_Get_PulseWidth 157 r_tmr_rdn_interrupt 151 R_TMR_RDn_Set_PowerOff 154 R_TMR_RDn_Start 152 R_TMR_RDn_Stop 153 R_TMR_RGO_Create 158 R_TMR_RGO_Create_Userlnit 159 R_TMR_RGO_Get_PulseWidth 164 r_tmr_rgO_interrupt 160 R_TMR_RGO_Set_PowerOff 163 R_TMR_RGO_Start 161 R_TMR_RGO_Stop 162 R_TMR_RJO_Create 165 R_TMR_RJO_Create_Userlnit 166 R_TMR_RJO_Get_PulseWidth 171 r_tmr_rjO_interrupt 167 R_TMR_RJO_Set_PowerOff 170 R_TMR_RJO_Start 168 R_TMR_RJO_Stop 169 R_TAUm_Channeln_Higher8bits_ Start 141 Voltage Detector 248 R_LVD_ Create 249 R_LVD_InterruptMode_Start 252 R_LVD_Create_Userlnit 250 r_lvd_interrupt 251 Watchdog Timer 186 R_WDT_Create 187 R_WDT_Create_Userlnit 188 r_wdt_interrupt 189 R_WDT_Restart 190 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 263 of 267 Revision Record Description Oct 01 2011 2 9 First Edition issued Applilet3 User s Manual RL78 API Reference Publication Date Rev 1 00 Oct 01 2011 Published by Renesas Electronics Corporation 2
20. CENESAS C n D ms n lt A 5 D Applilet3 Device Driver Configurator User s Manual RL78 API Reference Target Device RL78 Family All information contained in these matenals 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 Awww renesas com Renesas Electronics www renesas com Rev 1 00 Oct 2011 8 10 11 12 Notice All information included in this document is current as of the date this document is issued Such information however is subject to change without any prior notice Before purchasing or using any Renesas Electronics products listed herein please confirm the latest product information with a Renesas Electronics sales office Also please pay regular and careful attention to additional and different information to be disclosed by Renesas Electronics such as that disclosed through our website 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 here
21. Function Performs processing in response to the IICA communication end interrupt INTIICAn R_IICAn_StopCondition Generates stop conditions R_IICAn_Stop Ends IICA communication R_IICAn_Set_PowerOff Halts the clock supplied to the serial interface IICA R_IICAn_Master_Send Starts IICA master transmission R_IICAn_Master_Receive Starts IICA master reception r_iican_callback_master_sendend Performs processing in response to the IICA master transmission end interrupt INTIICAn r_iican_callback_master_receiveend Performs processing in response to the IICA master reception end interrupt INTIICAn r_iican_callback_master_error Performs processing in response to detection of IICA master communication error R_IICAn_Slave_Send Starts IICA slave transmission R_IICAn_Slave_Receive Starts IICA slave reception r_iican_callback_slave_sendend Performs processing in response to the IICA slave transmission end interrupt INTIICAn r_iican_callback_slave_receiveend Performs processing in response to the IICA slave reception end interrupt INTIICAn r_iican_callback_slave_error Performs processing in response to detection of IICA slave communication error r_iican_callback_getstopcondition Performs processing in response to detection of stop condition A D Converter R20UT0758EJ0100 Rev 1 00 Oct 01 2011 R_ADC_Create Pe
22. R_DTC_Create Performs initialization necessary to control the data transfer controller functions R_DTC_Create_Userlnit Performs user defined initialization relating to the data transfer controller R_DTCn_Start Enables operation of the data transfer controller R_DTCn_Stop Disables operation of the data transfer controller R_DTC_Set_PowerOff Halts the clock supplied to the data transfer controller Event Link Controller R_ELC_ Create Performs initialization necessary to control the event link controller functions R_ELC_Create_UserInit Performs user defined initialization relating to the event link controller R_ELC_Stop Disables operation of the event link controller DMA Controller R20UT0758EJ0100 Rev 1 00 Oct 01 2011 R_DMACn_Create Performs initialization necessary to control DMA con troller functions R_DMACn_Create_Userlnit Performs user defined initialization relating to the DMA controller r_dmacn_interrupt This API function is called as the interrupt process cor responding to the interval interrupt INTWDTI R_DMACn_ Start Enables operation of channel n R_DMACn_ Stop Disables operation of channel n R_DMACn_Set_SoftwareTriggerOn Starts DMA transfer when DMA operation is enabled ztENESAS Page 19 of 267 Applilet3 CHAPTER 3 API FUNCTIONS Peripheral Function API Function Name Function Voltage Detector R_LV
23. R_TMR_KBm_Create_Userlnit 173 R_TMR_KBm_ForcedOutput_Start 178 R_TMR_KBm_ForcedOutput_Stop 179 r_tmr_kom_interrupt 174 R_TMR_KBm_Set_PowerOff 177 R_TMR_KBm_Start 175 R_TMR_KBm_Stop 176 R_TMR_KCO_Create 180 R_TMR_KCO_Create_Userlnit 181 r_tmr_kcO_interrupt 182 R_TMR_KCO_Set_PowerOff 185 R_TMR_KCO_Start 183 R_TMR_KCO_Stop 184 R_TMR_RDn_Create 149 R_TMR_RDn_Create_Userlnit 150 R_TMR_RDn_ForcedOutput_Start 155 R_TMR_RDn_ForcedOutput_Stop 156 R_TMR_RDn_Get_PulseWidth 157 r_tmr_rdn_interrupt 151 R_TMR_RDn_Set_PowerOff 154 R_TMR_RDn_Start 152 R_TMR_RDn_Stop 153 R_TMR_RGO_Create 158 R_TMR_RGO_Create_Userlnit 159 R_TMR_RGO_Get_PulseWidth 164 r_tmr_rgO_interrupt 160 R_TMR_RGO_Set_PowerOff 163 R_TMR_RGO_Start 161 ztENESAS Page 261 of 267 Applilet3 APPENDIX A INDEX R_TMR_RGO_Stop 162 R_TMR_RJO_Create 165 R_TMR_RJO_Create_Userlnit 166 R_TMR_RJO_Get_PulseWidth 171 r_tmr_rjO_interrupt 167 R_TMR_RJO_Set_PowerOff 170 R_TMR_RJO_Start 168 R_TMR_RJO_Stop 169 r_uartn_callback_error 61 r_uartn_callback_receiveend 60 r_uartn_callback_sendend 59 r_uartn_callback_softwareoverrun 62 R_UARTn_Create 51 r_uartn_interrupt_error 54 r_uartn_interrupt_receive 53 r_uartn_interrupt_send 52 R_UARTn_Receive 58 R_UARTn_Send 57 R_UAR
24. 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 Classification r_cg_adc c Syntax void R_ADC_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 119 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Set_PowerOff Halts the clock supplied to the A D converter Remark Calling this API function changes the A D converter to reset status For this reason writes to the control reg isters after this API function is called are ignored Classification r_cg_adc c Syntax void R_ADC_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 120 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Set_ADChannel Configures the analog voltage input pin for A D conversion Remark The value specified in parameter channel is set to analog input channel specification register ADS Classification r_cg_adc c Syntax include yr cg_macrodriver h include n cg_adc h MD_STATUS R_ADC_Set_ADChannel ad_channel_t channel Argumenit s VO Argument Description ad_channel_t channel Analog voltage input pin ADCHANNELn Input pin
25. hour minute Remark Below is shown the structure rtc_alarm_value_t alarm conditions typedef struct uint8_t Alarmwm Minute uint8_t Alarmwh Hour uint8_t Alarmww Weekday rtc_alarm_value_t Alarmwm Minute Below are shown the meanings of each bit of the structure member Alarmwm BCD code minute digit 1 BCD code minute digit 10 0 Fixed Alarmwh Hour Below are shown the meanings of each bit of the structure member Alarmwh If the real time clock is set to the 12 hour clock then bit 5 has the following meaning 0 AM 1 PM R20UT0758EJ0100 Rev 1 00 2tENESAS Page 206 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS BCD code hour digit 1 BCD code hour digit 10 00 Fixed Alarmww Weekday Below are shown the meanings of each bit of the structure member Alarmww 7 6 5 4 3 2 1 0 1 Sunday 1 Monday 1 Tuesday 1 Wednesday 1 Thursday 1 Friday 1 Saturday 0 Fixed Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 207 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Get_AlarmValue Reads the alarm conditions weekday hour minute Classification r_cg_rtc c Syntax include r cg _macrodriver h include yr ogurto h void R_RTC_Get_AlarmValue rtc_alarm_
26. keppel Bay Tower Singapore 098632 Tel 65 6213 0200 Fax 65 6278 8001 Renesas Electronics Malaysia Sdn Bhd Unit 906 Block B Menara Amcorp Amcorp Trade Centre No 18 Jin Persiaran Barat 46050 Petaling Jaya Selangor Darul Ehsan Malaysia 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 2011 Renesas Electronics Corporation All rights reserved Colophon 1 1 Applilet3 7rCENESAS Renesas Electronics Corporation R20UT0758EJ0100
27. r cg _macrodriver h static void r_uartn_callback_error uint8_t err_type Remark nis the channel number Argumenit s 1 0 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 61 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_callback_softwareoverrun Performs processing in response to detection of overrun error Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_receive correspond ing to the UART reception end interrupt INTSRn process performed when the amount of data received is greater than the parameter rx_num specified for R_UARTn_Receive Classification r_cg_serial_user c Syntax include r cg _macrodriver h g static void r_uartn_callback_softwareoverrun uintl6_t rx data Remark nis the channel number Argument s o Ammen Cn uintl6_t rx data Receive data greater than the parameter rx_num specified for R_UARTn_Receive Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 62 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Create Performs initialization of the serial interface CSI channel Remark This API function is used as an internal function of R_SAUm_Create For this rea
28. r_cg_intc_user c Syntax void R_KEY_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 39 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_key_interrupt Performs processing in response to the key interrupt INTKR Remark This API function is called as the interrupt process corresponding to the key interrupt INTKR Classification r_cg_intc_user c Syntax __interrupt static void r_key_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 40 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_KEY_Siart Enables the acceptance of the key interrupts INTKR Classification r_cg_intc c Syntax void R_KEY_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 41 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_KEY_Stop Disables the acceptance of the key interrupts INTKR Classification r_cg_intc c Syntax void R_KEY_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 42 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 4 Serial Below is a list of API functions output by the Applilet3 for serial array unit and serial interface use Table 3 5 API Functions Serial API Function
29. 1 00 2tENESAS Page 100 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICAn_Master_Send Starts IICA master transmission Remark This API function repeats the byte level IICA master transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_IICAn_Master_Send uint8_t adr uint8_t tx buf uintl6_t tx_ num uint8_t wait i Remark nis the channel number Argument s 1 vintse exes o Pointer to a buffer storing the transmission data Return value MD_OK Normal completion MD_ERROR1 Bus communication status MD_ERROR2 Bus not released status R20UT0758EJ0100 Rev 1 00 2tENESAS Page 101 of 267 Oct 01 2011 Applilet3 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 parameter CHAPTER 3 API FUNCTIONS rx_num and stores the data in the buffer specified by the parameter rx_buf Classification r_cg_serial c Syntax include r cg _macrodriver h g wait MD_STATUS R_IICAn_Master_Receive uint8_t adr uint8_t rx buf uint1l6_t rx num uint8_t Remark nis the channel number Argument s Argument uint8_t Description Slave address uint8_t Pointer to a buffer to store the receive
30. 17 Programmable Gain Amplifier Below is a list of API functions output by Applilet3 for programmable gain amplifiers use Table 3 18 API Functions Programmable Grain Amplifier API Function Name Function R_PGA_Create Performs initialization necessary to control programmable gain amplifiers functions R_PGA_Create_UserInit Performs user defined initialization relating to the programmable gain amplifiers R_PGA_Start Starts the operation of programmable gain amplifier R_PGA_Stop Ends the operation of programmable gain amplifier R20UT0758EJ0100 Rev 1 00 2tENESAS Page 253 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PGA_Create Performs initialization necessary to control programmable gain amplifiers functions Classification r_cg_pga c Syntax void R_PGA_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 254 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PGA_Create_Userlnit Performs user defined initialization relating to the programmable gain amplifiers Remark This API function is called as the R_PGA_Create callback routine Classification r_CQg_pga_user c Syntax void R_PGA_Create_UserInit void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 255 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PGA_Start Starts
31. CHAPTER 3 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 Classification r_cg_timer_user c Syntax void R_TMR_KCO_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 181 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer_user c Syntax __interrupt static void r_tmr_kcO_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 182 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KCO_Siart Starts the count for 16 bit timer KCO Classification r_cg_timer c Syntax void R_TMR_KCO_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 183 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KCO_Stop Ends the count for 16 bit timer KCO Classification r_cg_timer c Syntax void R_TMR_KCO_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 184 of
32. 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 Renesas Electronics products are classified according to the following three quality grades Standard High Quality and Specific The recommended applications for each Renesas Electronics product depends on the product s quality grade as indicated below 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 categorized as Specific without the prior written consent of Renesas Electronics Further you may not use any Renesas Electronics product for any application for which it is not intended without the prior written consent of Renesas Electronics 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 an application categorized as Specific or for which the product is not intended where you have failed to obtain the prior written consent of Renesas Electronics The quality grade of each Renesas Electronics product is Standard unless otherwise expressly specified in a Renesas Electronics data sheets or data books etc Standard Computers office equipme
33. High speed onchip oscillator SYSX1CLK X1 clock SUBXT1CLK XT1 clock SYSEXTCLK External main system clock SUBEXTCLK External subsystem clock Return value MD_OK Normal completion Description 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 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 27 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_CGC_Set_CRCOn Starts the CRC operation function Classification r_CQg_cgc c Syntax void R_CGC_Set_CRCOn void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 28 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 2 Port Below is a list of API functions output by the Applilet3 for port use Table 3 3 API Functions Port R_PORT_Create Performs initialization necessary to control port functions R_PORT_Create_Userlnit Performs user defined initialization relating to the port R20UT0758EJ0100 Rev 1 00 ztENESAS Page 29 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PORT_Create Performs initialization necessary to control port functions Classification r_cg_port c Syntax void R_PORT_Create void Argument s None Retur
34. Name Function R_SAUm_Create Performs initialization necessary to control the serial array unit and serial inter face functions R_SAUm_Create_Userlnit Performs user defined initialization related to the serial array unit and serial interface functions 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 of the serial interface UART channel r_uartn_interrupt_send Performs processing in response to the UART transmission end interrupt INTSTn r_uartn_interrupt_receive Performs processing in response to the UART reception end interrupt INTSRn r_uartn_interrupt_error Performs processing in response to the reception error interrupt INTSREn R_UARTn_Start Sets UART communication to standby mode R_UARTn_Stop Ends UART communication R_UARTn_Send Starts UART data transmission R_UARTn_Receive Starts UART data reception r_uartn_callback_sendend Performs processing in response to the UART transmission end interrupt INTSTn r_uartn_callback_receiveend Performs processing in response to the UART reception end interrupt INTSRn r_uartn_callback_error Performs processing in response to the UART reception error interrupt INTSREn r_uar
35. R_TMR_RJO_Create Performs initialization necessary to control the 16 bit timer RJO functions 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 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 Starts the count for 16 bit timer RJO ztENESAS Page 134 of 267 Applilet3 CHAPTER 3 API FUNCTIONS API Function Name Function 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 R_TMR_KB_Create Performs initialization necessary to control the 16 bit timer KBm functions R_TMR_KBm_Create_UserInit Performs user defined initialization relating to the 16 bit timer KBm r_tmr_kbm_interrupt Performs processing in response to the timer interrupt R_TMR_KBm_Start Starts the count for 16 bit timer KBm R_TMR_KBm_Stop Ends the count for 16 bit timer KBm R_TMR_KBm_Set_PowerOff Halts the clock supplied to the 16 bit timer KBm R_TMR_KBm_ForcedOutput_Start Enables input of the trigger signal used for the forced output stop function R_TMR_KBm_ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop function R_TMR_KCO_Create Performs initialization necessary to control the 16 bit
36. of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DALIn_Create Performs initialization of the serial interface DALI channel 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 Classification r_cg_serial c Syntax void R_DALIn_Create void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 83 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_interrupt_send Performs processing in response to the DALI transmission end interrupt INTSTDLn Remark This API function is called as the interrupt process corresponding to the DALI transmission end interrupt INTSTDLn Classification r_cg_serial_user c Syntax __interrupt static void r_dalin_interrupt_send void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 84 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_interrupt_receive Performs processing in response to the DALI reception end interrupt INTSRDLn Remark This API function is called as the interrupt process corresponding to the DALI reception end interrupt INTSRDLn Classification r_cg_serial_user c Syntax __interrupt static void r_dalin_interrupt_receive void
37. 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 INTIICmn Classification r_cg_serial_user c Syntax __interrupt static void r_iicmn_interrupt void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 74 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICmn_StartCondition Generates start conditions Remark This API function is used as an internal function of R_ Cmn_Master_Send and R_ ICmn_Master_Receive For this reason there is normally no need to call it from a user program Classification r_cg_serial c Syntax void R_IICmn_StartCondition void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 75 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICmn_StopCondition Generates stop conditions Classification r_cg_serial c Syntax void R_IICmn_StopCondition void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 76 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_
38. reset status For this reason writes to the control registers after this API function is called are ignored Classification r_cg_serial c Syntax void R_SAUm_Set_PowerOff void Remark mis the unit number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 48 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_SAUm Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode Classification r_cg_serial c Syntax void R_SAUm_Set_SnoozeOn void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 49 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_SAUm Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode Classification r_cg_serial c Syntax void R_SAUm_Set_SnoozeOff void Remark mis the unit number Argumeni s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 50 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_UARTn_Create Performs initialization of the serial interface UART channel 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 Classification r_cg_serial c Syntax void R_UARTn_Create void Remark nis the channel number Argument
39. s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 51 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_interrupt_send Performs processing in response to the UART transmission end interrupt INTSTn Remark This API function is called as the interrupt process corresponding to the UART transmission end interrupt INTSTn Classification r_cg_serial_user c Syntax __interrupt static void r_uartn_interrupt_send void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 52 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_interrupt_receive Performs processing in response to the UART reception end interrupt INTSRn Remark This API function is called as the interrupt process corresponding to the UART reception end interrupt INTSRn Classification r_cg_serial_user c Syntax __interrupt static void r_uartn_interrupt_receive void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 53 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_interrupt_error Performs processing in response to the reception error interrupt INTSREn Remark This API function is called as the interrupt process corresponding to the reception error interrupt INTSREn Classificatio
40. the DMA controller Remark This API function is called as the R_DMACn_Create callback routine Classification r_cg_dmac_user c Syntax void R_DMACn_Create_UserInit void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 243 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dmacn_interrupt Performs processing in response to the DMA transfer end interrupt INTDMAn Remark This API function is called as the interrupt process corresponding to the DMA transfer end interrupt INTDMAn Classification r_cg_dmac_user c Syntax interrupt static void r_dmacn_interrupt void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 244 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DMACn Start Enables operation of channel n Classification r_cg_dmac c Syntax void R_DMACn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 245 of 267 Applilet3 CHAPTER 3 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 Classification
41. the operation of programmable gain amplifier Classification r_cg_pga c Syntax void R_PGA_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 256 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PGA_Stop Ends the operation of programmable gain amplifier Classification r_cg_pga c Syntax void R_PGA_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 257 of 267 Oct 01 2011 Applilet3 APPENDIX A INDEX A A D Converter 112 R_ADC Create 113 R_ADC_Create_Userlnit 114 R_ADC_Get_Result 125 R_ADC_Get_Result_8bit 126 r_adc_interrupt 115 R_ADC_Set_ADChannel 121 R_ADC_Set_OperationOff 117 R_ADC_Set_OperationOn 116 R_ADC_Set_PowerOff 120 R_ADC_Set_SnoozeOff 123 R_ADC_Set_SnoozeOn 122 R_ADC_Set_TestChannel 124 R_ADC_Start 118 R_ADC_Stop 119 API functions 12 A D Converter 112 Clock Generator 23 Clock Output Buzzer Output 226 Comparator 219 D A Converter 127 Data Transfer Controller 231 DMA Controller 241 Event Link Controller 237 Interrupt 32 Interval Timer 212 Port 29 Programmable Gain Amplifier 253 Real time Clock 191 Serial 43 Timer 134 Voltage Detector 248 Watchdog Timer 186 Cc Clock Generator 23 R
42. timer KCO functions R_TMR_KCO_Create_UserInit 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 135 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm Create Performs initialization necessary to control timer array unit functions Classification r_cg_timer c Syntax void R_TAUm_Create void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 136 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Create_UserlInit Performs user defined initialization relating to the timer array unit Remark This API function is called as the R_TAUm_ Create callback routine Classification r_cg_timer_user c Syntax void R_TAUm_Create_UserInit void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 137 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_taum_channeln_interrupt Performs processing in response to the timer interrupt INTTMmn Remark This API function is
43. 00 Rev 1 00 2tENESAS Page 187 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_wdt_user c Syntax void R_WDT_Create_UserInit void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 188 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_wdt_interrupt Performs processing in response to the interval interrupt INTWDTI of watchdog timer Remark This API function is called as the interrupt process corresponding to the interval interrupt INTWDTI Classification r_cg_wdt_user c Syntax __interrupt static void r_wdt_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 189 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_WDT_Restart Clears the watchdog timer counter and resumes counting Classification r_cg_wdt c Syntax void R_WDT_Restart void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 190 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 9 Real time Clock Below is a list of API functions output by the Applilet3 for real time clock use Table 3 10 API Functions Real time Clock API Fun
44. 01 2011 Page 111 of 267 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 5 A D Converter Below is a list of API functions output by the Applilet3 for A D converter use Table 3 6 API Functions A D Converter API Function Name Function R_ADC_Create Performs initialization necessary to control A D converter functions R_ADC_Create_UserInit Performs user defined initialization relating to the A D converter r_adc_interrupt Performs processing in response to the A D conversion end interrupt INTAD R_ADC_Set_OperationOn Enables operation of voltage converter R_ADC_Set_OperationOff Disables operation of voltage converter R_ADC_ Start Starts A D conversion R_ADC_Stop Ends A D conversion R_ADC_Set_PowerOff Halts the clock supplied to the A D converter R_ADC_Set_ADChannel Configures the analog voltage input pin for A D conversion R_ADC_Set_SnoozeOn Enables the switch from STOP mode to SNOOZE mode R_ADC_Set_SnoozeOff Disables the switch from STOP mode to SNOOZE mode R_ADC_Set_TestChannel Sets the operaiton mode of A D converter R_ADC_Get_Result Reads the results of A D conversion 10 bit R_ADC_Get_Result_8bit R20UT0758EJ0100 Rev 1 00 Oct 01 2011 Reads the results of A D conversion 8 bits most significant 8 bits of 10 bit res olution 2tENESAS Page 112 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC Create Perfo
45. 0x0 to OxFF Return value None R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 133 of 267 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 7 Timer Below is a list of API functions output by the Applilet3 for timer array unit and timer use Table 3 8 API Functions Timer API Function Name Function R_TAUm_Create Performs initialization necessary to control timer array unit functions R_TAUm_Create_Userlnit 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 1 or channel 3 R_TAUm_Channeln_Lower8bits_ Start Starts the count lower 8 bit for channel 1 or channel 3 R_TAUm_Channeln_Stop Ends the count for channel n R_TAUm_Channeln_Higher8bits_ Stop Ends the count higher 8 bit for channel 1 or channel 3 R_TAUm_Channeln_Lower8bits_Stop Ends the count lower 8 bit for channel 1 or channel 3 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 t
46. 2 r_dalin_callback_error 93 r_dalin_callback_receiveend 92 r_dalin_callback_sendend 91 r_dalin_callback_softwareoverrun 94 R_DALIn_Create 83 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 259 of 267 Applilet3 APPENDIX A INDEX r_dalin_interrupt_error 86 r_dalin_interrupt_receive 85 r_dalin_interrupt_send 84 R_DALIn_Receive 90 R_DALIn_Send 89 R_DALIn_Start 87 R_DALIn_Stop 88 R_DMACn_Create 242 R_DMACn_Create_Userlnit 243 r_dmacn_interrupt 244 R_DMACn_Set_SoftwareTriggerOn 247 R_DMACn_Start 245 R_DMACn_Stop 246 R_DTC Create 232 R_DTC_Create_Userlnit 233 R_DTCn_Start 234 R_DTCn_Stop 235 R_DTC_Set_PowerOff 236 Real time Clock 191 r_rtc_callback_alarm 209 r_ttc_callback_constperiod 203 R_RTC_ Create 192 R_RTC_Create_Userlnit 193 R_RTC_Get_AlarmValue 208 R_RTC_Get_CounterValue 200 r_rtc_interrupt 194 R_RTC_Set_AlarmOff 205 R_RTC_Set_AlarmOn 204 R_RTC_Set_AlarmValue 206 R_RTC_Set_CounterValue 199 R_RTC_Set_HourSystem 198 R_RTC_Set_PowerOff 197 R_RTC_Set_RTC1HZOff 211 R_RTC_Set_RTC1HZOn 210 R_RTC_Start 195 R_RTC_Stop 196 R_RTC_Set_ConstPeriodInterruptOff 202 R_RTC_Set_ConstPeriodIinterruptOn 201 R_ELC Create 238 R_ELC_Create_Userlnit 239 R_ELC_Stop 240 r_tican_callback_getstopcondition 111 iican_callback_master_error
47. 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer c Syntax void R_TMR_KCO_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 185 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 8 Watchdog Timer Below is a list of API functions output by the Applilet3 for watchdog timer use Table 3 9 API Functions Watchdog Timer API Function Name Function R_WDT_Create Performs initialization necessary to control watchdog timer functions R_WDT_Create_UserInit Performs user defined initialization relating to the watchdog timer r_wdt_interrupt Performs processing in response to the interval interrupt INTWDTI of watchdog timer R_WDT_Restart Clears the watchdog timer counter and resumes counting R20UT0758EJ0100 Rev 1 00 2tENESAS Page 186 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_WDT Create Performs initialization necessary to control watchdog timer functions Classification r_cg_wdt c Syntax void R_WDT_Create void Argument s None Return value None R20UT0758EJ01
48. 69 R_llICmn_StopCondition 76 R_CSImn_Start 65 R_SAUm Create 46 R_CSlmn_Stop 66 R_SAUm_Create_Userlnit 47 r_dalin_callback_error 93 R SAUm Set PowerOff 48 r_dalin_callback_receiveend 92 ee ee 50 r_dalin_callback_sendend 91 K SA Sorena 49 r_dalin_callback_softwareoverrun 94 sige salad error 61 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 262 of 267 Oct 01 2011 Applilet3 APPENDIX A INDEX r_uartn_callback_receiveend 60 r_uartn_callback_sendend 59 r_uartn_callback_softwareoverrun 62 R_UARTn_Create 51 r_uartn_interrupt_error 54 r_uartn_interrupt_receive 53 r_uartn_interrupt_send 52 R_UARTn_Receive 58 R_UARTn_Send 57 R_UARTn_Start 55 R_UARTn_Stop 56 T Timer 134 R_TAUm_Channeln_Get_PulseWidth 147 r_taum_channeln_higher8bits_interrupt 139 R_TAUm_Channeln_Higher8bits_ Stop 144 r_taum_channeln_interrupt 138 R_TAUm_Channeln_Lower8bits_ Start 142 R_TAUm_Channeln_Lower8bits_Stop 145 R_TAUm_Channeln_Set_SoftwareTriggerOn 148 R_TAUm_Channeln_Start 140 R_TAUm_Channeln_Stop 143 R_TAUm_Create 136 R_TAUm_Create_Userlnit 137 R_TAUm_Set_PowerOff 146 R_TMR_KB Create 172 R_TMR_KBm_Create_Userlnit 173 R_TMR_KBm_ForcedOutput_Start 178 R_TMR_KBm_ForcedOutput_Stop 179 r_tmr_kom_interrupt 174 R_TMR_KBm_Set_PowerOff 177 R_TMR_KBm_Start 175 R_TMR_KBm_Stop 176 R_TMR_KCO_Create
49. API FUNCTIONS This chapter describes the API functions output by the Applilet3 3 1 Overview Below are the naming conventions for API functions output by the Appililet3 Macro names are in ALL CAPS The number in front of the macro name is a hexadecimal value this is the same value as the macro value Local variable names are in all lower case Global variable names start with a g and use Camel Case Names of pointers to global variables start with a gp and use Camel Case Names of elements in enum statements are in ALL CAPS 3 2 Output Function Below is a list of API functions output by the Applilet3 Table 3 1 API Function List Peripheral Function API Function Name Function Clock Generator R_CGC_Create Performs initialization required to control the clock gen erator on chip debug and etc R_CGC_Create_Userlnit Performs user defined initialization relating to the clock generator on chip debug and etc 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_PORT_Create Performs initialization necessary to control port func tions R_PORT_Create_Userlnit Performs user defined initialization relating to the port Interrupt R_INTC_Create Performs initialization necessary to control the external maskable interrupt INTPn functions R_INTC_Create_
50. B25 B24 BO t Event source 00 Event source 24 Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 240 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 15 DMA Controller Below is a list of API functions output by the Applilet3 for DMA Direct Memory Access controller use Table 3 16 API Functions DMA Controller API Function Name Function R_DMACn_Create Performs initialization necessary to control DMA controller functions R_DMACn_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 when DMA operation is enabled R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 241 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DMACn Create Performs initialization necessary to control DMA controller functions Classification r_cg_dmac c Syntax void R_DMACn_Create void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 242 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DMACn _Create_Userlnit Performs user defined initialization relating to
51. CENESAS 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 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 585 100 Fax 44 1628 585 900 Renesas Electronics Europe GmbH Arcadiastrasse 10 40472 D sseldorf 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 1 harbourFront Avenue 06 10
52. DC_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 D A Converter r_cg_dac c R_DAC_Create R_DACn_Start R_DACn_Stop R_DAC_Set_PowerOff R_DACn_Set_ConversionValue R20UT0758EJ0100 Rev 1 00 Page 8 of 267 Oct 01 2011 2tENESAS Applilet3 Peripheral Function D A Converter Source File Name r_cg_dac_user c CHAPTER 2 OUTPUT FILES Names of API Functions Included R_DAC_Create_Userlnit r_cg_dac h r_cg_timer c R_TAUm_Create R_TAUm_Channe R_TAUm_Channe R_TAUm_Channe R_TAUm_Channe R_TAUm_Channe R_TAUm_Channe n_Start n_Higher8bits_ Start n_Lower8bits_ Start n_Stop n_Higher8bits_Stop n_Lower8bits_Stop R_TAUm_Set_PowerOff R_TAUm_Channeln_Get_PulseWidth R_TAUm_Channeln_Set_SoftwareTriggerOn 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_TMR_RGO_Create R_TMR_RGO_ Start R_TMR_RGO_Stop R_TMR_RGO_Set_PowerOff R_TMR_RGO_Get_PulseWidth R_TMR_RJO_Create R_TMR_RJO_ Start R_TMR_RJO_Stop R_TMR_RJO_Set_PowerOff R_TMR_RJO_Get_PulseWidth R_TMR_KB_Create R_TMR_KBm_Start R_TMR_KBm_Stop R_TMR_KBm_Set_PowerOff R_TMR_KBm_ForcedOutput_Start R_TMR_KBm_ForcedOutput_Stop R_TMR_KCO_Create R_TMR_KCO_ Start R_TMR_
53. D_Create Performs initialization necessary to control voltage detector functions R_LVD_Create_Userlnit Performs user defined initialization relating to the volt age detector r_lvd_interrupt Performs processing in response to the voltage detection interrupt INTLVI R_LVD_InterruptMode_Start Starts voltage detection when in interrupt mode and interrupt amp reset mode Programmable R_PGA_Create Performs initialization necessary to control programma Gain Amplifier ble gain amplifiers functions R_PGA_Create_Userlnit Performs user defined initialization relating to the pro grammable gain amplifiers R_PGA_Start Starts the operation of programmable gain amplifier R_PGA_Stop Ends the operation of programmable gain amplifier R20UT0758EJ0100 Rev 1 00 ztENESAS Page 20 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 Function Reference This section describes the API functions output by the Applilet8 using the following notation format Figure 3 1 Notation Format of API Functions 1 0 Argument Description 6 Return value 7 Example 1 Name Indicates the name of the API function 2 Outline Outlines the functions of the API function 3 Classification Indicates the name of the C source file to which the API function is output 4 Syntax Indicates the format to be used when des
54. ENESAS Page 92 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_callback_error Performs processing in response to the DALI reception error interrupt INTSREDLn Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_error corresponding to the DALI reception error interrupt INTSREDLn Classification r_cg_serial_user c Syntax include r cg _macrodriver h static void r_dalin_callback_error uint8_t err_type Remark nis the channel number Argumenit s 1 0 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 93 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_callback_softwareoverrun Performs processing in response to detection of overrun error Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond ing to the DALI reception end interrupt INTSRDLn process performed when the amount of data received is greater than the parameter rx_num specified for R_DALIn_ Receive Classification r_cg_serial_user c Syntax include r cg _macrodriver h g static void r_dalin_callback_softwareoverrun uintl6_t rx data Remark nis the channel number Argument s
55. I FUNCTIONS r_rtc_callback_constperiod Performs processing in response to the cyclic interrupt INTRTC Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the cyclic interrupt INTRTC Classification r_cg_rtc_user c Syntax static void r_rtc_callback_constperiod void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 203 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_AlarmOn Starts the alarm interrupt function Classification r_cg_ric c Syntax void R_RTC_Set_AlarmOn void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 204 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_AlarmOff Ends the alarm interrupt function Classification r_cg_ric c Syntax void R_RTC_Set_Alarmoff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 205 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_AlarmValue Sets the alarm conditions weekday hour minute Classification r_cg_rtc c Syntax include r_cg_macrodriver h include t ogurtc h void R_RTC_Set_AlarmValue rtc_alarm_value_t alarm_val Argumenit s EE rtc_alarm_value_t alarm_ val Alarm conditions weekday
56. IICmn_Stop Ends simple IIC communication Classification r_cg_serial c Syntax void R_IICmn_Stop void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 77 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICmn_Master_Send Starts simple IIC master transmission Remark This API function repeats the byte level simple IIC master transmission from the buffer specified in parame ter tx_bufthe number of times specified in parameter tx_num Classification r_cg_serial c Syntax include yr cg _macrodriver h void R_IICmn_Master_Send uint8_t adr uint8_t tx buf uintl6_t tx_num Remark mis the unit number and nis the channel number Argumenit s 1 0 Argument Description uint8_t adr Device address l uint8_t tx_buf Pointer to a buffer storing the transmission data uintl6_t tx num Total amount of data to send Remark Below is shown the format for specifying device address aar 7 0 B7 B6 BS B4 B3 B2 Bi BO i Pi gt Slave address Device type Device address Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 78 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICmn_Master_Receive Starts simple IIC master reception Remark This API function performs
57. JO_Get_PulseWidth Remarks 1 This API function can 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 Classification r_cg_timer c Syntax include r cg _macrodriver h g void R_TMR_RJO_Get_PulseWidth Argument s uint32_t active_width O Argument Description O uint32_t active_ width Pointer to an area storing the active level width that was read from the TRJOIO pin Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 171 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KB _Create Performs initialization necessary to control the 16 bit timer KBm functions Classification r_cg_timer c Syntax void R_TMR_KB_ Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 172 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KBm Create_Userlnit Performs user defined initialization relating to the 16 bit timer KBm Remark This API function is called as the R_TMR_KB_ Create callback routine Classification r_cg_timer_user c Syntax void R_TMR_KBm_Create_UserInit void Remark mis the unit number Argument s None Return value
58. KCO_Stop R_TMR_KCO_Set_PowerOff r_cg_timer_user c R_TAUm_Create_Userlnit r_taum_channeln_interrupt r_taum_channeln_higher8bits_interrupt R_TMR_RDn_Create_Userlnit r_tmr_rdn_interrupt R_TMR_RGO_Create_UserInit r_tmr_rgO_interrupt R_TMR_RJO_Create_Userlnit R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 9 of 267 Applilet3 Peripheral Function Source File Name r_cg_timer_user c CHAPTER 2 OUTPUT FILES Names of API Functions Included r_tmr_rjO_interrupt R_TMR_KBm_Create_UserInit r_tmr_kbom_interrupt R_TMR_KCO_Create_UserInit r_tmr_kcO_interrupt r_cg_timer h Watchdog Timer r_cg_wdt c R_WDT_Create R_WDT_Restart r_cg_wdt_user c R_WDT_Create_UserInit r_wdt_interrupt r_cg_wadt h Rel time Clock r_cg_rtc c R_RTC_Create R_RTC_ Start R_RTC_Stop R_RTC_Set_PowerOff R_RTC_Set_HourSystem R_RTC_Set_CounterValue R_RTC_Get_CounterValue R_RTC_Set_ConstPeriodInterruptOn R_RTC_Set_ConstPeriodInterruptOff R_RTC_Set_AlarmOn R_RTC_Set_AlarmOff R_RTC_Set_AlarmValue R_RTC_Get_AlarmValue R_RTC_Set_RTC1HZOn R_RTC_Set_RTC1HZOff r_cg_rtc_user c R_RTC_Create_Userlnit r_rtc_interrupt r_rtc_callback_constperiod r_rtc_callback_alarm r_cg_rtc h 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 Comparator r_cg_comp c R_COMP_Cre
59. None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 224 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_COMP_Set_PowerOff Halts the clock supplied to the comparator Remark Calling this API function changes the comparator to reset status For this reason writes to the control regis ters after this API function is called are ignored Classification r_cg_comp c Syntax void R_COMP_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 225 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 12 Clock Output Buzzer Output Below is a list of API functions output by the Applilet3 for clock output buzzer output use Table 3 13 API Functions Clock Output Buzzer Output API Function Name Function R_PCLBUZn_Create Performs initialization necessary to control clock buzzer output control circuit functions R_PCLBUZn_Create_Userlnit Performs user defined initialization relating to the clock buzzer output control circuits R_PCLBUZn_Start Starts clock buzzer output R_PCLBUZn_Stop Ends clock buzzer output R20UT0758EJ0100 Rev 1 00 2tENESAS Page 226 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PCLBUZn_Create Performs initialization necessary to control clock buzzer output control circuit functions Classification r_cg_pclbuz c Syntax void R_PCLBUZn_Create void
60. R 3 API FUNCTIONS R_TMR_RGO_Stop Ends the count for 16 bit timer RGO Classification r_cg_timer c Syntax void R_TMR_RGO_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 162 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RGO_Set_PowerOff Halts 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 Classification r_cg_timer c Syntax void R_TMR_RGO_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 163 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer c Syntax include r_cg_macrodriver h include r cg _timer h MD_STATUS R_TMR_RGO_Get_PulseWidth timer_channel_t channel uint32_t active_width uint32_t inactive_width Argument s 1 0 Argument Description O uint32_t active
61. R_DALIn_Receive R_IICAn_Create R_IICAn_StopCondition R_IICAn_Stop R_IICAn_Set_PowerOff R_IICAn_Master_Send R_IICAn_Master_Receive R_IICAn_Slave_Send R_IICAn_Slave_Receive r_cg_serial_user c ztENESAS 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 Page 7 of 267 Applilet3 Peripheral Function Source File Name CHAPTER 2 OUTPUT FILES Names of API Functions Included Serial r_cg_serial_user c r_uartn_callback_softwareoverrun r_csimn_interrupt r_csimn_callback_sendend r_csimn_callback_receiveend r_csimn_callback_error r_iicmn_interrupt r_iicmn_callback_master_sendend r_iicmn_callback_master_receiveend r_iicmn_callback_master_error r_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_IICAn_Create_UserInit r_iican_interrupt r_iican_callback_master_sendend r_iican_callback_master_receiveend r_iican_callback_master_error r_iican_callback_slave_sendend r_iican_callback_slave_receiveend r_iican_callback_slave_error r_tican_callback_getstopcondition r_cg_serial 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_A
62. R_KEY_Stop 42 Interval Timer 212 R_IT_Create 213 R_IT_Create_Userlnit 214 r_it_interrupt 215 R_IT_Set_PowerOff 218 R_IT_Start 216 R_IT_Stop 217 P Port 29 R_PORT_Create 30 R_PORT_Create_Userlnit 31 Programmable Gain Amplifier 253 R_PGA_Create 254 R_PGA_Create_Userlnit 255 R_PGA_Start 256 R_PGA_Stop 257 R R_ADC Create 113 R_ADC_Create_Userlnit 114 R_ADC_Get_Result 125 R_ADC_Get_Result_8bit 126 r_adc_interrupt 115 R_ADC_Set_ADChannel 121 R_ADC_Set_OperationOff 117 R_ADC_Set_OperationOn 116 R_ADC_Set_PowerOff 120 R_ADC_Set_SnoozeOff 123 R_ADC_Set_SnoozeOn 122 R_ADC_Set_TestChannel 124 R_ADC_Start 118 R_ADC_Stop 119 R_CGC_Create 24 R_CGC_Create_Userlnit 25 R_CGC_Get_ResetSource 26 R_CGC_Set_ClockMode 27 R_CGC_Set_CRCOn 28 R_COMP_Create 220 R_COMP_Create_Userlnit 221 r_compn_interrupt 222 R_COMPn_Start 223 R_COMPn_Stop 224 R_COMP_Set_PowerOff 225 r_csimn_callback_error 72 r_csimn_callback_receiveend 71 r_csimn_callback_sendend 70 R_CSImn_Create 63 r_csimn_interrupt 64 R_CSImn_Receive 68 R_CSImn_Send 67 R_CSImn_Send_Receive 69 R_CSiImn_Start 65 R_CSImn_Stop 66 R_DAC Create 128 R_DAC_Create_Userlnit 129 R_DACn_Set_ConversionValue 133 R_DACn_Start 130 R_DACn_Stop 131 R_DAC_Set_PowerOff 13
63. Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 85 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_interrupt_error Performs processing in response to the DALI reception error interrupt INTSREDLn Remark This API function is called as the interrupt process corresponding to the DALI reception error interrupt INTSREDL n Classification r_cg_serial_user c Syntax static void r_dalin_interrupt_error void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 86 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DALIn_Start Sets DALI communication to standby mode Classification r_cg_serial c Syntax void R_DALIn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 87 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DALIn_Stop Ends DALI communication Classification r_cg_serial c Syntax void R_DALIn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 88 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DALIn_Send Starts DALI data transmission Remarks 1
64. Rev 1 00 2tENESAS Page 143 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Higher8bits_Stop Ends the count higher 8 bit for channel 1 or channel 3 Remark This API function can only be called when the timer array unit is used as a 8 bit timer Classification r_cg_timer c Syntax void R_TAUm_Channeln_Higher8bits_Stop void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 144 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Lower8bits_Stop Ends the count lower 8 bit for channel 1 or channel 3 Remark This API function can only be called when the timer array unit is used as a 8 bit timer Classification r_cg_timer c Syntax void R_TAUm_Channeln_Lower8bits_Stop void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 145 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Set_PowerOff Halts the clock supplied to the timer array unit Remark Calling this API function changes the timer array unit to reset status For this reason writes to the control registers after this API function is called are ignored Classification r_cg_timer c Syntax void R_TAUm_Set_PowerOff void Remark mis the unit number Argum
65. TIICAn 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 Classification r_cg_serial_user c Syntax static void r_iican_callback_slave_receiveend void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 109 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_slave_error Performs processing in response to detection of IICA slave communication error Classification r_cg_serial_user c Syntax include Yr cg _macrodriver h static void r_iican_callback_slave_error MD_STATUS flag Remark nis the channel number Argument 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 R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 110 of 267 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_getstopcondition Performs processing in response to detection of stop condition Classification r_cg_serial_user c Syntax static void r_iican_callback_getstopcondition void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 RENESAS Oct
66. Table 3 14 API Functions Data Transfer Controller API Function Name Function R_DTC_Create Performs initialization necessary to control the data transfer controller func tions R_DTC_Create_Userlnit Performs user defined initialization relating to the data transfer controller R_DTCn_Start Enables operation of the data transfer controller R_DTCn_Stop Disables operation of the data transfer controller R_DTC_Set_PowerOff Halts the clock supplied to the data transfer controller R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 231 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DTC Create Performs initialization necessary to control the data transfer controller functions Classification r_cg_dtc c Syntax void R_DTC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 232 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DTC_Create_Userlnit Performs user defined initialization relating to the data transfer controller Remark This API function is called as the R_DTC_ Create callback routine Classification r_cg_dtc_user c Syntax void R_DTC_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 233 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DTCn Start Enables operation of the data transfer con
67. This API function repeats the byte level DALI transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num 2 When performing a DALI transmission R_DALIn_Start must be called before this API function is called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_DALIn_Send uint8_t tx_buf uintl6_t tx_num Remark nis the channel number Argument s uint8_t tx_buf Pointer to a buffer storing the transmission data uintl6 _t tx_ num Total amount of data to send Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 89 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DALIn_Receive Starts DALI data reception Remarks 1 This API function performs byte level DALI reception the number of times specified by the parameter rx_num and stores the data in the buffer specified by the parameter rx_buf 2 Actual DALI reception starts after this API function is called and R_DALIn_ Start is then called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_DALIn_ Receive uint8_t rx buf uintl6_t rx_num Remark nis the channel number Argument s uint8_t rx_buf Pointer to a buffer to store the received data uintl6_t rx_ num Total amount of data to receive Return val
68. Tn_Start 55 R_UARTn_Stop 56 R_WDT_Create 187 R_WDT_Create_Userlnit 188 r_wdt_interrupt 189 R_WDT_Restart 190 R_DALIn_Create 83 r_dalin_interrupt_error 86 r_dalin_interrupt_receive 85 r_dalin_interrupt_send 84 R_DALIn_Receive 90 R_DALIn_Send 89 R_DALIn_Start 87 R_DALIn_Stop 88 r_ltican_callback_getstopcondition 111 iican_callback_master_error 105 a iican_callback_master_receiveend 104 a iican_callback_master_sendend 103 iican_callback_slave_error 110 7 iican_callback_slave_receiveend 109 iican_callback_slave_sendend 108 R_IICAn_Create 95 R_IICAn_Create_Userlnit 96 a r_iican_interrupt 97 R_IICAn_Master_Receive 102 R_IICAn_Master_Send 101 R_IICAn_Set_PowerOff 100 R_lIICAn_Slave_Receive 107 R_IICAn_Slave_Send 106 R_IICAn_Stop 99 R_IICAn_StopCondition 98 S r_iicmn_callback_master_error 82 Serial 43 r_iicmn_callback_master_receiveend 81 r_esimn_callback_error 72 r_iicmn_callback_master_sendend 80 r_csimn_callback_receiveend 71 R llCmn Create 73 R_CSlmn_Create 63 r_iicmn_interrupt 74 r_csimn_interrupt 64 R_IICmn_Master_Receive 79 R_CSlmn_Receive 68 R_llICmn_Master_Send 78 R_CSImn_Send 67 R_llCmn_StartCondition 75 r_csimn_callback_sendend 70 R_lICmn_Stop 77 R_CSImn_Send_Receive
69. Userlnit Performs user defined initialization relating to the exter nal maskable interrupt INTPn functions r_intcn_interrupt Performs processing in response to the external maskable interrupt INTPn R_INTCn_Start Enables the acceptance of the external maskable inter rupts INTPn R_INTCn_Stop Disables the acceptance of the external maskable inter rupts INTPn R_KEY_Create Performs initialization necessary to control the key interrupt INTKR functions R_KEY_Create_Userlnit Performs user defined initialization relating to the key interrupt INTKR functions r_key_interrupt Performs processing in response to the key interrupt INTKR R20UT0758EJ0100 Rev 1 00 2tENESAS Page 12 of 267 Oct 01 2011 Applilet3 Peripheral Function Interrupt API Function Name R_KEY_Start CHAPTER 3 API FUNCTIONS Function Enables the acceptance of the key interrupts INTKR R_KEY_Stop Disables the acceptance of the key interrupts INTKR R20UT0758EJ0100 Rev 1 00 Oct 01 2011 R_SAUm_ Create Performs initialization necessary to control the serial array unit and serial interface functions R_SAUm_Create_Userlnit Performs user defined initialization related to the serial array unit and serial interface functions 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
70. _CGC_Create 24 APPENDIX A INDEX R_CGC_Create_Userlnit 25 R_CGC_Get_ResetSource 26 R_CGC_Set_ClockMode 27 R_CGC_Set_CRCOn 28 Clock Output Buzzer Output 226 R_PCLBUZn_Create 227 R_PCLBUZn_Create_Userlnit 228 R_PCLBUZn_Start 229 R_PCLBUZn_Stop 230 Comparator 219 R_COMP _Create 220 R_COMP_Create_Userlnit 221 r_compn_interrupt 222 R_COMPn_Start 223 R_COMPn_Stop 224 R_COMP_Set_PowerOff 225 D A Converter 127 R_DAC_Create 128 R_DAC_Create_Userlnit 129 R_DACn_Set_ConversionValue 133 R_DACn_Start 130 R_DACn_Stop 131 R_DAC_Set_PowerOff 132 Data Transfer Controller 231 R_DTC_Create 232 R_DTC_Create_Userlnit 233 R_DTCn_Start 234 R_DTCn_Stop 235 R_DTC_Set_PowerOff 236 DMA Controller 241 R_DMACn_Create 242 R_DMACn_Create_Userlnit 243 r_dmacn_interrupt 244 R_DMACn_Set_SoftwareTriggerOn 247 R_DMACn_Start 245 R_DMACn_Stop 246 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 258 of 267 Applilet3 APPENDIX A INDEX E Event Link Controller 237 R_ELC Create 238 R_ELC_Create_Userlnit 239 R_ELC_Stop 240 I Interrupt 32 R_INTC_Create 33 R_INTC_Create_Userlnit 34 r_intcn_interrupt 35 R_INTCn_Start 36 R_INTCn_Stop 37 R_KEY_Create 38 R_KEY_Create_Userlnit 39 r_key_interrupt 40 R_KEY_Start 41
71. _width Pointer to an area storing the active level width that was read from the TRGIOA pin O uint32_t inactive_width Pointer to an area storing the inactive level width that was read from the TRGIOA pin timer_channel_t channel Pin to read TMCHANNELA TRGIOAO pin TMCHANNELB TRGIOBO pin Return value Macro Description MD_OK Normal completion R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 164 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RJO_Create Performs initialization necessary to control the 16 bit timer RJO functions Classification r_cg_timer c Syntax void R_TMR_RJO_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 165 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer_user c Syntax void R_TMR_RJO_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 166 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_tmr_rjO_interrupt Performs processing in response to the timer interrupt Remark This API function is called as the interrupt process corresponding to the timer i
72. ate R_COMPn_ Start R_COMPn_Stop R_COMP_Set_PowerOff r_cg_comp_user c R_COMP_Create_UserlInit r_compn_interrupt R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 10 of 267 Applilet3 Peripheral Function Source File Name CHAPTER 2 OUTPUT FILES Names of API Functions Included Comparator f_cg_comp h Clock Output Buzzer Output r_cg_pclbuz c R_PCLBUZn_Create R_PCLBUZn_Start R_PCLBUZn_Stop r_cg_pclbuz_user c R_PCLBUZn_Create_UserInit r_cg_pclbuz h Data Transfer Controller r_cg_dtc c R_DTC_Create R_DTCn_Start R_DTCn_Stop R_DTC_Set_PowerOff r_cg_dtc_user c R_DTC_Create_Userlnit r_cg_dtc h Event Link Controller r_cg_elc c R_ELC_ Create R_ELC_Stop r_cg_elc_user c R_ELC_Create_Userlnit r_cg_elc h DMA Controller r_cg_dmac c R_DMACn_Create R_DMACn_ Start R_DMACn_ Stop R_DMACn_Set_SoftwareTriggerOn r_cg_dmac_user c R_DMACn_Create_Userlnit r_dmacn_interrupt r_cg_dmac 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 Programmable Gain Amplifier r_cg_pga c R_PGA_Create R_PGA_Start R_PGA_Stop r_cg_pga_user c R_PGA_Create_Userlnit r_cg_pga h R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 11 of 267 Applilet3 CHAPTER 3 API FUNCTIONS CHAPTER 3
73. ber Argument s uint8_t tx buf Pointer to a buffer storing the transmission data uintl6 _t tx_ num Total amount of data to send Return value Macro Description MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 2tENESAS Page 57 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_UARTn_ Receive Starts UART data reception Remarks 1 This API function performs byte level UART reception the number of times specified by the parameter rx_num and stores the data in the buffer specified by the parameter rx_buf 2 Actual UART reception starts after this API function is called and R_UARTn_ Start is then called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_UARTn_Receive uint8_t rx buf uintl6_t rx_num Remark nis the channel number Argument s uint8_t rx_buf Pointer to a buffer to store the received data uintl6_t rx_ num Total amount of data to receive Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 58 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_callback_sendend Performs processing in response to the UART transmission end interrupt INTSTn Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_send corresp
74. by 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 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 When exporting the 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 You should not use Renesas Electronics products or the technology described in this document for any purpose relating to military applications or use by the military including but not limited to the development of weapons of mass destruction 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 Renesas Electronics has used reasonable care in preparing the information included in this document but Renesas
75. byte level simple IIC master reception the number of times specified by the parameter rx_num and stores the data in the buffer specified by the parameter rx_buf Classification r_cg_serial c Syntax include r cg _macrodriver h void R_IICmn_Master_Receive uint8_t adr uint8_t rx buf uintl6_t rx_num Remark mis the unit number and nis the channel number Argumenit s 1 0 Argument Description uint8_t adr Device address O uint8_t rx_buf Pointer to a buffer to store the received data l uintl6_t rx num Total amount of data to receive Remark Below is shown the format for specifying device address aar 7 0 B7 B6 BS B4 B3 B2 Bi BO i Pi gt Slave address Device type Device address Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 79 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iicmn_callback_master_sendend Performs processing in response to the simple IIC 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 parameter tx_num has been completed Classification r_cg_serial_user c Syntax static void r_iicmn_callback_master_sendend void
76. called as the interrupt process corresponding to the timer interrupt INTTMmn Classification r_cg_timer_user c Syntax interrupt static void r_taum_channeln_interrupt void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 138 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_taum_channeln_higher8bits_interrupt Performs processing in response to the timer interrupt INTTMmnH Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTMmnH Classification r_cg_timer_user c Syntax Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 139 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Siart 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 Classification r_cg_timer c Syntax void R_TAUm_Channeln_Start void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 140 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Cha
77. cribing an API function to be called in C language R20UT0758EJ0100 Rev 1 00 ztENESAS Page 21 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 5 Argument s API function arguments are explained in the following format a a 1 0 Argument classification l Input argument O Output argument b Argument Argument data type c Description Description of argument 6 Return value API function return value is explained in the following format a Macro Macro of return value b Description Description of return value 7 Example Shows an example of the API function in use R20UT0758EJ0100 Rev 1 00 ztENESAS Page 22 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 1 Clock Generator Below is a list of API functions output by the Applilet3 for clock generator use Table 3 2 API Functions Clock Generator API Function Name Function R_CGC_Create Performs initialization required to control the clock generator on chip debug and etc R_CGC_Create_UserInit Performs user defined initialization relating to the clock generator on chip debug and etc 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 R20UT0758EJ0100 Rev 1 00 ztENESAS Page 23 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS
78. ction Name Function R_RTC_Create Performs initialization necessary to control real time clock functions 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_ Start Starts the count of the real time clock year month weekday day hour minute second R_RTC_Stop Ends the count of the real time clock year month weekday day hour minute second R_RTC_Set_PowerOff Halts the clock supplied to the real time clock R_RTC_Set_HourSystem Sets the clock type 12 hour or 24 hour clock of the real time clock R_RTC_Set_CounterValue Sets the counter value year month weekday day hour minute second of the real time clock R_RTC_Get_CounterValue Reads the counter value year month weekday day hour minute second of the real time clock R_RTC_Set_ConstPeriodInterruptOn Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function R_RTC_Set_ConstPeriodInterruptOff Ends the cyclic interrupt function r_rtc_callback_constperiod Performs processing in response to the cyclic interrupt INTRTC R_RTC_Set_AlarmOn Starts the alarm interrupt function R_RTC_Set_AlarmOff Ends the alarm interrupt function R_RTC_Set_AlarmValue Sets the alarm conditions weekday hour minute R_RTC_Ge
79. d data uint16_t Total amount of data to receive uint8_t Return value Macro Description MD_OK Normal completion Setup time of start conditions MD_ERROR1 Bus communication status MD_ERROR2 Bus not released status R20UT0758EJ0100 Rev 1 00 RENESAS Oct 01 2011 Page 102 of 267 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_master_sendend Performs processing in response to the IICA master transmission end interrupt INTIICAn Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA master transmission end interrupt INTIICAn Classification r_cg_serial_user c Syntax static void r_iican_callback_master_sendend void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 103 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_iican_callback_master_receiveend Performs processing in response to the IICA master reception end interrupt INTIICAn Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the IICA master reception end interrupt INTIICAn Classification r_cg_serial_user c Syntax static void r_iican_callback_master_receiveend void Remark nis the channel number Argument s None Return value
80. ducts 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 Readers Purpose Organization How to Read This Manual Conventions How to Use This Manual This manual understands the function of device driver configurator Applilet3 for RL78 family and targets the user who designs the application system that uses it This manual understands the software function of Applilet8 by the user and has aimed useful as the hardware of the system that uses this and material for the reference to the software development This manual is divided into the following sections CHAPTER 1 GENERAL CHAPTER 2 OUTPUT FILES CHAPTER 3 API FUNCTIONS APPENDIX A INDEX It is assumed that the readers of this manual have general knowledge in the fields of electrical engineering logic circuits and microcontrollers This manual describes the basic setup procedures and how to set switches Note Footnote for item marked with Note in the text Caution Information requiring particular attention Remark Supplementary information Numeric representation Binary XXXXB Decimal XXXX Hexadecimal XXXXH or OxXXXXX All trademarks or registered trademarks in this document are the property of their res
81. e trigger for one shot pulse output R_TMR_RDn_Create Performs initialization necessary to control the 16 bit timer RDn functions 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 output forced cutoff for 16 bit timer RDn R_TMR_RDn_Get_PulseWidth 2tENESAS Reads the pulse width of the 16 bit timer RDn Page 16 of 267 Applilet3 Peripheral Function API Function Name R_TMR_RGO_Create CHAPTER 3 API FUNCTIONS Function Performs initialization necessary to control the 16 bit timer RGO functions 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 t
82. e_receiveend Performs processing in response to the IICA slave reception end interrupt INTIICAn iican_callback_slave_error Performs processing in response to detection of IICA slave communication error _lican_callback_getstopcondition Performs processing in response to detection of stop condition R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 45 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_SAUm Create Performs initialization necessary to control the serial array unit and serial interface functions Classification r_cg_serial c Syntax void R_SAUm_Create void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 46 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_SAUm Create_Userlnit Performs user defined initialization related to the serial array unit and serial interface functions Remark This API function is called as the R_SAUm_Create callback routine Classification r_cg_serial_user c Syntax void R_SAUm_Create_UserInit void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 47 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_SAUm Set_PowerOff Halts the clock supplied to the serial array unit Remark Calling this API function changes the serial array unit to
83. eate_Userlnit 228 R_PCLBUZn_Start 229 R_PCLBUZn_Stop 230 R_PGA_Create 254 R_PGA_Create_Userlnit 255 R_PGA_Start 256 R_PGA_Stop 257 R_PORT_Create 30 R_PORT_Create_Userlnit 31 r_rtc_callback_alarm 209 r_ttc_callback_constperiod 203 R_RTC_Create 192 R_RTC_Create_Userlnit 193 R_RTC_Get_AlarmValue 208 R_RTC_Get_CounterValue 200 r_rtc_interrupt 194 R_RTC_Set_AlarmOff 205 R_RTC_Set_AlarmOn 204 R_RTC_Set_AlarmValue 206 R_RTC_Set_CounterValue 199 R_RTC_Set_HourSystem 198 R_RTC_Set_PowerOff 197 R_RTC_Set_RTC1HZOff 211 R_RTC_Set_RTC1HZOn 210 R_RTC_Start 195 R_RTC_Stop 196 R_RTC_Set_ConstPeriodInterruptOff 202 R_RTC_Set_ConstPeriodInterruptOn 201 R_SAUm_Create 46 R_SAUm_Create_Userlnit 47 R_SAUm_Set_PowerOff 48 R_SAUm_Set_SnoozeOff 50 R_SAUm_Set_SnoozeOn 49 R_TAUm_Channeln_Get_PulseWidth 147 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 APPENDIX A INDEX r_taum_channeln_higher8bits_interrupt 139 R_TAUm_Channeln_Higher8bits_ Start 141 R_TAUm_Channeln_Higher8bits Stop 144 r_taum_channeln_interrupt 138 R_TAUm_Channeln_Lower8bits_ Start 142 R_TAUm_Channeln_Lower8bits_ Stop 145 R_TAUm_Channeln_Set_SoftwareTriggerOn 148 R_TAUm_Channeln_Start 140 R_TAUm_Channeln_Stop 143 R_TAUm Create 136 R_TAUm_Create_Userlnit 137 R_TAUm_Set_PowerOff 146 R_TMR_KB Create 172
84. eate_Userlnit Performs user defined initialization relating to the event link controller R_ELC_Stop Disables operation of the event link controller R20UT0758EJ0100 Rev 1 00 2tENESAS Page 237 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ELC Create Performs initialization necessary to control the event link controller functions Classification r_cg_elc c Syntax void R_ELC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 238 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ELC_Create_Userlnit Performs user defined initialization relating to the event link controller Remark This API function is called as the R_ELC_ Create callback routine Classification r_cg_elc_user c Syntax void R_ELC_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 239 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ELC Stop Disables operation of the event link controller Classification r_cg_elc c Syntax void R_ELC_Stop uint32_t event Argument s Le 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
85. econd must be left free between the call to this API function and the call to R_ADC_ Start 2 Onthe 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 Classification r_cg_adc c Syntax void R_ADC_Set_OperationOn void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 116 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Set_OperationOff Disables operation of voltage converter Classification r_cg_adc c Syntax void R_ADC_Set_OperationoOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 117 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_ Start Starts A D conversion Remark About 1 micro second of stabilization time is required when changing the voltage converter from operation stopped to operation enabled status Consequently about 1 micro second must be left free between the call to R ADC_Set_OperationOn and the call to this API function Classification r_cg_adc c Syntax void R_ADC_Start void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 118 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Stop Ends A D conversion
86. elating to the interval timer r_it_interrupt R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Performs processing in response to the interval timer interrupt INTIT Page 18 of 267 Applilet3 Peripheral Function Interval Timer API Function Name R_IT_Start CHAPTER 3 API FUNCTIONS Function Starts the count of the interval timer R_IT_Stop Ends the count of the interval timer R_IT_Set_PowerOff Halts the clock supplied to the interval timer Comparator R_COMP_Create Performs initialization necessary to control the compar ator functions R_COMP_Create_Userlnit Performs user defined initialization relating to the com parator r_compn_interrupt Performs processing in response to the comparator interrupt INTCMPn R_COMPn_ Start Begins comparison of reference input voltage and ana log 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 Clock Output Buzzer Output R_PCLBUZn_Create Performs initialization necessary to control clock buzzer output control circuit functions R_PCLBUZn_Create_Userlnit Performs user defined initialization relating to the clock buzzer output control circuits R_PCLBUZn_ Start Starts clock buzzer output R_PCLBUZn_Stop Ends clock buzzer output Data Transfer Controller
87. enit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 146 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Get_PulseWidth Captures the high low level width measured between pulses of the signal pulses input to the TImn pin Classification r_cg_timer c Syntax include Yr cg _macrodriver h void R_TAUm_Channeln_Get_PulseWidth uint32_t width Remark mis the unit number and nis the channel number Argumeni s 1 0 Argument Description O uint32_t width Pointer to an area to store the measurement width 0x0 to Ox1FFFF Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 147 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Set_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output Classification r_cg_timer c Syntax void R_TAUm_Channeln_Set_SoftwareTriggerOn void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 148 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_Create Performs initialization necessary to control the 16 bit timer RDn functions Classification r_cg_timer c Syntax void R_TMR_RDn_Create void Remark nis the channel number Argument s None
88. gumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 71 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_csimn_callback_error Performs processing in response to the CSI reception error interrupt INTSREn Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error corresponding to the CSI reception error interrupt INTSREn Classification r_cg_serial_user c Syntax include r_cg_macrodriver h static void r_csimn_callback_error uint8_t err_type Remark mis the unit number and nis the channel number Argumeni s 1 0 Argument Description O uint8_t err_type Trigger for CSI reception error interrupt 00000xx1B Overrun error Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 72 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IICmn_Create Performs initialization of the serial interface simple IIC channel 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 Classification r_cg_serial c Syntax void R_IICmn_Create void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 73 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS Performs
89. he Applilet3 for D A converter use Sets the analog voltage output to the ANOn pin Table 3 7 API Functions D A Converter API Function Name Function R_DAC_Create Performs initialization necessary to control the D A converter functions 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 127 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DAC Create Performs initialization necessary to control the D A converter functions Classification r_cg_dac c Syntax void R_DAC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 128 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_dac_user c Syntax void R_DAC_Create_UserInit void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 129 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DACn_ Start Starts D A c
90. he TImn pin R_TAUm_Channeln_Set_SoftwareTriggerOn Generates the trigger software trigger for one shot pulse output R_TMR_RDn_Create Performs initialization necessary to control the 16 bit timer RDn functions 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 output forced cutoff for 16 bit timer RDn R_TMR_RDn_Get_PulseWidth Reads the pulse width of the 16 bit timer RDn R_TMR_RGO_Create Performs initialization necessary to control the 16 bit timer RGO functions 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
91. he pulse width of the 16 bit timer RGO R_TMR_RJO_Create Performs initialization necessary to control the 16 bit timer RJO functions 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 R_TMR_KB_Create Performs initialization necessary to control the 16 bit timer KBm functions R_TMR_KBm_Create_Userlnit Performs user defined initialization relating to the 16 bit timer KBm r_tmr_kbm_interrupt Performs processing in response to the timer interrupt R_TMR_KBm_Start Starts the count for 16 bit timer KBm R_TMR_KBm_Stop Ends the count for 16 bit timer KBm R_TMR_KBm_Set_PowerOff Halts the clock supplied to the 16 bit timer KBm R_TMR_KBm_ForcedOutput_Start Enables input of the trigger signal used for the forced output stop function R_TMR_KBm_ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop function R_TMR_KCO_ Create Performs initialization necessary to control the 16 bit timer KCO functions R_TMR_KCO_Create_Userln
92. ion R_CSImn_Receive Starts CSI data reception R_CSImn_Send_Receive Starts CSI data transmission reception r_csimn_callback_sendend 2tENESAS Performs processing in response to the CSI transmission end interrupt INTCSImn Page 13 of 267 Applilet3 Peripheral Function R20UT0758EJ0100 Rev 1 00 Oct 01 2011 API Function Name r_csimn_callback_receiveend CHAPTER 3 API FUNCTIONS Function 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 of the serial interface simple IIC channel r_iicmn_interrupt Performs processing in response to the simple IIC communication end interrupt INTIIC mn R_IICmn_StartCondition Generates start conditions R_IICmn_StopCondition Generates stop conditions R_IICmn_Stop Ends simple IIC communication R_IICmn_Master_Send Starts simple IIC master transmission R_IICmn_Master_Receive Starts simple IIC master reception r_iicmn_callback_master_sendend Performs processing in response to the simple IICmn master transmission end interrupt INTIIC mn r_iicmn_callback_master_receiveend Performs processing in response to the simple IICmn master reception end interrupt INTIIC mn r_iicmn_callback_master_error Performs pr
93. ission R_IICmn_Master_Receive Starts simple IIC master reception r_iicmn_callback_master_sendend Performs processing in response to the simple IIC 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 R_DALIn_Create Performs initialization of the serial interface DALI channel r_dalin_interrupt_send Performs processing in response to the DALI transmission end interrupt INTSTDLn r_dalin_interrupt_receive Performs processing in response to the DALI reception end interrupt INTSRDLn r_dalin_interrupt_error Performs processing in response to the DALI reception error interrupt INTSREDLn R_DALIn_ Start Sets DALI communication to standby mode R_DALIn_Stop Ends DALI communication R_DALIn_Send Starts DALI data transmission R_DALIn_Receive Starts DALI data reception r_dalin_callback_sendend Performs processing in response to the DALI transmission end interrupt INTSTDLn r_dalin_callback_receiveend Performs processing in response to the DALI reception end interrupt INTSRDLn r_dalin_callback_error Performs processing in response to the DALI reception error interrupt INTSREDLn r_dalin_callback_s
94. it 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 Watchdog Timer R20UT0758EJ0100 Rev 1 00 Oct 01 2011 R_WDT_Create ztENESAS Performs initialization necessary to control watchdog timer functions Page 17 of 267 Applilet3 Peripheral Function API Function Name Watchdog Timer R_WDT_Create_Userlnit CHAPTER 3 API FUNCTIONS Function Performs user defined initialization relating to the watchdog timer r_wdt_interrupt Performs processing in response to the interval interrupt INTWDTI of watchdog timer R_WDT_Restart Clears the watchdog timer counter and resumes count ing Real time Clock R_RTC_Create Performs initialization necessary to control real time clock functions 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_Start Starts the count of the real time clock year month weekday day hour minute second R_RTC_Stop Ends the count of the real time clock year month weekday day hour minute second
95. letion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 2tENESAS Page 124 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Get_Result Reads the results of A D conversion 10 bit Classification r_cg_adc c Syntax include r_cg_macrodriver h void R_ADC_Get_Result uintl16_t buffer Argumeni s o uintl6_t buffer Pointer to area in which to store read results of A D conversion Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 125 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Get_Result_8bit Reads the results of A D conversion 8 bits most significant 8 bits of 10 bit resolution Classification r_cg_adc c Syntax include r_cg_macrodriver h void R_ADC_Get_Result_8bit uint8_t buffer Argumeni s uint8_t buffer Pointer to area in which to store the results of A D conversion 8 bits most significant 8 bits of 10 bit resolution 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 4 Results of A D conversion to be stored in buffer Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 126 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 6 D A Converter Below is a list of API functions output by t
96. mer RDn Classification r_cg_timer c Syntax void R_TMR_RDn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 153 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_Set_PowerOff Halts the clock supplied to the 16 bit timer RDn Remark Calling this API function changes the 16 bit timer RDn to reset status For this reason writes to the control registers after this API function is called are ignored Classification r_cg_timer c Syntax void R_TMR_RDn_Set_PowerOff void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 154 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_ForcedOutput_Sitart Starts the pulse output forced cutoff for 16 bit timer RDn Classification r_cg_timer c Syntax void R_TMR_RDn_ForcedOutput_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 155 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RDn_ForcedOutput_Stop Ends the pulse output forced cutoff for 16 bit timer RDn Remark This API function can only be called when the 16 bit timer RDn is the count to stopped the TSTART bit in the timer RD start register TRDSTR is 0
97. n r_cg_serial_user c Syntax interrupt static void r_uartn_interrupt_error void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 54 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_UARTn _Siart Sets UART communication to standby mode Classification r_cg_serial c Syntax void R_UARTn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 55 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_UARTn_Stop Ends UART communication Classification r_cg_serial c Syntax void R_UARTn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 56 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_UARTn_Send Starts UART data transmission Remarks 1 This API function repeats the byte level UART transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num 2 When performing a UART transmission R_UARTn_Start must be called before this API function is called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_UARTn_Send uint8_t tx_ buf uintl6_t tx_num Remark nis the channel num
98. n value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 30 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_PORT_Create_Userlnit Performs user defined initialization relating to the port Remark This API function is called as the R_PORT Create callback routine Classification r_cg_port_user c Syntax void R_PORT_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 31 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 3 Interrupt Below is a list of API functions output by the Applilet3 for interrupt and key interrupt use Table 3 4 API Functions Interrupt API Function Name Function R_INTC_Create Performs initialization necessary to control the external maskable interrupt INTPn functions R_INTC_Create_Userlnit Performs user defined initialization relating to the external maskable interrupt INTPn 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_KEY_Create Performs initialization necessary to control the key interrupt INTKR functions R_KEY_Create_Userlnit Performs user defined initialization relating to the key interrupt INTKR func tions r_key_interrupt
99. nneln_Higher8bits_Start Starts the count higher 8 bit for channel 1 or channel 3 Remark This API function can only be called when the timer array unit is used as a 8 bit timer Classification r_cg_timer c Syntax void R_TAUm_Channeln_Higher8bits_Start void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 141 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Lower8bits_ Start Starts the count lower 8 bit for channel 1 or channel 3 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 Classification r_cg_timer c Syntax void R_TAUm_Channeln_Lower8bits_Start void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 142 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TAUm_Channeln_Stop Ends the count for channel n Classification r_cg_timer c Syntax void R_TAUm_Channeln_Stop void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100
100. nt communications equipment test and measurement equipment audio and visual equipment home electronic appliances machine tools personal electronic equipment and industrial robots High Quality Transportation equipment automobiles trains ships etc traffic control systems anti disaster systems anti crime systems safety equipment and medical equipment not specifically designed for life support Specific Aircraft aerospace equipment submersible repeaters nuclear reactor control systems medical equipment or systems for life support e g artificial life support devices or systems surgical implantations or healthcare intervention e g excision etc and any other applications or purposes that pose a direct threat to human life 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 u
101. nt s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 66 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Send Starts CSI data transmission Remarks 1 This API function repeats the byte level CSI transmission from the buffer specified in parameter tx_buf the number of times specified in parameter tx_num 2 When performing a CSI transmission R_CSImn_Siart must be called before this API function is called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_CSImn_Send uint8_t tx buf uint1l6_t tx num Remark mis the unit number and nis the channel number Argument s uint8_t tx_buf Pointer to a buffer storing the transmission data uintl6 _t tx_ num Total amount of data to send Return value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 67 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Receive Starts CSI data reception Remarks 1 This API function performs byte level CSI reception the number of times specified by the parameter rx_num and stores the data in the buffer specified by the parameter rx_buf 2 When performing a CSI reception R_CSImn_Start must be called before this API function is called Classification r_cg_serial c Syntax include r cg _macrodriver h g MD_STATUS R_CSImn_Receive
102. nterrupt Classification r_cg_timer_user c Syntax __interrupt static void r_tmr_rj0O_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 167 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RJO_Start Starts the count for 16 bit timer RJO Classification r_cg_timer c Syntax void R_TMR_RJO_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 168 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RJO_Stop Ends the count for 16 bit timer RJO Classification r_cg_timer c Syntax void R_TMR_RJO_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 169 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer c Syntax void R_TMR_RJO_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 170 of 267 Oct 01 2011 Applilet3 Reads the pulse width of the 16 bit timer RJO CHAPTER 3 API FUNCTIONS R_TMR_R
103. ocessing in response to detection of parity error ACK error R_DALIn_Create Performs initialization of the serial interface DALI channel r_dalin_interrupt_send Performs processing in response to the DALI transmission end interrupt INTSTDLn r_dalin_interrupt_receive Performs processing in response to the DALI reception end interrupt INTSRDLn r_dalin_interrupt_error Performs processing in response to the DALI reception error interrupt INTSREDLn R_DALIn_ Start Sets DALI communication to standby mode R_DALIn_ Stop Ends DALI communication R_DALIn_Send Starts DALI data transmission R_DALIn_Receive Starts DALI data reception r_dalin_callback_sendend Performs processing in response to the DALI transmission end interrupt INTSTDLn r_dalin_callback_receiveend Performs processing in response to the DALI reception end interrupt INTSRDLn r_dalin_callback_error Performs processing in response to the DALI reception error interrupt INTSREDLn r_dalin_callback_softwareoverrun Performs processing in response to detection of overrun error R_IICAn_Create Performs initialization of the serial interface IICA R_IICAn_Create_UserInit ztENESAS Performs user defined initialization of the serial inter face IICA Page 14 of 267 Applilet3 Peripheral Function API Function Name r_iican_interrupt CHAPTER 3 API FUNCTIONS
104. oftwareoverrun Performs processing in response to detection of overrun error R_IICAn_Create Performs initialization of the serial interface IICA R_IICAn_Create_Userlnit Performs user defined initialization of the serial interface IICA r_iican_interrupt Performs processing in response to the IICA communication end interrupt INTIICAn R_IICAn_StopCondition Generates stop conditions R_IICAn_Stop Ends IICA communication R_IICAn_Set_PowerOff Halts the clock supplied to the serial interface IICA R_IICAn_Master_Send Starts IICA master transmission R_IICAn_Master_Receive Starts IICA master reception r_iican_callback_master_sendend Performs processing in response to the IICA master transmission end interrupt INTIICAn r_iican_callback_master_receiveend R20UT0758EJ0100 Rev 1 00 Oct 01 2011 Performs processing in response to the IICA master reception end interrupt INTIICAn ztENESAS Page 44 of 267 Applilet3 API Function Name Function r_iican_callback_master_error CHAPTER 3 API FUNCTIONS 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 F iican_callback_slave_sendend Performs processing in response to the IICA slave transmission end interrupt INTIICAn iican_callback_slav
105. onding to the UART transmission end interrupt INTSTn performed when number of transmission data specified by R_UARTn_Send parameter tx_num has been completed Classification r_cg_serial_user c Syntax static void r_uartn_callback_sendend void Remark nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 59 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_callback_receiveend Performs processing in response to the UART reception end interrupt INTSRn Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_receive correspond ing to the UART reception end interrupt INTSRn performed when number of received data specified by R_UARTn_Receive parameter rx_num has been completed Classification r_cg_serial_user c Syntax static void r_uartn_callback_receiveend void Remark nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 60 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_uartn_callback_error Performs processing in response to the UART reception error interrupt INTSREn Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error corresponding to the UART reception error interrupt INTSREn Classification r_cg_serial_user c Syntax include
106. onversion 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 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 R_TAUm_Create Performs initialization necessary to control timer array unit functions R_TAUm_Create_Userlnit 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 1 or channel 3 R_TAUm_Channeln_Lower8bits_ Start Starts the count lower 8 bit for channel 1 or channel 3 R_TAUm_Channeln_Stop Ends the count for channel n R_TAUm_Channeln_Higher8bits_ Stop Ends the count higher 8 bit for channel 1 or channel 3 R_TAUm_Channeln_Lower8bits_Stop Ends the count lower 8 bit for channel 1 or channel 3 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 Tlmn pin R_TAUm_Channeln_Set_SoftwareTriggerOn Generates the trigger softwar
107. onversion Classification r_cg_dac c Syntax void R_DACn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 130 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DACn_Stop Ends D A conversion Classification r_cg_dac c Syntax void R_DACn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 131 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_DAC_Set_PowerOff Halts the clock supplied to the D A converter Remark Calling this API function changes the D A converter to reset status For this reason writes to the control reg isters after this API function is called are ignored Classification r_cg_dac c Syntax void R_DAC_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 132 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DACn_Set_ConversionValue Sets the analog voltage output to the ANOn pin Classification r_cg_dac c Syntax include r_cg_macrodriver h void R_DACn_Set_ConversionValue uint8_t reg_value Remark nis the channel number Argumenit s 1 0 Argument Description l uint8_t reg_value D A conversion value
108. pective owners TABLE OF CONTENTS CHAPTER 1 GENERAL 5 1 1 Overview 5 1 2 Features 5 CHAPTER 2 OUTPUT FILES 6 2 1 Overview 6 2 2 Output File 6 CHAPTER 3 API FUNCTIONS 12 3 1 Overview 12 3 2 Output Function 12 3 3 Function Reference 21 3 3 1 Clock Generator 23 3 3 2 Port 29 3 3 3 Interrupt 32 3 3 4 Serial 43 3 3 5 A D Converter 112 3 3 6 D A Converter 127 3 3 7 Timer 134 3 3 8 Watchdog Timer 186 3 3 9 Real time Clock 191 3 3 10 Interval Timer 212 3 3 11 Comparator 219 3 3 12 Clock Output Buzzer Output 226 3 3 13 Data Transfer Controller 231 3 3 14 Event Link Controller 237 3 3 15 DMA Controller 241 3 3 16 Voltage Detector 248 3 3 17 Programmable Gain Amplifier 253 APPENDIX A INDEX 258 Applilet3 CHAPTER 1 GENERAL CHAPTER 1 GENERAL This chapter gives an overview of the Applilet3 1 1 Overview The design tool enables you to output the source code device driver programs C source files and header files neces sary to control the peripheral hardware functions provided by the microcontroller clock generator port functions etc by configuring various information using the GUI 1 2 Features The Applilet3 has the following features Code generating function The Applilet3 can output not only device driver programs in accordance with the information configured using the GUI but also a build envi
109. real time clock Classification r_cg_rtc c Syntax include Yr cg _macrodriver h include yr og urtc h MD_STATUS R_RTC_Set_HourSystem rtc_hour_system_t hour_system Argument s 1 0 Argument Description 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 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 198 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_CounterValue Sets the counter value year month weekday day hour minute second of the real time clock Classification r_cg_rtc c Syntax include r cg _macrodriver h include yr ogurtc h MD_STATUS R_RTC_Set_CounterValue rtc_counter_value_t counter_write_val Argument s 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 typedef
110. registers after this API function is called are ignored Classification r_cg_timer c Syntax void R_TMR_KBm_Set_PowerOff void Remark mis the unit number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 177 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KBm _ForcedOutput_Siart Enables input of the trigger signal used for the forced output stop function Classification r_cg_timer c Syntax void R_TMR_KBm_ForcedOutput_Start void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 178 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KBm _ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop function Classification r_cg_timer c Syntax void R_TMR_KBm_ForcedOutput_Stop void Remark mis the unit number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 179 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_KCO_Create Performs initialization necessary to control the 16 bit timer KCO functions Classification r_cg_timer c Syntax void R_TMR_KCO_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 180 of 267 Oct 01 2011 Applilet3
111. rforms initialization necessary to control A D con verter functions 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_ADC_Set_ADChannel Configures the analog voltage input pin for A D conver sion 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 operaiton mode of A D converter R_ADC_Get_Result ztENESAS Reads the results of A D conversion 10 bit Page 15 of 267 Applilet3 Peripheral Function A D Converter API Function Name R_ADC_Get_Result_8bit CHAPTER 3 API FUNCTIONS Function Reads the results of A D conversion 8 bits most signif icant 8 bits of 10 bit resolution D A Converter R_DAC_Create Performs initialization necessary to control the D A con verter functions R_DAC_Create_Userlnit Performs user defined initialization relating to the D A converter R_DACn_ Start Starts D A c
112. rgument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 35 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_INTCn_Start Enables the acceptance of the external maskable interrupts INTPn Classification r_cg_intc c Syntax void R_INTCn_Start void Remark nis the interrupt factor number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 36 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_INTCn_Stop Disables the acceptance of the external maskable interrupts INTPn Classification r_cg_intc c Syntax void R_INTCn_Stop void Remark nis the interrupt factor number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 37 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_KEY_ Create Performs initialization necessary to control the key interrupt INTKR functions Classification r_cg_intc c Syntax void R_KEY_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 38 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_KEY_Create_Userlnit Performs user defined initialization relating to the key interrupt INTKR functions Remark This API function is called as the R_KEY_ Create callback routine Classification
113. rms initialization necessary to control A D converter functions Classification r_cg_adc c Syntax void R_ADC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 113 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_adc_user c Syntax void R_ADC_Create_UserInit void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 114 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_adc_interrupt Performs processing in response to the A D conversion end interrupt INTAD Remark This API function is called as the interrupt process corresponding to the A D conversion end interrupt INTAD Classification r_cg_adc_user c Syntax __interrupt static void r_adc_interrupt void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 115 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_ADC_Set_OperationOn Enables operation of voltage converter Remarks 1 About 1 microsecond of stabilization time is required when changing the voltage converter from opera tion stopped to operation enabled status Consequently about 1 micro s
114. ronment such as sample programs containing main functions and link directive files Project workspace file generating function The Applilet3 can output project and workspace files that can be used in application system integrated develop ment environments IAR Embedded Workbench Reporting function You can output configured information using the Applilet3 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 Applilet8 and the API functions contained in the source code R20UT0758EJ0100 Rev 1 00 2tENESAS Page 5 of 267 Oct 01 2011 Applilet3 CHAPTER 2 OUTPUT FILES CHAPTER 2 OUTPUT FILES This chapter describes the files output by the Applilet3 2 1 Overview Below is a list of files output by the Applilet3 Table 2 1 File List Unit of Output File Name Description Peripheral function t_cg_PeripheralFunctionName c Initial function API function t_cg_PeripheralFunctionName_us_ Interrupt function callback function er c r_cg_PeripheralFunctionName h Defines macros for assigning values to registers Project r_main c main function r_systeminit c Call initial function of peripheral function Call R_CGC_Get_ResetSource r_cg_macrodriver h Defines common macros used by all source files r_cg_userdefine h Empty file for user definitions r_lk dr Link directive md_Inkxxx_xx_xcl Link directive for IAR System
115. s r_option_ca txt User option byte value etc 2 2 Output File Below are the files peripheral function output by the Applilet3 Table 2 2 File List Peripheral Function Peripheral Function Source File Name Names of API Functions Included Clock Generator r_cg_cgc c R_CGC_Create R_CGC_Set_ClockMode R_CGC_Set_CRCOn r_cg_cgc_user c R_CGC_Create_Userlnit R_CGC_Get_ResetSource r_cg_cgc h 3 r_cg_port c R_PORT_Create r_cg_port_user c R_PORT_Create_Userlnit r_cg_port h Interrupt r_cg_intc c R_INTC_Create R_INTCn_Start R_INTCn_Stop R_KEY_Create R_KEY_ Start R20UT0758EJ0100 Rev 1 00 ztENESAS Page 6 of 267 Oct 01 2011 Applilet3 Peripheral Function Interrupt Source File Name r_cg_intc c CHAPTER 2 OUTPUT FILES Names of API Functions Included R_KEY_Stop r_cg_intc_user c R_INTC_Create_Userlnit r_intcn_interrupt R_KEY_Create_Userlnit r_key_interrupt r_cg_intc h Serial R20UT0758EJ0100 Rev 1 00 Oct 01 2011 r_cg_serial 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_DALIn_Create R_DALIn_ Start R_DALIn_Stop R_DALIn_Send
116. s 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 200 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_ConstPeriodIinterruptOn Sets the cycle of the interrupts INTRTC then starts the cyclic interrupt function Classification r_cg_rtc c Syntax include r cg _macrodriver h include n eg rth MD_STATUS R_RTC_Set_ConstPeriodInterruptOn rtc_int_period_t period Argument s Argument Description 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 MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 201 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_ConstPeriodinterruptOff Ends the cyclic interrupt function Classification r_cg_ric c Syntax void R_RTC_Set_ConstPeriodInterruptOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 202 of 267 Oct 01 2011 Applilet3 CHAPTER 3 AP
117. se conditions Further Renesas Electronics products are not subject to radiation resistance design Please be sure to implement safety measures to guard them against the possibility of physical injury and injury or damage caused by fire in the event of the failure of a Renesas Electronics product such as safety design for hardware and software including but not limited to redundancy fire control and malfunction prevention appropriate treatment for aging degradation or any other appropriate measures Because the evaluation of microcomputer software alone is very difficult please evaluate the safety of the final products or system 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 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 pro
118. son there is normally no need to call it from a user program Classification r_cg_serial c Syntax void R_CSImn_Create void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 63 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 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 Classification r_cg_serial_user c Syntax __interrupt static void r_csimn_interrupt void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 64 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Siart Sets CSI communication to standby mode Classification r_cg_serial c Syntax void R_CSImn_Start void Remark mis the unit number and nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 65 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_CSImn_Stop Ends CSI communication Classification r_cg_serial c Syntax void R_CSImn_Stop void Remark mis the unit number and nis the channel number Argume
119. struct uint8_t Sec second uint8_t Min Minute rtc_counter_value_t uint8_t Hour Hour uint8_t Day Day uint8_t Week Weekday 0 Sunday 6 Saturday uint8_t Month Month uint8_t Year Year rtc_counter_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 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 R20UT0758EJ0100 Rev 1 00 2tENESAS Page 199 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Get_CounterValue Reads the counter value year month weekday day hour minute second of the real time clock Classification r_cg_rtc c Syntax include Yr cg _macrodriver h include yr ogurta h MD_STATUS R_RTC_Get_CounterValue rtc_counter_value_t counter_read_val j Argument s rtc_counter_value_t Pointer to structure in which to store the counter value being read counter_read_val Remark See R_RIC_ Set CounterValue for details about the rtc_counter_value_t counter value Return value Macro Description MD_OK Normal completion MD_BUSY1 Executing count proces
120. t void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 214 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS Performs processing in response to the interval timer interrupt INTIT Remark This API function is called as the interrupt process corresponding to the interval timer interrupt INTIT Classification r_cg_it_user c Syntax __interrupt static void r_it_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 215 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IT_Start Starts the count of the interval timer Classification r_cg_it c Syntax void R_IT_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 216 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IT_Stop Ends the count of the interval timer Classification r_cg_it c Syntax void R_IT_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 217 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IT_Set_PowerOff Halts the clock supplied to the interval timer Remark Calling this API function changes the interval timer to reset status For this reason writes to the control reg isters after this API function is called are ignored Classifica
121. t_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 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 ztENESAS Page 191 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Create Performs initialization necessary to control real time clock functions Classification r_cg_ric c Syntax void R_RTC_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 192 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_rtc_user c Syntax void R_RTC_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 193 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS Performs processing in response to the real time clock interrupt INTRTC Remark This API function is called as the interrupt process corresponding to the real time clock interrupt INTRTC Classification r_cg_rtc_user c Syntax __interrupt static
122. tion r_cg_it c Syntax void R_IT_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 218 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 11 Comparator Below is a list of API functions output by the Applilet3 for comparator use Table 3 12 API Functions Comparator API Function Name Function R_COMP_Create Performs initialization necessary to control the comparator functions R_COMP_Create_Userlnit 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 R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 219 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_COMP Create Performs initialization necessary to control the comparator functions Classification r_cg_comp c Syntax void R_COMP_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 220 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_COMP _Create_Userlnit Performs user defined initialization relating
123. tn_callback_softwareoverrun Performs processing in response to detection of overrun error R_CSImn_Create Performs initialization of the serial interface CSI channel r_csimn_interrupt Performs processing in response to the CSI communication end interrupt INTCSImn R_CSImn_Start Sets CSI communication to standby mode R_CSImn_Stop Ends CSI communication R_CSImn_Send Starts CSI data transmission R_CSImn_Receive Starts CSI data reception R_CSImn_Send_Receive Starts CSI data transmission reception r_csimn_callback_sendend Performs processing in response to the CSI transmission end interrupt INTCSImn 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 of the serial interface simple IIC channel r_iicmn_interrupt R20UT0758EJ0100 Rev 1 00 Oct 01 2011 Performs processing in response to the simple IIC communication end inter rupt INTIICmn ztENESAS Page 43 of 267 Applilet3 CHAPTER 3 API FUNCTIONS API Function Name Function R_IlCmn_StartCondition Generates start conditions R_IICmn_StopCondition Generates stop conditions R_IICmn_Stop Ends simple IIC communication R_IICmn_Master_Send Starts simple IIC master transm
124. to the comparator Remark This API function is called as the R COMP Create callback routine Classification r_cg_comp_user c Syntax void R_COMP_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 221 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_compn_interrupt Performs processing in response to the comparator interrupt INTCMPn Remark This API function is called as the interrupt process corresponding to the comparator interrupt INTCMPn Classification r_cg_comp_user c Syntax __interrupt static void r_compn_interrupt void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 222 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_COMPn Start Begins comparison of reference input voltage and analog input voltage Classification r_cg_comp c Syntax void R_COMPn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 223 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_COMPn_Stop Stops comparison of reference input voltage and analog input voltage Classification r_cg_comp c Syntax void R_COMPn_Stop void Remark nis the channel number Argument s None Return value
125. troller Classification r_cg_dtc c Syntax void R_DTCn_Start void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 234 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DTCn_Stop Disables operation of the data transfer controller Classification r_cg_dtc c Syntax void R_DTCn_Stop void Remark nis the channel number Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 235 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_DTC_Set_PowerOff Halts the clock supplied to the data transfer controller Remark Calling this API function changes the data transfer controller to reset status For this reason writes to the control registers after this API function is called are ignored Classification r_cg_dtc c Syntax void R_DTC_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 236 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 14 Event Link Controller Below is a list of API functions output by the Applilet3 for event link controller use Table 3 15 API Functions Event Link Controller API Function Name Function R_ELC_Create Performs initialization necessary to control the event link controller functions R_ELC_Cr
126. turn value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 211 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS 3 3 10 Interval Timer Below is a list of API functions output by the Applilet3 for interval timer use Table 3 11 API Functions Interval Timer API Function Name Function R_IT_Create Performs initialization necessary to control interval timer functions R_IT_Create_Userlnit Performs user defined initialization relating to the interval timer r_it_interrupt Performs processing in response to the interval timer interrupt INTIT R_IT_Start Starts the count of the interval timer R_IT_Stop Ends the count of the interval timer R_IT_Set_PowerOff Halts the clock supplied to the interval timer R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 212 of 267 Applilet3 CHAPTER 3 API FUNCTIONS R_IT_Create Performs initialization necessary to control interval timer functions Classification r_cg_it c Syntax void R_IT_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 213 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_IT_Create_Userlnit Performs user defined initialization relating to the interval timer Remark This API function is called as the R_IT Create callback routine Classification r_cg_it_user c Syntax void R_IT_Create_UserIni
127. ue MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 90 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_callback_sendend Performs processing in response to the DALI transmission end interrupt INTSTDLn Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_send corresponding to the DALI transmission end interrupt INTSTDLn performed when number of transmission data specified by R_DALIn_Send parameter tx_num has been completed Classification r_cg_serial_user c Syntax static void r_dalin_callback_sendend void Remark nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 91 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_dalin_callback_receiveend Performs processing in response to the DALI reception end interrupt INTSRDLn Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond ing to the DALI reception end interrupt INTSRDLn performed when number of received data specified by R_DALIn_Receive parameter rx_num has been completed Classification r_cg_serial_user c Syntax static void r_dalin_callback_receiveend void Remark nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 zt
128. value MD_OK Normal completion MD_ARGERROR Invalid argument specification R20UT0758EJ0100 Rev 1 00 ztENESAS Page 69 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_csimn_callback_sendend Performs processing in response to the CSI transmission end interrupt INTCSImn Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to the CSI transmission end interrupt INTCSImn performed when number of transmission data specified by R_CSImn_Send or R_CSIlmn_Send_Receive parameter tx_num has been completed Classification r_cg_serial_user c Syntax static void r_csimn_callback_sendend void Remark mis the unit number and nis the channel number Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 ztENESAS Page 70 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS r_csimn_callback_receiveend Performs processing in response to the CSI reception end interrupt INTCSImn Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to the CSI reception end interrupt INTCSImn performed when number of received data specified by R_CSImn_Receive or R_CSlmn_Send_Receive parameter rx_num has been completed Classification r_cg_serial_user c Syntax static void r_csimn_callback_receiveend void Remark mis the unit number and nis the channel number Ar
129. value_t alarm_val Remark See R_RIC_ Set AlarmValue for details about rtc_alarm_value_t alarm conditions Argument s VO Argument Description O rtc_alarm_value_t alarm val Pointer to structure in which to store the conditions being read Return value None R20UT0758EJ0100 Rev 1 00 Oct 01 2011 2tENESAS Page 208 of 267 Applilet3 CHAPTER 3 API FUNCTIONS r_rtc_callback_alarm Performs processing in response to the alarm interrupt INTRTC Remark This API function is called as the callback routine of interrupt process r_ric_interrupt corresponding to the alarm interrupt INTRTC Classification r_cg_rtc_user c Syntax static void r_rtc_callback_alarm void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 209 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_RTC1HZOn Enables output of the correction clock 1 Hz to the RTC1HZ pin Classification r_cg_ric c Syntax void R_RTC_Set_RTC1HZOn void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 210 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_RTC1HZOff Disables output of the correction clock 1 Hz to the RTC1HZ pin Classification r_cg_ric c Syntax void R_RTC_Set_RTC1HZ0ff void Argument s None Re
130. void rortc_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 194 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Siart Starts the count of the real time clock year month weekday day hour minute second Classification r_cg_ric c Syntax void R_RTC_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 195 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Stop Ends the count of the real time clock year month weekday day hour minute second Classification r_cg_ric c Syntax void R_RTC_Stop void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 196 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_PowerOff Halts the clock supplied to the real time clock Remark 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 Classification r_cg_rtic c Syntax void R_RTC_Set_PowerOff void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 197 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_RTC_Set_HourSystem Sets the clock type 12 hour or 24 hour clock of the
131. y to control the 16 bit timer RGO functions Classification r_cg_timer c Syntax void R_TMR_RGO_Create void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 158 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer_user c Syntax void R_TMR_RGO_Create_UserInit void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 159 of 267 Oct 01 2011 Applilet3 CHAPTER 3 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 Classification r_cg_timer_user c Syntax __interrupt static void r_tmr_rgO_interrupt void Argumenit s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 160 of 267 Oct 01 2011 Applilet3 CHAPTER 3 API FUNCTIONS R_TMR_RGO_Start Starts the count for 16 bit timer RGO Classification r_cg_timer c Syntax void R_TMR_RGO_Start void Argument s None Return value None R20UT0758EJ0100 Rev 1 00 2tENESAS Page 161 of 267 Oct 01 2011 Applilet3 CHAPTE
Download Pdf Manuals
Related Search
Related Contents
Aroma AAP-340F electrical kettle HP ProBook 4340s Instructions d`installation de mise en marche et de Kenwood AT445 Deutsche Telekom LG Cookie KP501 3" 89g Black Manual de Operação / Manutenção Toshiba Satellite L55-B5255 Télécharger Copyright © All rights reserved.
Failed to retrieve file