R20ut2711ej0100 Aprl78
R20ut2711ej0100 Aprl78
R20ut2711ej0100 Aprl78
Applilet3
Device Driver Configurator
User's Manual: RL78 API Reference
Target Device
RL78 Family
All information contained in these materials, including products and product specifications,
represents information on the product at the time of publication and is subject to change by
Renesas Electronics Corp. without notice. Please review the latest information published by
Renesas Electronics Corp. through various means, including the Renesas Electronics Corp.
website (http://www.renesas.com).
(2012.4)
How to Use This Manual
Readers 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.
Purpose This manual understands the software function of Applilet3 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.
CHAPTER 1 GENERAL
CHAPTER 2 OUTPUT FILES
CHAPTER 3 API FUNCTIONS
How to Read This Manual 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.
Conventions Note: Footnote for item marked with Note in the text
Caution: Information requiring particular attention
Remark: Supplementary information
Numeric representation: Decimal ... XXXX
Hexadecimal ... XXXXH or 0xXXXX
All trademarks or registered trademarks in this document are the property of their respective owners.
TABLE OF CONTENTS
CHAPTER 1 GENERAL
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.
- 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 Applilet3 and the API functions contained in
the source code.
2.1 Description
Below is a list of output file files by the Applilet3.
r_systeminit.c hdwinit
__low_level_init
R_Systeminit
r_cg_macrodriver.h -
r_cg_userdefine.h -
r_option_ca.txt -
md_lnkxxx_xx_xcl -
r_cg_cgc_user.c R_CGC_Create_UserInit
r_cgc_ram_ecc_interrupt
r_cgc_stackpointer_interrupt
r_cgc_clockmonitor_interrupt
R_CGC_Get_ResetSource
r_cg_cgc.h -
r_cg_port_user.c R_PORT_Create_UserInit
r_cg_port.h -
r_cg_timer_user.c R_TAUm_Create_UserInit
r_taum_channeln_interrupt
r_taum_channeln_higher8bits_interrupt
r_cg_timer.h -
r_cg_timer_user.c R_TMR_RJ0_Create_UserInit
r_tmr_rj0_interrupt
r_cg_timer.h -
r_cg_timer_user.c R_TMR_RDn_Create_UserInit
r_tmr_rdn_interrupt
r_cg_timer.h -
r_cg_timer_user.c R_TMR_RG0_Create_UserInit
r_tmr_rg0_interrupt
r_cg_timer.h -
r_cg_timer_user.c R_TMR_KBm_Create_UserInit
r_tmr_kbm_interrupt
r_cg_timer.h -
r_cg_timer_user.c R_TMR_KC0_Create_UserInit
r_tmr_kc0_interrupt
r_cg_timer.h -
r_cg_rtc_user.c R_RTC_Create_UserInit
r_rtc_interrupt
r_rtc_callback_constperiod
r_rtc_callback_alarm
r_cg_rtc.h -
r_cg_it_user.c R_IT_Create_UserInit
r_it_interrupt
r_cg_it.h -
r_cg_timer_user.c R_WUTM_Create_UserInit
r_wutm_interrupt
r_cg_timer.h -
r_cg_pclbuz_user.c R_PCLBUZn_Create_UserInit
r_cg_pclbuz.h -
r_cg_wdt_user.c R_WDT_Create_UserInit
r_wdt_interrupt
r_cg_wdt.h -
r_cg_adc_user.c R_ADC_Create_UserInit
r_adc_interrupt
r_cg_adc.h -
r_cg_dac_user.c R_DAC_Create_UserInit
r_cg_dac.h -
r_cg_pga_user.c R_PGA_Create_UserInit
r_cg_pga.h -
r_cg_comp_user.c R_COMP_Create_UserInit
r_compn_interrupt
r_cg_comp.h -
r_cg_serial_user.c R_SAUm_Create_UserInit
r_uartn_interrupt_send
r_uartn_interrupt_receive
r_uartn_interrupt_error
r_uartn_callback_sendend
r_uartn_callback_receiveend
r_uartn_callback_error
r_uartn_callback_softwareoverrun
r_csimn_interrupt
r_csimn_callback_sendend
r_csimn_callback_receiveend
r_csimn_callback_error
r_iicmn_interrupt
r_iicmn_callback_master_sendend
r_iicmn_callback_master_receiveend
r_iicmn_callback_master_error
r_cg_serial.h -
r_cg_serial_user.c r_dalin_interrupt_send
r_dalin_interrupt_receive
r_dalin_interrupt_error
r_dalin_callback_sendend
r_dalin_callback_receiveend
r_dalin_callback_error
r_dalin_callback_softwareoverrun
r_cg_serial.h -
r_cg_serial_user.c R_UARTFn_Create_UserInit
r_uartfn_interrupt_send
r_uartfn_interrupt_receive
r_uartfn_interrupt_error
r_uartfn_callback_sendend
r_uartfn_callback_receiveend
r_uartfn_callback_error
r_uartfn_callback_softwareoverrun
r_uartfn_callback_expbitdetect
r_uartfn_callback_idmatch
r_cg_serial.h -
r_cg_serial_user.c R_IICAn_Create_UserInit
r_iican_interrupt
r_iican_callback_master_sendend
r_iican_callback_master_receiveend
r_iican_callback_master_error
r_iican_callback_slave_sendend
r_iican_callback_slave_receiveend
r_iican_callback_slave_error
r_iican_callback_getstopcondition
r_cg_serial.h -
r_cg_lcd_user.c R_LCD_Create_UserInit
r_lcd_interrupt
r_cg_lcd.h -
r_cg_sg_user.c R_SG_Create_UserInit
r_sg_interrupt
r_cg_sg.h -
r_cg_dmac_user.c R_DMACn_Create_UserInit
R_DMAC_Create_UserInit
r_dmacn_interrupt
r_cg_dmac.h -
r_cg_dtc_user.c R_DTC_Create_UserInit
r_cg_dtc.h -
r_cg_elc_user.c R_ELC_Create_UserInit
r_cg_elc.h -
r_cg_intc_user.c R_INTC_Create_UserInit
r_intcn_interrupt
r_intclrn_interrupt
r_cg_intc.h -
r_cg_intc_user.c R_KEY_Create_UserInit
r_key_interrupt
r_cg_intc.h -
r_cg_lvd_user.c R_LVD_Create_UserInit
r_lvd_interrupt
r_cg_lvd.h -
3.1 Overview
Below are the naming conventions for API functions output by the Applilet3.
- 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.
(1) .........
(2) .......................................................................................................................................
...........................
(3) [Syntax]
... .........
(4) [Argument(s)]
I/O Argument Description
...........................
......... ..................................................................................................................
...........................
(1) Name
Indicates the name of the API function.
(2) Outline
Outlines the functions of the API function.
(3) [Syntax]
Indicates the format to be used when describing an API function to be called in C language.
(4) [Argument(s)]
API function arguments are explained in the following format.
(a) I/O
Argument classification
I ... Input argument
O ... Output argument
(b) Argument
Argument data type
(c) Description
Description of argument
Macro Description
(a) (b)
(a) Macro
Macro of return value
(b) Description
Description of return value
3.2.1 Common
Below is a list of API functions output by the Applilet3 for common use.
hdwinit
Remark Call this API function from the startup routine for Renesas Electronics compiler.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
__low_level_init
Remark Call this API function from the startup routine for IAR compiler.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_Systeminit
Remark This API function is called as the hdwinit, __low_level_init callback routine.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
main
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_MAIN_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_Create Performs initialization required to control the clock generator (include reset
function, on-chip debug function, etc.).
R_CGC_Create
Performs initialization required to control the clock generator (include reset function, on-chip debug function, etc.).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_Create_UserInit
Performs user-defined initialization relating to the clock generator (include reset function, on-chip debug function, etc.).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_cgc_ram_ecc_interrupt
Performs processing in response to the RAM 1-bit correction/2-bit error detection interrupt INTRAM.
Remark This API function is called as the interrupt process corresponding to the RAM 1-bit correction/2-bit error
detection interrupt INTRAM.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_cgc_stackpointer_interrupt
Remark This API function is called as the interrupt process corresponding to the stack pointer overflow/underflow
interrupt INTSPM.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_cgc_clockmonitor_interrupt
Remark This API function is called as the interrupt process corresponding to the clock monitor interrupt INTCLM.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_Get_ResetSource
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_Set_ClockMode
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_cgc.h"
MD_STATUS R_CGC_Set_ClockMode ( clock_mode_t mode );
[Argument(s)]
[Return value]
Macro Description
R_CGC_Set_CRCOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_RAMECC_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_RAMECC_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_StackPointer_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_StackPointer_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_ClockMonitor_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CGC_ClockMonitor_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PORT_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PORT_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Get_PulseWidth Captures the high/low-level width measured between pulses of the signal
(pulses) input to the TImn pin.
R_TAUm_Channeln_Set_SoftwareTriggerOn Generates the trigger (software trigger) for one-shot pulse output.
R_TAUm_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_taum_channeln_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTMmn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_taum_channeln_higher8bits_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt INTTMmnH.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Start
Remark The time from the call to this API function to the start of counting depends on the type of the function in
question (e.g. interval timer, square-wave output, or external event counter).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Higher8bits_Start
Remark This API function can only be called when the timer array unit is used as a 8-bit timer.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Lower8bits_Start
Remarks 1. This API function can only be called when the timer array unit is used as a 8-bit timer.
2. The time from the call to this API function to the start of counting depends on the type of the function in
question (e.g. interval timer, external event counter, or delay counter).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Higher8bits_Stop
Remark This API function can only be called when the timer array unit is used as a 8-bit timer.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Lower8bits_Stop
Remark This API function can only be called when the timer array unit is used as a 8-bit timer.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Set_PowerOff
Remark Calling this API function changes the timer array unit to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TAUm_Channeln_Get_PulseWidth
Captures the high/low-level width measured between pulses of the signal (pulses) input to the TImn pin.
[Syntax]
#include "r_cg_macrodriver.h"
void R_TAUm_Channeln_Get_PulseWidth ( uint32_t * const width );
[Argument(s)]
O uint32_t * const width; Pointer to an area to store the measurement width (0x0 to 0x1FFFF)
[Return value]
None.
R_TAUm_Channeln_Set_SoftwareTriggerOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
3.2.5 Timer RJ
Below is a list of API functions output by the Applilet3 for timer RJ use.
R_TMR_RJ0_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RJ0_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_tmr_rj0_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RJ0_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RJ0_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RJ0_Set_PowerOff
Remark Calling this API function changes the 16-bit timer RJ0 to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RJ0_Get_PulseWidth
Remarks 1. This API function can only be called when the 16-bit timer RJ0 is being used for pulse width
measurement mode / pulse period measurement mode.
2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not
be read correctly.
[Syntax]
#include "r_cg_macrodriver.h"
void R_TMR_RJ0_Get_PulseWidth ( uint32_t * const active_width );
[Argument(s)]
O uint32_t * const active_width; Pointer to an area storing the active level width that was read from the
TRJ0IO pin
[Return value]
None.
3.2.6 Timer RD
Below is a list of API functions output by the Applilet3 for timer RD use.
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_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_tmr_rdn_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_Set_PowerOff
Remark Calling this API function changes the 16-bit timer RDn to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_ForcedOutput_Start
Starts the pulse output forced cutoff for 16-bit timer RDn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_ForcedOutput_Stop
Ends the pulse output forced cutoff for 16-bit timer RDn.
Remark This API function can only be called when the 16-bit timer RDn is the count to stopped (the TSTART bit in
the timer RD start register (TRDSTR) is 0).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RDn_Get_PulseWidth
Remarks 1. This API function can only be called when the 16-bit timer RDn is being used for input capture function.
2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not
be read correctly.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_timer.h"
MD_STATUS R_TMR_RDn_Get_PulseWidth ( uint32_t * const active_width, uint32_t * const
inactive_width, timer_channel_t channel );
[Argument(s)]
O uint32_t Pointer to an area storing the active level width that was read
* const active_width;
O uint32_t Pointer to an area storing the inactive level width that was read
* const inactive_width;
[Return value]
Macro Description
3.2.7 Timer RG
Below is a list of API functions output by the Applilet3 for timer RG use.
R_TMR_RG0_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RG0_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_tmr_rg0_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RG0_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RG0_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RG0_Set_PowerOff
Remark Calling this API function changes the 16-bit timer RG0 to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_RG0_Get_PulseWidth
Remarks 1. This API function can only be called when the 16-bit timer RG0 is being used for input capture function.
2. If there is an overflow (2 pulses or more) during pulse-width measurement, then the pulse width will not
be read correctly.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_timer.h"
MD_STATUS R_TMR_RG0_Get_PulseWidth ( uint32_t * const active_width, uint32_t * const
inactive_width, timer_channel_t channel );
[Argument(s)]
O uint32_t Pointer to an area storing the active level width that was read from the
* const active_width; TRGIOA pin
O uint32_t Pointer to an area storing the inactive level width that was read from
* const inactive_width; the TRGIOA pin
[Return value]
Macro Description
R_TMR_KBmn_ForcedOutput_Start Enables input of the trigger signal used for the forced output stop function.
R_TMR_KBmn_ForcedOutput_Stop Disables input of the trigger signal used for the forced output stop function.
R_TMR_KB_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBm_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_tmr_kbm_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBm_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBm_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBm_Set_PowerOff
Remark Calling this API function changes the 16-bit timer KB to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBmn_ForcedOutput_Start
Enables input of the trigger signal used for the forced output stop function.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBmn_ForcedOutput_Stop
Disables input of the trigger signal used for the forced output stop function.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KBm_BatchOverwriteRequestOn
Remark The timing for batch-overwriting the content of the compare register is when a count value and a value set in
the compare register are matched or an external trigger is generated after calling this API function.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KC0_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KC0_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_tmr_kc0_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KC0_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KC0_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_TMR_KC0_Set_PowerOff
Remark Calling this API function changes the 16-bit timer KC0 to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_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_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_RTC1HZOn Enables output of the correction clock (1 Hz) to the RTC1HZ pin.
R_RTC_Set_RTC1HZOff Disables output of the correction clock (1 Hz) to the RTC1HZ pin.
R_RTC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_rtc_interrupt
Remark This API function is called as the interrupt process corresponding to the real-time clock interrupt INTRTC.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Start
Starts the count of the real-time clock (year, month, weekday, day, hour, minute, second).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Stop
Ends the count of the real-time clock (year, month, weekday, day, hour, minute, second).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_PowerOff
Remarks 1. Calling this API function changes the real-time clock to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
2. This API function stops the clock supply to the real-time clock, by operating the RTCEN bit of peripheral
enable register n.
For this reason, this API function also stops the clock supply to other peripheral devices sharing the
RTCEN bit (e.g. interval timer).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_HourSystem
Sets the clock type (12-hour or 24-hour clock) of the real-time clock.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
MD_STATUS R_RTC_Set_HourSystem ( rtc_hour_system_t hour_system );
[Argument(s)]
[Return value]
Macro Description
Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the
counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in
the header file "r_cg_rtc.h" larger.
R_RTC_Set_CounterValue
Sets the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
MD_STATUS R_RTC_Set_CounterValue ( rtc_counter_value_t counter_write_val );
[Argument(s)]
Remark Below is an example of the structure rtc_counter_value_t (counter value) for the real-time clock.
typedef struct {
uint8_t sec; /* second */
uint8_t min; /* Minute */
uint8_t hour; /* Hour */
uint8_t day; /* Day */
uint8_t week; /* Weekday (0: Sunday, 6: Saturday) */
uint8_t month; /* Month */
uint8_t year; /* Year */
} rtc_counter_value_t;
[Return value]
Macro Description
Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the
counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in
the header file "r_cg_rtc.h" larger.
R_RTC_Get_CounterValue
Reads the counter value (year, month, weekday, day, hour, minute, second) of the real-time clock.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
MD_STATUS R_RTC_Get_CounterValue ( rtc_counter_value_t * const counter_read_val );
[Argument(s)]
O rtc_counter_value_t Pointer to structure in which to store the counter value being read
* const counter_read_val;
Remark See R_RTC_Set_CounterValue for details about the rtc_counter_value_t counter value.
[Return value]
Macro Description
Remark If MD_BUSY1 or MD_BUSY2 is returned, it may be because the counter-operation is stopped, or the
counter operation start wait time is too short, so make the value of the RTC_WAITTIME macro defined in
the header file "r_cg_rtc.h" larger.
R_RTC_Set_ConstPeriodInterruptOn
Sets the cycle of the interrupts INTRTC, then starts the cyclic interrupt function.
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
MD_STATUS R_RTC_Set_ConstPeriodInterruptOn ( rtc_int_period_t period );
[Argument(s)]
[Return value]
Macro Description
R_RTC_Set_ConstPeriodInterruptOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_rtc_callback_constperiod
Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the
cyclic interrupt INTRTC.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_AlarmOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_AlarmOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_AlarmValue
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
void R_RTC_Set_AlarmValue ( rtc_alarm_value_t alarm_val );
[Argument(s)]
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.
7 4 3 0
- alarmwh (Hour)
Below are shown the meanings of each bit of the structure member alarmwh.
If the real-time clock is set to the 12-hour clock, then bit 5 has the following meaning.
0: AM
1: PM
7 6 5 4 3 0
- 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.
R_RTC_Get_AlarmValue
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_rtc.h"
void R_RTC_Get_AlarmValue ( rtc_alarm_value_t * const alarm_val );
[Argument(s)]
[Return value]
None.
r_rtc_callback_alarm
Remark This API function is called as the callback routine of interrupt process r_rtc_interrupt corresponding to the
alarm interrupt INTRTC.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_RTC1HZOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_RTC_Set_RTC1HZOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_it_interrupt Performs processing in response to the 12-bit interval timer interrupt INTIT.
R_IT_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IT_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_it_interrupt
Remark This API function is called as the interrupt process corresponding to the 12-bit interval timer interrupt INTIT.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IT_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IT_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IT_Set_PowerOff
Remarks 1. Calling this API function changes the 12-bit interval timer to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
2. This API function stops the clock supply to the 12-bit interval timer, by operating the RTCEN bit of
peripheral enable register n.
For this reason, this API function also stops the clock supply to other peripheral devices sharing the
RTCEN bit (e.g. real-timer clock).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WUTM_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WUTM_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_wutm_interrupt
Remark This API function is called as the interrupt process corresponding to the timer interrupt.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WUTM_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WUTM_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WUTM_Set_PowerOff
Remark Calling this API function changes the 16-bit wakeup timer to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PCLBUZn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PCLBUZn_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PCLBUZn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PCLBUZn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PCLBUZ_Set_PowerOff
Remarks 1. Calling this API function changes the clock/buzzer output controller to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
2. This API function stops the clock supply to the clock/buzzer output controller, by operating the RTCEN
bit of peripheral enable register n.
For this reason, this API function also stops the clock supply to other peripheral devices sharing the
RTCEN bit (e.g. real-time clock).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WDT_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WDT_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_wdt_interrupt
Remark This API function is called as the interrupt process corresponding to the interval interrupt INTWDTI.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_WDT_Restart
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_adc_interrupt Performs processing in response to the A/D conversion end interrupt INTAD.
R_ADC_Set_ADChannel Configures the analog voltage input pin for A/D conversion.
R_ADC_Get_Result_8bit Reads the results of A/D conversion (8 bits; most significant 8 bits of 10-bit res-
olution).
R_ADC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_adc_interrupt
Remark This API function is called as the interrupt process corresponding to the A/D conversion end interrupt
INTAD.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_OperationOn
Remarks 1. About 1 microsecond of stabilization time is required when changing the voltage converter from opera-
tion stopped to operation enabled status.
Consequently, about 1 micro second must be left free between the call to this API function and the call
to R_ADC_Start.
2. On the [A/D Converter], in the [Comparator operation setting] area, if "Operation" is selected, then the
voltage converter will be switched to "always on".
There is thus no need to call this API function in this case.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_OperationOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Start
Remark About 1 micro second of stabilization time is required when changing the voltage converter from operation
stopped to operation enabled status.
Consequently, about 1 micro second must be left free between the call to R_ADC_Set_OperationOn and
the call to this API function.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Stop
Remark The voltage converter continues to operate after the process of this API function completes.
Consequently, to stop the operation of the voltage converter, you must call R_ADC_Set_OperationOff after
the process of this API function completes.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_PowerOff
Remark Calling this API function changes the A/D converter to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_ADChannel
Remark The value specified in argument channel is set to analog input channel specification register (ADS).
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_adc.h"
MD_STATUS R_ADC_Set_ADChannel ( ad_channel_t channel );
[Argument(s)]
Remark See the header file r_cg_adc.h for details about the analog voltage input pin ADCHANNELn.
[Return value]
Macro Description
R_ADC_Set_SnoozeOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_SnoozeOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ADC_Set_TestChannel
[Syntax]
#include "r_cg_macrodriver.h"
#include "r_cg_adc.h"
MD_STATUS R_ADC_Set_TestChannel ( test_channel_t channel );
[Argument(s)]
[Return value]
Macro Description
R_ADC_Get_Result
[Syntax]
#include "r_cg_macrodriver.h"
void R_ADC_Get_Result ( uint16_t * const buffer );
[Argument(s)]
O uint16_t * const buffer; Pointer to area in which to store read results of A/D conversion
[Return value]
None.
R_ADC_Get_Result_8bit
Reads the results of A/D conversion (8 bits; most significant 8 bits of 10-bit resolution).
[Syntax]
#include "r_cg_macrodriver.h"
void R_ADC_Get_Result_8bit ( uint8_t * const buffer );
[Argument(s)]
O uint8_t * const buffer; Pointer to area in which to store the results of A/D conversion
15 8 7 0
B10 B9 B8 B7 B6 B5 B4 B3 B2 B1
[Return value]
None.
R_DAC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DAC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DACn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DACn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DAC_Set_PowerOff
Remark Calling this API function changes the D/A converter to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DACn_Set_ConversionValue
[Syntax]
#include "r_cg_macrodriver.h"
void R_DACn_Set_ConversionValue ( uint8_t reg_value );
[Argument(s)]
[Return value]
None.
R_PGA_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PGA_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PGA_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_PGA_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
3.2.18 Comparator
Below is a list of API functions output by the Applilet3 for comparator use.
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_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_COMP_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_compn_interrupt
Remark This API function is called as the interrupt process corresponding to the comparator interrupt INTCMPn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_COMPn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_COMPn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_COMP_Set_PowerOff
Remark Calling this API function changes the comparator to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_interrupt_receive Performs processing in response to the UART reception end interrupt INTSRn.
r_uartn_callback_receiveend Performs processing in response to the UART reception end interrupt INTSRn.
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_interrupt Performs processing in response to the simple IIC communication end inter-
rupt INTIICmn.
r_iicmn_callback_master_sendend Performs processing in response to the simple IICmn master transmission end
interrupt INTIICmn.
r_iicmn_callback_master_receiveend Performs processing in response to the simple IICmn master reception end
interrupt INTIICmn.
R_SAUm_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SAUm_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SAUm_Set_PowerOff
Remark Calling this API function changes the serial array unit to reset status.
For this reason, writes to the control registers (e.g. serial clock select register n: SPSn) after this API func-
tion is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SAUm_Set_SnoozeOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SAUm_Set_SnoozeOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_interrupt_send
Remark This API function is called as the interrupt process corresponding to the UART transmission end interrupt
INTSTn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_interrupt_receive
Remark This API function is called as the interrupt process corresponding to the UART reception end interrupt
INTSRn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_interrupt_error
Remark This API function is called as the interrupt process corresponding to the reception error interrupt INTSREn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTn_Send
Remarks 1. This API function repeats the byte-level UART transmission from the buffer specified in argument
tx_buf the number of times specified in argument tx_num.
2. When performing a UART transmission, R_UARTn_Start must be called before this API function is
called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_UARTn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
[Argument(s)]
[Return value]
Macro Description
R_UARTn_Receive
Remarks 1. This API function performs byte-level UART reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
2. Actual UART reception starts after this API function is called, and R_UARTn_Start is then called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_UARTn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
[Argument(s)]
[Return value]
Macro Description
r_uartn_callback_sendend
Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_send corresponding
to the UART transmission end interrupt INTSTn (performed when number of transmission data specified by
R_UARTn_Send argument tx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_callback_receiveend
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 argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartn_callback_error
Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error corresponding
to the UART reception error interrupt INTSREn.
[Syntax]
#include "r_cg_macrodriver.h"
static void r_uartn_callback_error ( uint8_t err_type );
[Argument(s)]
[Return value]
None.
r_uartn_callback_softwareoverrun
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 argument rx_num specified for R_UARTn_Receive).
[Syntax]
#include "r_cg_macrodriver.h"
static void r_uartn_callback_softwareoverrun ( uint16_t rx_data );
[Argument(s)]
O uint16_t rx_data; Receive data (greater than the argument rx_num specified for
R_UARTn_Receive)
[Return value]
None.
R_CSImn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_csimn_interrupt
Remark This API function is called as the interrupt process corresponding to the CSI communication end interrupt
INTCSImn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CSImn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CSImn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_CSImn_Send
Remarks 1. This API function repeats the byte-level CSI transmission from the buffer specified in argument tx_buf
the number of times specified in argument tx_num.
2. When performing a CSI transmission, R_CSImn_Start must be called before this API function is called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_CSImn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
[Argument(s)]
[Return value]
Macro Description
R_CSImn_Receive
Remarks 1. This API function performs byte-level CSI reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
2. When performing a CSI reception, R_CSImn_Start must be called before this API function is called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_CSImn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
[Argument(s)]
[Return value]
Macro Description
R_CSImn_Send_Receive
Remarks 1. This API function repeats the byte-level CSI transmission from the buffer specified in argument tx_buf
the number of times specified in argument tx_num.
2. This API function performs byte-level CSI reception the number of times specified by the argument
tx_num, and stores the data in the buffer specified by the argument rx_buf.
3. When performing a CSI reception, R_CSImn_Start must be called before this API function is called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_CSImn_Send_Receive ( uint8_t * const tx_buf, uint16_t tx_num, uint8_t * const
rx_buf );
[Argument(s)]
[Return value]
Macro Description
r_csimn_callback_sendend
Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to
the CSI transmission end interrupt INTCSImn (performed when number of transmission data specified by
R_CSImn_Send or R_CSImn_Send_Receive argument tx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_csimn_callback_receiveend
Remark This API function is called as the callback routine of interrupt process r_csimn_interrupt corresponding to
the CSI reception end interrupt INTCSImn (performed when number of received data specified by
R_CSImn_Receive or R_CSImn_Send_Receive argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_csimn_callback_error
Remark This API function is called as the callback routine of interrupt process r_uartn_interrupt_error corresponding
to the CSI reception error interrupt INTSREn.
[Syntax]
#include "r_cg_macrodriver.h"
static void r_csimn_callback_error ( uint8_t err_type );
[Argument(s)]
[Return value]
None.
R_IICmn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iicmn_interrupt
Performs processing in response to the simple IIC communication end interrupt INTIICmn.
Remark This API function is called as the interrupt process corresponding to the simple IIC communication end
interrupt INTIICmn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICmn_StartCondition
Remark This API function is used as an internal function of R_IICmn_Master_Send and R_IICmn_Master_Receive.
For this reason, there is normally no need to call it from a user program.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICmn_StopCondition
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICmn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICmn_Master_Send
Remark This API function repeats the byte-level simple IIC master transmission from the buffer specified in
argument tx_buf the number of times specified in argument tx_num.
[Syntax]
#include "r_cg_macrodriver.h"
void R_IICmn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num );
[Argument(s)]
Remark Below is shown the format for specifying device address adr.
7 0
B7 B6 B5 B4 B3 B2 B1 B0
Slave address
Device type
Device address
[Return value]
None.
R_IICmn_Master_Receive
Remark This API function performs byte-level simple IIC master reception the number of times specified by the
argument rx_num, and stores the data in the buffer specified by the argument rx_buf.
[Syntax]
#include "r_cg_macrodriver.h"
void R_IICmn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num );
[Argument(s)]
Remark Below is shown the format for specifying device address adr.
7 0
B7 B6 B5 B4 B3 B2 B1 B0
Slave address
Device type
Device address
[Return value]
None.
r_iicmn_callback_master_sendend
Performs processing in response to the simple IICmn master transmission end interrupt INTIICmn.
Remark This API function is called as the callback routine of interrupt process r_iicmn_interrupt corresponding to the
simple IICmn master transmission end interrupt INTIICmn (performed when number of transmission data
specified by R_IICmn_Master_Send argument tx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iicmn_callback_master_receiveend
Performs processing in response to the simple IICmn master reception end interrupt INTIICmn.
Remark This API function is called as the callback routine of interrupt process r_iicmn_interrupt corresponding to the
simple IICmn master reception end interrupt INTIICmn (performed when number of received data specified
by R_IICmn_Master_Receive argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iicmn_callback_master_error
[Syntax]
#include "r_cg_macrodriver.h"
static void r_iicmn_callback_master_error ( MD_STATUS flag );
[Argument(s)]
[Return value]
None.
R_DALIn_Create Performs initialization necessary to control the serial array unit 4 (DALI/
UART4).
R_DALIn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dalin_interrupt_send
Remark This API function is called as the interrupt process corresponding to the DALI transmission end interrupt
INTSTDLn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dalin_interrupt_receive
Remark This API function is called as the interrupt process corresponding to the DALI reception end interrupt
INTSRDLn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dalin_interrupt_error
Remark This API function is called as the interrupt process corresponding to the DALI reception error interrupt
INTSREDLn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DALIn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DALIn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DALIn_Send
Remarks 1. This API function repeats the byte-level DALI transmission from the buffer specified in argument tx_buf
the number of times specified in argument tx_num.
2. When performing a DALI transmission, R_DALIn_Start must be called before this API function is called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_DALIn_Send ( uint8_t * const tx_buf, uint16_t tx_num );
[Argument(s)]
[Return value]
Macro Description
R_DALIn_Receive
Remarks 1. This API function performs byte-level DALI reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
2. Actual DALI reception starts after this API function is called, and R_DALIn_Start is then called.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_DALIn_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
[Argument(s)]
[Return value]
Macro Description
r_dalin_callback_sendend
Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_send corresponding
to the DALI transmission end interrupt INTSTDLn (performed when number of transmission data specified
by R_DALIn_Send argument tx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dalin_callback_receiveend
Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond-
ing to the DALI reception end interrupt INTSRDLn (performed when number of received data specified by
R_DALIn_Receive argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dalin_callback_error
Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_error corresponding
to the DALI reception error interrupt INTSREDLn.
[Syntax]
#include "r_cg_macrodriver.h"
static void r_dalin_callback_error ( uint8_t err_type );
[Argument(s)]
[Return value]
None.
r_dalin_callback_softwareoverrun
Remark This API function is called as the callback routine of interrupt process r_dalin_interrupt_receive correspond-
ing to the DALI reception end interrupt INTSRDLn (process performed when the amount of data received is
greater than the argument rx_num specified for R_DALIn_Receive).
[Syntax]
#include "r_cg_macrodriver.h"
static void r_dalin_callback_softwareoverrun ( uint16_t rx_data );
[Argument(s)]
O uint16_t rx_data; Receive data (greater than the argument rx_num specified for
R_DALIn_Receive)
[Return value]
None.
R_UARTFn_Set_PowerOff Halts the clock supplied to the asynchronous serial interface LIN-UART
(UARTF).
R_UARTFn_Create
Performs initialization necessary to control the asynchronous serial interface LIN-UART (UARTF).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Create_UserInit
Performs user-defined initialization related to the asynchronous serial interface LIN-UART (UARTF).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_interrupt_send
Remark This API function is called as the interrupt process corresponding to the LIN-UART transmission end inter-
rupt INTLT.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_interrupt_receive
Remark This API function is called as the interrupt process corresponding to the LIN-UART reception end interrupt
INTLR.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_interrupt_error
Remark This API function is called as the interrupt process corresponding to the LIN-UART reception status inter-
rupt INTLS.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Set_PowerOff
Halts the clock supplied to the asynchronous serial interface LIN-UART (UARTF).
Remark Calling this API function changes the asynchronous serial interface LIN-UART (UARTF) to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Send
Remarks 1. This API function repeats the byte-level UARTF transmission from the buffer specified in argument
tx_buf the number of times specified in argument tx_num.
2. When performing a UARTF transmission, R_UARTFn_Start must be called before this API function is
called.
3. If the asynchronous serial interface LIN-UART (UARTF) is used in expansion bit mode, then store the
data to send in the buffer specified by argument tx_buf, in the following format.
"8-bit data", "Expansion bit", "8-bit data", "Expansion bit", ...
[Syntax]
[Argument(s)]
[Return value]
Macro Description
R_UARTFn_Receive
Remarks 1. This API function performs byte-level UARTF reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
2. Actual UARTF reception starts after this API function is called, and R_UARTFn_Start is then called.
3. If the asynchronous serial interface LIN-UART (UARTF) is used in expansion bit mode, then the
received data is stored in the buffer specified by argument rx_buf, in the following format.
"8-bit data", "Expansion bit", "8-bit data", "Expansion bit", ...
[Syntax]
[Argument(s)]
[Return value]
Macro Description
R_UARTFn_Set_DataComparisonOn
Remark Calling this API function switches the asynchronous serial interface LIN-UART (UARTF) to expansion bit
mode (with data comparison).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_UARTFn_Set_DataComparisonOff
Remark Calling this API function switches the asynchronous serial interface LIN-UART (UARTF) to expansion bit
mode (with no data comparison).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_callback_sendend
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_send correspond-
ing to the LIN-UART transmission end interrupt INTLT (performed when number of transmission data spec-
ified by R_UARTFn_Send argument tx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_callback_receiveend
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_receive corre-
sponding to the LIN-UART reception end interrupt INTLR (performed when number of received data speci-
fied by R_UARTFn_Receive argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_callback_error
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error correspond-
ing to the LIN-UART reception status interrupt INTLS.
[Syntax]
[Argument(s)]
[Return value]
None.
r_uartfn_callback_softwareoverrun
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_receive corre-
sponding to the LIN-UART reception end interrupt INTLR (performed when number of received data speci-
fied by R_UARTFn_Receive argument rx_num has been completed).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_callback_expbitdetect
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error correspond-
ing to the LIN-UART reception status interrupt INTLS (performed when expansion bit has been detected).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_uartfn_callback_idmatch
Remark This API function is called as the callback routine of interrupt process r_uartfn_interrupt_error correspond-
ing to the LIN-UART reception status interrupt INTLS (performed when ID parity has been matched).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
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_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_Set_SnoozeOn Enables operation of the address match wakeup function in STOP mode.
R_IICAn_Set_SnoozeOff Disables operation of the address match wakeup function in STOP mode.
R_IICAn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iican_interrupt
Remark This API function is called as the interrupt process corresponding to the IICA communication end interrupt
INTIICAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_StopCondition
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Set_PowerOff
Remark Calling this API function changes the serial interface IICA to reset status.
For this reason, writes to the control registers (e.g. IICA control register n: IICCTLn) after this API function is
called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Master_Send
Remark This API function repeats the byte-level IICA master transmission from the buffer specified in argument
tx_buf the number of times specified in argument tx_num.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_IICAn_Master_Send ( uint8_t adr, uint8_t * const tx_buf, uint16_t tx_num,
uint8_t wait );
[Argument(s)]
[Return value]
Macro Description
R_IICAn_Master_Receive
Remark This API function performs byte-level IICA master reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
[Syntax]
#include "r_cg_macrodriver.h"
MD_STATUS R_IICAn_Master_Receive ( uint8_t adr, uint8_t * const rx_buf, uint16_t rx_num,
uint8_t wait );
[Argument(s)]
[Return value]
Macro Description
r_iican_callback_master_sendend
Performs processing in response to the IICA master transmission end interrupt INTIICAn.
Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the
IICA master transmission end interrupt INTIICAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iican_callback_master_receiveend
Performs processing in response to the IICA master reception end interrupt INTIICAn.
Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the
IICA master reception end interrupt INTIICAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iican_callback_master_error
[Syntax]
#include "r_cg_macrodriver.h"
static void r_iican_callback_master_error ( MD_STATUS flag );
[Argument(s)]
[Return value]
None.
R_IICAn_Slave_Send
Remark This API function repeats the byte-level IICA slave transmission from the buffer specified in argument tx_buf
the number of times specified in argument tx_num.
[Syntax]
#include "r_cg_macrodriver.h"
void R_IICAn_Slave_Send ( uint8_t * const tx_buf, uint16_t tx_num );
[Argument(s)]
[Return value]
None.
R_IICAn_Slave_Receive
Remark This API function performs byte-level IICA slave reception the number of times specified by the argument
rx_num, and stores the data in the buffer specified by the argument rx_buf.
[Syntax]
#include "r_cg_macrodriver.h"
void R_IICAn_Slave_Receive ( uint8_t * const rx_buf, uint16_t rx_num );
[Argument(s)]
[Return value]
None.
r_iican_callback_slave_sendend
Performs processing in response to the IICA slave transmission end interrupt INTIICAn.
Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the
IICA slave transmission end interrupt INTIICAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iican_callback_slave_receiveend
Performs processing in response to the IICA slave reception end interrupt INTIICAn.
Remark This API function is called as the callback routine of interrupt process r_iican_interrupt corresponding to the
IICA slave reception end interrupt INTIICAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_iican_callback_slave_error
[Syntax]
#include "r_cg_macrodriver.h"
static void r_iican_callback_slave_error ( MD_STATUS flag );
[Argument(s)]
[Return value]
None.
r_iican_callback_getstopcondition
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Set_SnoozeOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_IICAn_Set_SnoozeOff
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Set_VoltageOn Enables operation of internal voltage boost circuit and capacitor split circuit.
R_LCD_Set_VoltageOff Disables operation of internal voltage boost circuit and capacitor split circuit.
R_LCD_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_lcd_interrupt
Remark This API function is called as the interrupt process corresponding to the LCD frame interrupt INTLCD.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Set_VoltageOn
Enables operation of internal voltage boost circuit and capacitor split circuit.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Set_VoltageOff
Disables operation of internal voltage boost circuit and capacitor split circuit.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LCD_Set_PowerOff
Remarks 1. Calling this API function changes the LCD controller/driver to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
2. This API function stops the clock supply to the LCD controller/driver, by operating the RTCEN bit of
peripheral enable register n.
For this reason, this API function also stops the clock supply to other peripheral devices sharing the
RTCEN bit (e.g. real-time clock).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_sg_interrupt Performs processing in response to the threshold value detection of the loga-
rithmic decrement interrupt INTSG.
R_SG_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SG_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_sg_interrupt
Performs processing in response to the threshold value detection of the logarithmic decrement interrupt INTSG.
Remark This API function is called as the interrupt process corresponding to the threshold value detection of the log-
arithmic decrement interrupt INTSG.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SG_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_SG_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dmacn_interrupt Performs processing in response to the DMA transfer end interrupt INTDMAn.
R_DMACn_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMACn_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMAC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMAC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_dmacn_interrupt
Remark This API function is called as the interrupt process corresponding to the DMA transfer end interrupt
INTDMAn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMACn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMACn_Stop
Remarks 1. This API function does not forcibly terminate DMA transfer.
2. Before using this API function, you must confirm that transmission has ended.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DMACn_Set_SoftwareTriggerOn
[Syntax]
[Argument(s)]
None.
[Return value]
None.
3.2.26 DTC
Below is a list of API functions output by the Applilet3 for DTC use.
R_DTC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DTC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DTCn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DTCn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_DTC_Set_PowerOff
Remark Calling this API function changes the DTC to reset status.
For this reason, writes to the control registers after this API function is called are ignored.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ELC_Create Performs initialization necessary to control the event link controller (ELC).
R_ELC_Create_UserInit Performs user-defined initialization relating to the event link controller (ELC).
R_ELC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ELC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_ELC_Stop
[Syntax]
[Argument(s)]
Remark Below is shown the format for specifying disabled event source event.
In case of setting the event to 0x01010101, the event link operations of event source 00, 08, 16, 24 are pro-
hibited.
31 0
B31 B25 B24 B0
... ...
Event source 00
Event source 24
[Return value]
None.
R_INTC_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_INTC_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_intcn_interrupt
Remark This API function is called as the interrupt process corresponding to the external maskable interrupt INTPn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_INTCn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_INTCn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_intclrn_interrupt
Remark This API function is called as the interrupt process corresponding to the external maskable interrupt
INTPLRn.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_INTCLRn_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_INTCLRn_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_KEY_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_KEY_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_key_interrupt
Remark This API function is called as the interrupt process corresponding to the key interrupt INTKR.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_KEY_Start
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_KEY_Stop
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LVD_InterruptMode_Start Starts voltage detection (when in interrupt mode, and interrupt & reset mode).
R_LVD_Create
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LVD_Create_UserInit
[Syntax]
[Argument(s)]
None.
[Return value]
None.
r_lvd_interrupt
Remark This API function is called as the interrupt process corresponding to the voltage detection interrupt INTLVI.
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R_LVD_InterruptMode_Start
Starts voltage detection (when in interrupt mode, and interrupt & reset mode).
[Syntax]
[Argument(s)]
None.
[Return value]
None.
R20UT2711EJ0100