Home
Renesas M16C/62P Group User's Manual
Contents
1. 35 _ CreatePulseWidthMeasurementMode m width measurement 36 EnablePulseWidthMeasurementMode Controls operation of pulse width measurement mode 37 Timer _ DestroyPulseWidthMeasurementMode Clears setting of pulse width measurement mode 38 GetPulseWidthMeasurementMode Acquires measured value of pulse width measurement mode 39 SetTimerRegister Sets timer register 40 EnableTimerRegister Controls operation of timer register 41 ClearTimerRegister Clears timer register 42 GetTimerRegister Gets timer register value 43 VO port _ SetlOPort Sets I O port 44 ReadlOPort Reads from I O port 45 WritelOPort Writes to I O port 46 SetlOPortRegister Sets I O port register 47 ReadlOPortRegister Reads from I O port register 48 WritelOPortRegister Writes to I O port register 49 External Setinterrupt Sets external interrupt 50 interrupt Enablelnterrupt Controls external interrupt 51 GetinterruptFlag Gets flag status of external interrupt 52 ClearInterruptFlag Clears flag of external interrupt 53 A D converter CreateADC Sets A D converter 54 EnableADC Controls operation of A D converter 55 DestroyADC Discards settings of A D converter 56 GetADC Gets A D conversion value register specified 67 GetADCAII Gets A D conversion value all registers Rev 1 00 2007 11 1 14 REC10B0002 0100 4 2 Description of Each API This section describes each API and explains how to use them
2. If data transmission in serial communication was successfully stopped RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O BasicStartSerialSending e For the M16C SI 03 and SI 04 this API cannot be used e When operating in clock synchronous serial communication mode data reception is stopped at the same time by this API e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void Stop sending data in serial communication __ BasicStopSerialSending Rev 1 00 2007 11 14 REC10B0002 0100 26 RAPI_COM1 __OpenSerialDriver Synopsis Description Return value Functionality Reference Remark lt Open a serial port gt Boolean __OpenSerialDriver unsigned long data data Setup data Opens and initializes a specified serial port data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI 04 If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Serial I O __CloseSerialDriver e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Re
3. Remark lt Start reception gt Boolean _ StartSerialReceiving unsigned long data unsigned char wordNum unsigned int RcvDtBuf data Setup data wordNum Number of words received RevDtBuf Pointer to the buffer in which received data is stored Starts reception of serial communication and gets received data by a specified number of words When acquisition of received data is complete this API calls a notification function if a notification function is registered data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI 04 If reception of serial communication was successfully started RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O ConfigSerialDriverNotify _ StopSerialReceiving If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 2007 11 1 include rapi_sif_ml6c_62p unsigned int buffer 10 void func void __StartSerialReceiving RAPI_COM1 Get 5 word data received in serial communication 5 buffer 34 REC10B0002 0100 _ StartSerialSending Synopsis Description Return value Functionality Reference Remark lt Start transmission gt Boolean _ StartSerialSending unsigned long data unsigne
4. Boolean func void Set the data of RAPI_COM1 to serial driver return _ SetSerialFormat RAPI_COM1 RAPI_SM_SYNC RAPI_CKDIR_INT RAPI_BCSS_F1 RAPI_DPOL_NON RAPI_LSB_SEL 20 Rev 1 00 2007 11 14 31 REC10B0002 0100 _ SetSeriallnterrupt Synopsis lt Set serial interrupts gt Boolean _ SetSeriallnterrupt unsigned long data data Setup data Description Sets serial interrupts according to specified parameters data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 T1 or interrupt settings the following values can set UARTO UART1 UART2 RAPI_INT_TX_DIS Transmit interrupt disabled RAPI_INT_TX_LV_1 Transmit interrupt priority level 1 RAPI_INT_TX_LV_2 Transmit interrupt priority level 2 RAPI_INT_TX_LV_3 Transmit interrupt priority level 3 RAPI_INT_TX_LV_4 Transmit interrupt priority level 4 RAPI_INT_TX_LV_5 RAPI_INT_TX_LV_6 Transmit interrupt priority level 6 Transmit interrupt priority level 5 RAPI_INT_TX_LV_7 Transmit interrupt priority level 7 RAPI_INT_RX_DIS Receive interrupt disabled RAPI_INT_RX_LV_1 Receive interrupt priority level 1 RAPI_INT_RX_LV_2 Receive interrupt priority level 2 RAPI_INT_RX_LV_3 Receive interrupt priority level 3 RAPI_INT_RX_LV_4 Rece
5. Description Return value Functionality Reference Remark lt Control operation of pulse width modulation mode gt Boolean _ EnablePulseWidthModulationMode unsigned long data data Setup data Controls operation of the timer that is set to specified pulse width modulation mode by starting or stopping it data For data the following definition values can be set To set multiple definition values at the same time use the symbol pP to separate each specified value RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_ON Sets the timer that is set to pulse width modulation mode to start operating RAPI_TIMER_OFF Sets the timer that is set to pulse width modulation mode to stop operating If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse width modulation mode PWM mode CreatePulseWidthModulationMode __ DestroyPulseWidthModulationMode e If an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_timer_ml6c_62p h void func void Enable timer A2 as pulse width modulation mode __E
6. RAPI_TG_TAIS Only writing 1 to the TA S bit of the TABSR register causes the timer to start counting RAPI_PULSE_ON Selects that pulses are output from TAin pin Selectable only when timer Ai is used RAPI_PULSE_OFF Selects that no pulses are output from TAin pin Selectable only when timer Ai is used RAPI_PWM_16 Selects operation as a 16 bit pulse width modulator RAPI_PWM_8 Selects operation as an 8 bit pulse width modulator RAPI_RISING Selects the rising edge of TAin pin input signal as active edge 2007 11 1 50 RAPI_FALLING Selects the falling edge of TAin pin input signal as active edge e Specifiable definition values when timer A is used RAPI_TIMER_AO to RAPI_TIMER_A4 specified Count source Operating states set Count start condition Pulse output facility Modulator TAin pin input data2 Specify one from RAPI_F1 RAPI_F2 RAPI_F32 RAPI_FC32 The default value is RAPI_F2 Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF Specify one from RAPI_TG_TAIS RAPI_TG_TAIIN RAPI_EV_TIMER_AJ RAPI_EV_TIMER_AK RAPI_EV_TIMER_B2 The default value is RAPI_TG_TAIIN Specify one from RAPI_PULSE_ON RAPI_PULSE_OFF The default value is RAPI_PULSE_OFF Specify one from RAPI_PWM_16 RAPI_PWM_8 The default value is RAPI_PWM_16 Specify one from RAPI_RISING RAPI_FALLING T
7. __SetSerialInterrupt RAPI_COM1 RAPI_INT_TX_DIS RAPI_INT_RX_DIS Start reception __StartSerialReceiving RAPI_COM1 5 buffer while 1 __PollingSerialReceiving RAPI_COM1 2007 11 14 38 REC10B0002 0100 _ PollingSerialSending Synopsis Description Return value Functionality Reference Remark lt Polling transmission gt Boolean _ PollingSerialSending unsigned long data data Setup data Performs transmission of serial communication by polling This API sends transmit data by an amount specified by __ StartSerialSending from the transmit data buffer specified by _ StartSerialSending When transmission of all transmit data is complete it calls a notification function if a notification function is registered data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI1 04 If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Serial I O e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_sif_ml6c_62p unsigned int buffer 10 void func void Transmission interrupt disable __SetSerialInterrupt RAPI_COM1 RAPI_INT_TX_DIS RAPI_INT_RX_DIS Start tra
8. For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 If reception of serial communication was successfully stopped RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O StartSerialReceiving e For the M16C SI 03 and SI 04 this API cannot be used e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void Stop receiving data in serial communication __StopSerialReceiving RAPI_COM1 Rev 1 00 2007 11 14 REC10B0002 0100 36 i _ StopSerialSending Synopsis Description Return value Functionality Reference Remark lt Stop transmission gt Boolean _ StopSerialSending unsigned long data data Setup data Stops transmission of serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 If transmission of serial communication was successfully stopped RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O StartSerialReceiving e For the M16C SI 03 and SlI 04 this API cannot be used e When operating in clock synchronous serial communication mode data reception is stopped at the same time by this API e lf an
9. Selects external trigger RAPI_ANEX_UNUSED ANEXO and ANEX1 are not used RAPI_ANEXO ANEXO input is A D converted RAPI_ANEX1 RAPI_EXTERNAL_OP_AMP ANEX1 input is A D converted External op amp connection mode e Specifiable definition values when one shot mode is used RAPI_ONE_SHOT specified Input pin Specify one from RAPI_ANO RAPI_AN1 RAPI_AN2 RAPI_AN3 RAPI_AN4 RAPI_ANS RAPI_AN6 RAPI_AN7 RAPIANOO RAPI_ANO1 RAPI_ANO2 RAPI_ANO3 RAPI_ANO4 RAPI_ANO5 RAPI_ANO6 RAPI_ANO7 RAPI_AN20 RAPI_AN21 RAPI_AN22 RAPI_AN23 RAPI_AN24 RAPI_AN25 RAPI_AN26 RAPI_AN27 RAPI_ANEXO RAPI_ANEX1 The default is RAPI_ANO Operating frequency Resolution RAPI_8BIT Operating states set Conversion method Specify one from RAPI_FAD RAPI_FAD2 RAPI_FAD3 RAPI_FAD4 RAPI_FAD6 RAPI_FAD12 The default value is RAPI_FAD4 Specify one from RAPI_10BIT RAPI_8BIT The default value is Specify one from RAPI_AD_ON RAPI_AD_OFF The default value is RAPI_AD_OFF Specify one from RAPI_WITH_SAMPLE_HOLD RAPI_WITHOUT_SAMPLE_HOLD The default value is RAPI_WITHOUT_SAMPLE_HOLD Trigger Specify one from RAPI_SOFTWARE_TRIGGER RAPI_EXTERNAL_TRIGGER The default value is RAPI_SOFTWARE_TRIGGER External Op Amp Connection Specify one from RAPILANEX_UNUSED RAPI_EXTERNAL_OP_AMP The default value is RAPI_ANEX_UNUSED e Specifiable definition values when repea
10. RAPI_AN3 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN4 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN5 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN6 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN7 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANOO Uses ANo pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO1 Uses ANo pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO2 Uses ANop pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO3 Uses ANoas pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN04 Uses ANo pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO5 Uses ANos pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO6 Uses ANog pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANO7 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN20 Uses AN pin for the analog input pin Se
11. RAPI_CKDIR_INT RAPI_BCSS_F1 RAPI_DPOL_NON RAPI_LSB_SEL 20 Rev 1 00 2007 11 14 20 REC10B0002 0100 _ BasicStartSerialReceiving Synopsis Description Return value lt Receive 1 data gt Boolean _ BasicStartSerialReceiving unsigned long data data Setup data Starts receiving 1 data of serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 If data reception in serial communication was successfully started RAPI_TRUE is returned if failed RAPI_FALSE is returned Functionality Serial I O Reference BasicReceivingStatusRead _ BasicStopSerialReceiving Remark e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_sif_ml6c_62p void func void 2007 11 14 REC10B0002 0100 21 _ BasicStartSerialSending Synopsis Description Return value Functionality Reference Remark lt Transmit 1 data gt Boolean _BasicStartSerialSending unsigned long data1 unsigned int data2 data Setup data data Transmit data Starts sending 1 data of serial communication For data1 the following values
12. RAPI_FC32 Selects f 32 for the count source RAPI_TIMER_ON Sets the timer to start operating in __CreateTimer RAPI_TIMER_OFF Sets the timer to stop operating in __CreateTimer RAPI_GATE_L Selects a gate facility that counts a period during which input at TAin pin remains low RAPI_GATE_H Selects a gate facility that counts a period during which input at TAin pin remains high RAPI_PULSE_ON Selects that pulses are output from TAin pin RAPI_PULSE_OFF Selects that no pulses are output from TAin pin e Specifiable definition values when timer A is used RAPI_TIMER_AO to RAPI_TIMER_A4 specified 2007 11 14 REC10B0002 0100 40 Return value Functionality Reference Remark Count source Operating states set Pulse output state Gate facility Specify one from RAPI_F1 RAPI_F2 RAPI_F8 RAPI_F32 RAPI_FC32 The default value is RAPI_F2 Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF Specify one from RAPI_PULSE_ON RAPI_PULSE_OFF The default value is RAPI_PULSE_OFF Specify one from RAPI_GATE_L RAPI_GATE_H If omitted No gate facility is set Specifiable definition values when timer B is used RAPI_TIMER_BO to RAPI_TIMER_B5 specified Count source Operating states set data2 Specify the interrupt priority level 0 7 to be set in the interrupt
13. _ SetlOPortRegister _ ReadlOPortRegister WritelOPortRegister Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_io_port_ml6c_62p h void func void Get the value of port P12 __ReadIOPort RAPI_PORT_1_2 data Rev 1 00 2007 11 1 75 REC10B0002 0100 _ WritelOPort Synopsis lt Write to I O port gt Boolean _ WritelOPort unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Data to be written to I O port Description Writes data to a specified I O port data1 Specify an I O port to which data is written The definition values corresponding to each I O port are listed below RAPI_PORT_0_0 Port POo RAPI_PORT_0_1 Port PO RAPI_PORT_0_2 Port P02 RAPI_PORT_0_3 Port PO RAPI_PORT_0_4 Port P0 RAPI_PORT_0_5 Port POs RAPI_PORT_0_6 Port PO RAPI_PORT_0_7 Port PO RAPI_PORT_1_0 Port P1o RAPI_PORT_1_1 Port P1 RAPI_PORT_1_2 Port P12 RAPI_PORT_1_3 Port P13 RAPI_PORT_1_4 Port P14 RAPI_PORT_1_5 Port P15 RAPI_PORT_1_6 Port P16 RAPI_PORT_1_7 Port P17 RAPI_PORT_2_0 Port P2o RAPI_PORT_2_1 Port P2 RAPI_PORT_2_2 Port P22 RAPI_PORT_2_3 Port P23 RAPI_PORT_2_4 Port P24 RAPI_PORT_2_5 Port P25 RAPI_PORT_2_6 Port P26 RAPI_PORT_2_7 Port P27 RAPI_PORT_3_0 P
14. interrupt RAPI_INT_FALLING Specifies a falling edge for the active edge of a selected external interrupt RAPI_INT_BOTH Specifies both edges for the active edge of a selected external interrupt RAPI_KIO_ENABLE Uses _KIO pin input RAPI_KI1_ENABLE Uses _KI1 pin input RAPI_KI2_ENABLE Uses _KI2 pin input RAPI_KI3_ENABLE Uses _KI3 pin input e Specifiable definition values when _INTO 5 interrupts are used RAPI_INTO to RAPI_INT5 specified Polarity Specify one from RAPI_INT_RISING RAPI_INT_FALLING RAPI_INT_BOTH The default value is RAPI_INT_FALLING e Specifiable definition values when key input interrupt is used RAPI_KEY specified Input pin To use _Kl0 Kl1 _KI2 or _KI3 pin input specify RAPI_KIO ENABLE RAPI_KI1_ENABLE RAPI_KI2_ENABLE or RAPI_KI3_ENABLE respectively The default value is RAPI_INT_FALLING data2 Specify the interrupt priority level 0 7 to be set in the interrupt control register Rev 1 00 2007 11 14 REC10B0002 0100 82 Return value If the external interrupt specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality External interrupt Reference Enablelnterrupt _ GetInterruptFlag __ClearlnterruptFlag Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rap
15. 6 Store the value of the count start flag register When using timer B RAPI_TIMER_BO to RAPI_TIMER_B5 specified 0 Store the value of timer Bi mode register i 0 5 1 Store the value of timer Bi register i 0 5 2 Store the value of the time clock prescaler reset flag register 3 Store the value of the count start flag register If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer register manipulation 69 Reference SetTimerRegister _ EnableTimerRegister _ ClearTimerRegister Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func void unsigned int data 7 Get the value of timer A3 registers __GetTimerRegister RAPI_TIMER_A3 data Rev 1 00 2007 11 14 70 REC10B0002 0100 4 2 3 I O Port __SetlOPort Synopsis lt Set I O port gt Boolean __SetlOPort unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Setup data 2 Description Sets the operating conditions of a specified I O port data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol to separate
16. Boolean _ ClearlnterruptFlag unsigned long data data Setup data Description Clears the interrupt request flag of a specified external interrupt data RAPI_INTO Uses _ INTO interrupt RAPI_INT1 Uses _INT1 interrupt RAPI_INT2 Uses _INT2 interrupt RAPI_INT3 Uses _INT3 interrupt RAPI_INT4 Uses _INT4 interrupt RAPI_INTS Uses _INT5 interrupt RAPI_KEY Uses key input interrupt Return value If the external interrupt specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality External interrupt Reference Setinterrupt Enablelnterrupt _ GetInterruptFlag Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_interrupt_ml6c_62p h void func void Clear status of _INTO interrupt __ClearInterruptFlag RAPI_INTO Rev 1 00 2007 11 1 86 REC10B0002 0100 4 2 5 A D converter _ CreateADC Synopsis lt Set A D converter gt Boolean _ CreateADC unsigned long data1 unsigned int data2 unsigned int data3 void func data1 Setup data 1 data2 Number of analog input pins used by A D converter data3 Setup data 3 func Callback function pointer Specify 0 if no callback f
17. D convertered data of A D register 0 __ GetADC RAPI_ADO amp data Rev 1 00 2007 11 1 96 REC10B0002 0100 __GetADCAIl Synopsis Description Return value Functionality Reference CreateADC lt Get A D converted value all registers gt Boolean _ GetADCAII unsigned int data data Pointer to the buffer in which A D converted value is stored Gets the A D converted value from all A D registers The A D registers from which A D converted values are acquired are listed below M16C 0 A D register 0 16 bytes 1 A D register 1 2 A D register 2 3 A D register 3 4 A D register 4 5 A D register 5 6 A D register 6 7 A D register 7 If A D converted values were successfully acquired RAPI_TRUE is returned if failed RAPI_FALSE is returned A D converter EnableADC _ DestroyADC _ GetADC Program example Rev 1 00 include rapi_ad_ml6c_62p h void func void unsigned int data 8 Get A D convertered datas of A D register __GetADCA11 data 2007 11 14 97 REC10B0002 0100 M16C 62P Group Renesas Embedded Application Programming Interface Reference Manual Rev 1 00 Issued November 2007 Rev 1 00 2007 11 1 REC10B0002 0100 98
18. RAPI_FALLING_ FALLING Selects measurement of an interval from the fall to the next fall of a measurement pulse Specifiable definition values when timer B is used RAPI_TIMER_BO to RAPI_TIMER_B5 specified Count source Specify one from RAPI_F1 RAPI_F2 RAPI_F8 RAPI_F32 RAPI_FC32 The default value is RAPI_F2 Operating states set Measurement pulse data2 Specify the interrupt priority level 0 7 to be set in the interrupt control register Rev 1 00 REC10B0002 0100 2007 11 14 Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF Specify one from RAPI_RISING_RISING RAPI_FALLING_FALLING The default value is RAPI_FALLING_FALLING 55 Return value Functionality Reference Remark Program example data3 Specify 0 data4 Specify 0 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse period measurement mode EnablePulsePeriodMeasurementMode _ DestroyPulsePeriodMeasurementMode GetPulsePeriodMeasurementMode e f an undefined value is specified in the first argument operation of the API cannot be guaranteed include rapi_timer_ml6c_62p h void TimerIntFunc void void func void Set up timer BO as pulse period measurement mode __CreatePulsePeriodMeasurementMode RAPI_TIMER_BO RAPI_TIMER_ON RAPI_FALLING_FALL
19. Timer event counter mode EnableEventCounter _ DestroyEventCounter _ GetEventCounter e lf an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_timer_ml6c_62p h void TimerIntFunc void void func void Set up timer BO as event counter mode __CreateEventCounter RAPI_TIMER_BO RAPI_TIMER_ON RAPI_FALLING 5 0x80 0 TimerIntFunc 2007 11 1 46 REC10B0002 0100 __EnableEventCounter Synopsis Description Return value Functionality Reference Remark lt Control operation of event counter mode gt Boolean _ EnableEventCounter unsigned long data data Setup data Controls operation of the timer that is set to specified timer mode by starting or stopping it data For data the following definition values can be set To set multiple definition values at the same time use the symbol pP RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B chan
20. control register data3 Specify the value to be set in the timer register in 16 bits data4 Specify 0 Specify one from RAPI_F1 RAPI_F2 RAPI_F8 RAPI_F32 RAPI_FC32 The default value is RAPI_F2 Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer timer mode Program example include be guaranteed void TimerIntFunc void func void EnableTimer _ DestroyTimer If an undefined value is specified in the first argument operation of the API cannot rapi_timer_ml6c_62p h void Set up timer AO as timer mode __CreateTimer RAPI_TIMER_AO RAPI_TIMER_ON RAPI_F8 Dy 0x80 0 TimerIntFunc Rev 1 00 2007 11 14 REC10B0002 0100 41 __EnableTimer Synopsis Description lt Control operation of timer mode gt Boolean __EnableTimer unsigned long data data Setup data Controls operation of the timer that is set to specified timer mode by starting or stopping it data For data the following definition values can be set To set multiple definition values at the same time use the symbol to separate each specified value RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channe
21. data the following definition values can be set If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 is returned Timer timer mode Create Timer If an undefined value is specified in the argument operation of the API cannot be guaranteed Enable Timer Program example include rapi_timer_ml6c_62p h void func void Destroy the setting of timer A2 as timer mode __DestroyTimer RAPI_TIMER_A2 Rev 1 00 2007 11 14 43 REC10B0002 0100 _ CreateEventCounter Synopsis Description Rev 1 00 lt Set event counter mode gt Boolean _ CreateEventCounter unsigned long data1 unsigned int data2 unsigned int data3 unsigned int data4 void func data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer Specify 0 if n
22. sweep mode 0 or repeat sweep mode 1 is used RAPI_P2_GROUP Uses port Ps group for the analog input pin Selectable only when sweep mode repeat sweep mode 0 or repeat sweep mode 1 is used RAPI_AD_ON Sets the A D converter to start operating RAPI_AD_OFF Sets the A D converter to stop operating data2 The set value differs with the A D conversion mode used One shot mode Repeat mode Specify 1 Single sweep mode Repeat sweep mode 0 Specify 2 4 6 or 8 Repeat sweep mode 1 Specify 1 2 3 or 4 Return value Functionality Reference If A D converter was successfully controlled RAPI_TRUE is returned if failed RAPI_FALSE is returned A D converter CreateADC DestroyADC GetADG __ GetADCAII Remark Rev 1 00 e If an undefined value is specified in the first argument operation of the API cannot be guaranteed 2007 11 1 REC10B0002 0100 93 Program example include rapi_ad_ml6c_62p h void func void Disable A D converter __EnableADC RAPI_ANO RAPI_AD_OFF 1 Rev 1 00 2007 11 1 94 REC10B0002 0100 _ DestroyADC Synopsis Description Return value Functionality Reference lt Discard settings of A D converter gt Boolean _ DestroyADC void Discards settings of a specified A D converter If converter setting was successfully d
23. to each l O port register are listed below RAPI_PORT_0O Port PO register RAPI_PORT_1 Port P1 register RAPI_PORT_2 Port P2 register RAPI_PORT_3 Port P3 register RAPI_PORT_4 Port P4 register RAPI_PORT_5 Port P5 register RAPI_PORT_6 Port P6 register RAPI_PORT_7 Port P7 register RAPI_PORT_8 Port P8 register RAPI_PORT_9 Port P9 register RAPI_PORT_10 Port P10 register RAPI_PORT_11 Port P11 register RAPI_PORT_12 Port P12 register RAPI_PORT_13 Port P13 register RAPI_PORT_14 Port P14 register Return value The definition values related to port settings are described below RAPI_LATCH Set to read the port latch regardless of whether the port is set for input or output Specifiable only when port P1 is used data2 Specify the set value for the port direction register corresponding to a selected port data3 Specify the set value for the pullup control register corresponding to a selected port data4 Specify 0 If the I O port register specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality I O port Reference SetlOPort _ ReadlOPort _ WritelOPort _ ReadlOPortRegister WritelOPortRegister Remark Rev 1 00 2007 11 1 78 REC10B0002 0100 If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_io_port_m
24. 0100 __GetinterruptFlag Synopsis lt Get the status of external interrupt flag gt Boolean _ GetinterruptFlag unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which the acquired flag data is stored Description Gets the value of interrupt request flag of a specified external interrupt data1 RAPI_INTO Uses _ INTO interrupt RAPI_INT1 Uses _INT1 interrupt RAPI_INT2 Uses _INT2 interrupt RAPI_INT3 Uses _INT3 interrupt RAPI_INT4 Uses _INTA4 interrupt RAPI_INT5 Uses _INT5 interrupt RAPI_KEY Uses key input interrupt data2 Value of interrupt request flag 0 Interrupt not requested 1 Interrupt requested Return value If the external interrupt specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality External interrupt Reference Setinterrupt _ Enablelnterrupt _ ClearlnterruptFlag Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_interrupt_ml6c_62p h void func void unsigned char data Get flag of _INT2 interrupt __GetInterruptFlag RAPI_INT2 amp data Rev 1 00 2007 11 1 85 REC10B0002 0100 _ ClearlnterruptFlag Synopsis lt Clear external interrupt flag gt
25. 0_GROUP RAPI_P2_GROUP The default value is RAPI_P10_GROUP Specify one from RAPI_FAD RAPI_FAD2 RAPI_FAD3 RAPI_FAD4 RAPI_FAD6 RAPI_FAD12 The default value is RAPI_FAD4 Specify one from RAPI_10BIT RAPI_8BIT The default value is RAPI_8BIT Specify one from RAPI_LAD_ON RAPI_AD_OFF The default value is RAPI_AD_OFF Specify one from RAPI_WITH_SAMPLE_HOLD RAPI_WITHOUT_SAMPLE_HOLD The default value is RAPI_WITHOUT_SAMPLE_HOLD Specify one from RAPI_SOFTWARE_TRIGGER RAPI_EXTERNAL_TRIGGER The default value is RAPI_SOFTWARE_TRIGGER Specify one from RAPI_ANEX_UNUSED RAPI_EXTERNAL_OP_AMP The default value is RAPI_ANEX_UNUSED e Specifiable definition values when repeat sweep mode 0 is used RAPI_REPEAT_SWEEPO specified Input pin Operating frequency Resolution Rev 1 00 2007 11 1 REC10B0002 0100 Specify one from RAPI_PO_GROUP RAPI_P10_GROUP RAPI_P2_GROUP The default value is RAPI_P10_GROUP Specify one from RAPI_FAD RAPI_FAD2 RAPI_FAD3 RAPI_FAD4 RAPI_FAD6 RAPI_FAD12 The default value is RAPI_FAD4 Specify one from RAPI_10BIT RAPI_8BIT The default value is RAPI_8BIT 89 Operating states set Conversion method Trigger External Op Amp Connection Specify one from RAPI_LAD_ON RAPI_AD_OFF The default value is RAPI_AD_OFF Specify one from RAPI_WITH_SAMPLE_HOLD RAPI_WITHOUT_SAMPLE_HOLD The default value is RAPI_WITHOUT_SAMPL
26. API_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer event counter mode Reference CreateEventCounter EnableEventCounter GetEventCounter Remark e f an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func void Destroy the setting of timer B2 as event counter mode __DestroyEventCounter RAPI_TIMER_B2 Rev 1 00 2007 11 14 48 REC10B0002 0100 _ GetEventCounter Synopsis Description lt Get event counter mode counter value gt Boolean _ GetEventCounter unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which counter value is stored Gets the counter value of the timer that is set to specified event counter mode data1 For data the following definition values can be set RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects t
27. EC10B0002 0100 3 Standard Types This section describes the standard types defined in the library For details about the set values refer to the description of each API Standard type Description Boolean The Boolean type represents the enum type data that indicates whether successful RAPI_TRUE 1 or failed RAPI_FALSE 0 VoidFuncNotify The VoidFuncNotify type represents the type of the notification function to be registered Rev 1 00 2007 11 1 12 REC10B0002 0100 4 Library Reference 4 1 API List by Peripheral Facility The table below lists the Renesas Embedded APIs classified by peripheral facility NO Facility API API operation classification 1 Single data BasicOpenSerialDriver Opens serial port 2 serial I O BasicCloseSerialDriver Closes serial port 3 BasicSetSerialFormat Sets serial communication 4 BasicStartSerialReceiving Receives 1 data 5 BasicStartSerialSending Transmits 1 data 6 BasicReceivingStatusRead Reads receive status 7 BasicSendingStatusRead Reads transmit status 8 BasicStopSerialReceiving Stops reception 9 BasicStopSerialSending Stops transmission 10 Multi data OpenSerialDriver Opens serial port 11 serial VO CloseSerialDriver Closes serial port 12 ConfigSerialDriverN
28. E_HOLD Specify one from RAPI_SOFTWARE_TRIGGER RAPI_EXTERNAL_TRIGGER The default value is RAPI_SOFTWARE_TRIGGER Specify one from RAPI_ANEX_UNUSED RAPI_EXTERNAL_OP_AMP The default value is RAPI_ANEX_UNUSED e Specifiable definition values when repeat sweep mode 1 is used RAPI_REPEAT_SWEEP1 specified Input pin Operating frequency Resolution Operating states set Conversion method Trigger External Op Amp Connection data2 The set value Specify one from RAPI_PO_GROUP RAPI_P10_GROUP RAPI_P2_GROUP The default value is RAPI_P10_GROUP Specify one from RAPI_FAD RAPI_FAD2 RAPI_FAD3 RAPI_FAD4 RAPI_FAD6 RAPI_FAD12 The default value is RAPI_FAD4 Specify one from RAPI_10BIT RAPI_8BIT The default value is RAPI_8BIT Specify one from RAPI_LAD_ON RAPI_AD_OFF The default value is RAPI_AD_OFF Specify one from RAPI_WITH_SAMPLE_HOLD RAPI_WITHOUT_SAMPLE_HOLD The default value is RAPI_WITHOUT_SAMPLE_HOLD Specify one from RAPI_SOFTWARE_TRIGGER RAPI_EXTERNAL_TRIGGER The default value is RAPI_SOFTWARE_TRIGGER Specify one from RAPI_ANEX_UNUSED RAPI_EXTERNAL_OP_AMP The default value is RAPI_ANEX_UNUSED differs with the A D conversion mode used One shot mode Repeat mode Specify 1 Repeat sweep mode 0 Single sweep mode Specify 2 4 6 or 8 Repeat sweep mode1 Specify 1 2 3 or 4 data3 Specify the interrupt
29. ING RAPI_F8 5 0 0 TimerIntFunc Rev 1 00 2007 11 1 56 REC10B0002 0100 _ EnablePulsePeriodMeasurementMode Synopsis lt Control operation of pulse period measurement mode gt Boolean _ EnablePulsePeriodMeasurementMode unsigned long data data Setup data Description Controls operation of the timer that is set to specified pulse period measurement mode by starting or stopping it data For data the following definition values can be set To set multiple definition values at the same time use the symbol to separate each specified value RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 RAPI_TIMER_ON Sets the timer that is set to pulse period measurement mode to start operating RAPI_TIMER_OFF Sets the timer that is set to pulse period measurement mode to stop operating Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer pulse period measurement mode Reference CreatePulsePeriodMeasurementMode _ DestroyPulsePeriodMeasurementMode GetPulsePeriodMeasurementMode Remark e If an undefined value is specified in the ar
30. ORT_12_2 Port P122 RAPI_PORT_12_3 Port P123 RAPI_PORT_12_4 Port P124 RAPI_PORT_12_5 Port P125 RAPI_PORT_12_6 Port P126 RAPI_PORT_12_7 Port P127 RAPI_PORT_13_0 Port P130 RAPI_PORT_13_1 Port P13 RAPI_PORT_13_2 Port P132 RAPI_PORT_13_3 Port P133 RAPI_PORT_13_4 Port P134 RAPI_PORT_13_5 Port P135 RAPI_PORT_13_6 Port P136 RAPI_PORT_13_7 Port P137 RAPI_PORT_14_0 Port P14 RAPI_PORT_14_1 Port P14 Return value If the I O port specification is incorrect RAPI_TRUE is returned Functionality 1 O port Reference SetlOPort WritelOPortRegister Remark be guaranteed Program example include rapi_io_port_ml6c_62p h void func void unsigned int data Set the data to port P05 __WritelIOPort RAPI_PORT_0_5 0 Rev 1 00 2007 11 1 REC10B0002 0100 77 RAPI_FALSE is returned otherwise ReadlOPort _ SetlOPortRegister _ ReadlOPortRegister If an undefined value is specified in the first argument operation of the API cannot __SetlOPortRegister Synopsis Description lt Set l O port register gt Boolean _ SetiOPortRegister unsigned long data1 unsigned int data2 unsigned int data3 unsigned int data4 data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 data1 Set the operating condition of a specified I O port in each relevant register The definition values corresponding
31. PI_PORT_13_7 Port P137 RAPI_PORT_14_0 Port P14 RAPI_PORT_14 1 Port P14 The definition values related to port settings are described below RAPI_PORT_INPUT Sets a selected port for input RAPI_PORT_OUTPUT Sets a selected port for output RAPI_PULLED_HIGH Sets a selected port to be pulled high RAPI_NOT_PULLED Sets a selected port not to be pulled high _HIGH RAPI_LATCH Sets a selected port to read the port latch regardless of whether it is set for input or output Specifiable only when port P1 is used data2 Specify 0 Return value If the I O port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Rev 1 00 2007 11 1 72 REC10B0002 0100 Functionality I O port Reference ReadlOPort _ WritelOPort _ SetlOPortRegister _ ReadlOPortRegister WritelOPortRegister Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_io_port_ml6c_62p h void func void Set up port P03 as input port __SetIOPort RAPI_PORT_0_3 RAPI_PORT_INPUT RAPI_PULLED_HIGH 0 Rev 1 00 2007 11 14 73 REC10B0002 0100 __ReadlOPort Synopsis lt Read from I O port gt Boolean _ ReadlOPort unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the variable in which the value read from I O port is stored Descr
32. PI_TIMER_BO 2007 11 1 63 REC10B0002 0100 _ GetPulseWidthMeasurementMode Synopsis Description Return value Functionality Reference Remark lt Get measured value in pulse width measurement mode gt Boolean _ GetPulseWidthMeasurementMode unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which counter value is stored Gets the counter value of the timer that is set to specified pulse width measurement mode data1 For data the following definition values can be set RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse width measurement mode CreatePulseWidthMeasurementMode _ EnablePulseWidthMeasurementMode DestroyPulseWidthMeasurementMode e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_timer_ml6c_62p h void func void unsigned int data 2 Get the measured value of timer Bl as pulse width measurement mode E __GetPulseWidthMeasu
33. PI_TIMER_OFF Sets the timer to stop operating in __CreateEventCounter RAPI_PULSE_ON Selects that pulses are output from TAin pin RAPI_PULSE_OFF Selects that no pulses are output from TAin pin RAPI_AUTO_RELOAD Selects reload type for the count type RAPI_FREE_RUN Selects free run type for the count type 2007 11 14 REC10B0002 0100 44 RAPI_UP_COUNT Selects up count for the count operation RAPI_LDOWN_COUNT Selects down count for the count operation RAPI_UDF_REGISTER Selects the UDF register for the cause of up down switching RAPI_TAIOUT Selects the input signal at TAiour pin for the cause of up down switching RAPI_RISING Selects the rising edge of count source as active edge RAPI_FALLING Selects the falling edge of count source as active edge RAPI_BOTH Selects both rising and falling edges of count source as active edges Specifiable definition values when timer A is used RAPI_TIMER_AO to RAPI_TIMER_A4 specified Count source Operating states set Pulse output facility Gate facility Count type Count direction Count direction switching Count edge Specify one from RAPI_EV_EXTERNAL RAPI_EV_TIMER_AJ RAPI_EV_TIMER_AK RAPI_EV_TIMER_B2 The default value is RAPI_EV_EXTERNAL Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF Specify one from RAPI_PUL
34. PORT_9 0 Port P9o RAPI_PORT_9 1 Port P9 RAPI_PORT_9 2 Port P92 RAPI_PORT_9 3 Port P93 RAPI_PORT_9 4 Port P94 RAPI_PORT_9 5 Port P95 Rev 1 00 2007 11 1 74 REC10B0002 0100 RAPI_PORT_9 6 Port P96 RAPI_PORT_9 7 Port P97 RAPI_PORT_10_0 Port P100 RAPI_PORT_10_1 Port P10 RAPI_PORT_10_2 Port P102 RAPI_PORT_10_3 Port P103 RAPI_PORT_10_4 Port P104 RAPI_PORT_10_5 Port P105 RAPI_PORT_10_6 Port P106 RAPI_PORT_10_7 Port P10 RAPI_PORT_11_0 Port P110 RAPI_PORT_11_1 Port P11 RAPI_PORT_11_2 Port P112 RAPI_PORT_11_3 Port P113 RAPI_PORT_11_4 Port P114 RAPI_PORT_11_5 Port P115 RAPI_PORT_11_6 Port P116 RAPI_PORT_11_7 Port P117 RAPI_PORT_12_0 Port P12 RAPI_PORT_12 1 Port P12 RAPI_PORT_12_2 Port P122 RAPI_PORT_12_3 Port P123 RAPI_PORT_12_4 Port P124 RAPI_PORT_12_5 Port P125 RAPI_PORT_12 6 Port P126 RAPI_PORT_12 7 Port P127 RAPI_PORT_13_0 Port P130 RAPI_PORT_13_1 Port P13 RAPI_PORT_13_2 Port P132 RAPI_PORT_13_3 Port P133 RAPI_PORT_13_4 Port P134 RAPI_PORT_13_5 Port P135 RAPI_PORT_13_6 Port P136 RAPI_PORT_13_7 Port P137 RAPI_PORT_14_0 Port P14 RAPI_PORT_14 1 Port P14 Return value If the I O port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality I O port Reference SetlOPort _ WritelOPort
35. REC10B0002 0100 Everywhere you imagine E 2 E N ESAS M16C 62P Group Renesas Embedded Application Programming Interface Reference Manual Rev 1 00 Renesas Technology Revision Date Nov 1 2007 www renesas com Renesas Embedded Application Programming Interface Reference Manual lt M16C 62P Group gt Rev 1 00 2007 11 1 2 REC10B0002 0100 Table of Contents Walle GP CONTESTA heen eae 3 1 Introduction 4 31244 via A casei abn aad sabe ina bie aed 5 AS A E A PRE NO 6 ARA A E EN 6 2 2 Driver Features A A a e o 6 23 Serial Interface DAVE A as 1 A a A A RANA 8 DAA Timer Mode kanian nt seek fot Re WE eB eo ee 8 2 4 2 Event Counter Mode teteni odes a eA oe 8 2 4 3 Pulse Width Modulation Mode PWM Mode 0 0 00 0 eee eee een eee 8 2 4 4 Pulse Period Measurement Mode 000 eee eens 8 2 4 5 Pulse Width Measurement Mode 000 eee eee eens 8 DS MO Port DIVER co ds Et web es GA AEA SSAA GA a SL a th 9 2 6 External Interrupt ers cision O eile alte 10 2 7 A D Converter Driver tii fe sa Ae ee A oe ee A 11 Be Standard EY Pes e ane o di G wee Nees pre ne odors Ge ld cae nec cece Gi 12 A Library Reference end cole IS A NA heat eee ea 13 4 1 API List by Peripheral Facility vic ita cae bee AAA ae HEROS a eS 13 42 Description of EacrAPl at het bee eas ee ey ee 15 4 2 1 Serial VO 2 eee eee ese A a ee A ee ee 16 x BasieOpenS cba WO nye a det eines A E eee A ark ae 16 lt BasicGlose Seria
36. SE_ON RAPI_PULSE_OFF The default value is RAPI_PULSE_OFF Specify one from RAPI_GATE_L RAPI_GATE_H If omitted No gate facility is set Specify one from RAPI_LAUTO_RELOAD RAPI_FREE_RUN The default value is RAPI_AUTO_RELOAD Specify one from RAPI_UP_COUNT RAPI_DOWN_COUNT The default value is RAPI_DOWN_COUNT The count direction can only be set when the UDF register is used Specify one from RAPI_LUDF_REGISTER RAPI_TAIOUT The default value is RAPI_UDF_REGISTER Specify one from RAPI_RISING RAPI_FALLING The default value is RAPI_FALLING Specifiable definition values when timer B is used RAPI_TIMER_BO to RAPI_TIMER_B4 specified Count source Operating states set Count edge data2 Specify the interrupt priority level 0 7 to be set in the interrupt control register data3 Specify the value to be set in the timer register in 16 bits Rev 1 00 2007 11 14 REC10B0002 0100 Specify one from RAPILEV_EXTERNAL RAPI_EV_TIMER_BJ The default value is RAPI_EV_EXTERNAL Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default value is RAPI_TIMER_OFF Specify one from RAPI_RISING RAPI_FALLING RAPI_BOTH The default value is RAPI_FALLING 45 Return value Functionality Reference Remark data4 Specify 0 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned
37. _7_0 Port P7o RAPI_PORT_7_1 Port P74 Rev 1 00 2007 11 1 71 REC10B0002 0100 RAPI_PORT_7_2 Port P72 RAPI_PORT_7_3 Port P73 RAPI_PORT_7_4 Port P74 RAPI_PORT_7_5 Port P75 RAPI_PORT_7_6 Port P76 RAPI_PORT_7_7 Port P77 RAPI_PORT_8_0 Port P8 RAPI_PORT_8 1 Port P8 RAPI_PORT_8 2 Port P82 RAPI_PORT_8 3 Port P83 RAPI_PORT_8 4 Port P84 RAPI_PORT_8_5 Port P85 RAPI_PORT_8 6 Port P86 RAPI_PORT_8_7 Port P87 RAPI_PORT_9 0 Port P9 RAPI_PORT_9_1 Port P9 RAPI_PORT_9 2 Port P92 RAPI_PORT_9 3 Port P93 RAPI_PORT_9 4 Port P94 RAPI_PORT_9 5 Port P95 RAPI_PORT_9 6 Port P96 RAPI_PORT_9 7 Port P97 RAPI_PORT_10_0 Port P10o RAPI_PORT_10_1 Port P10 RAPI_PORT_10_2 Port P102 RAPI_PORT_10_3 Port P1053 RAPI_PORT_10_4 Port P10 RAPI_PORT_10_5 Port P105 RAPI_PORT_10_6 Port P106 RAPI_PORT_10_7 Port P10 RAPI_PORT_11_0 Port P110 RAPI_PORT_11_1 Port P114 RAPI_PORT_11_2 Port P112 RAPI_PORT_11_3 Port P113 RAPI_PORT_11_4 Port P114 RAPI_PORT_11_5 Port P115 RAPI_PORT_11_6 Port P116 RAPI_PORT_11_7 Port P117 RAPI_PORT_12_0 Port P12 RAPI_PORT_12 1 Port P12 RAPI_PORT_12_2 Port P122 RAPI_PORT_12_3 Port P123 RAPI_PORT_12 4 Port P12 RAPI_PORT_12 5 Port P125 RAPI_PORT_12 6 Port P126 RAPI_PORT_12 7 Port P127 RAPI_PORT_13_0 Port P130 RAPI_PORT_13_1 Port P13 RAPI_PORT_13_2 Port P13 RAPI_PORT_13_3 Port P133 RAPI_PORT_13_4 Port P13 RAPI_PORT_13_5 Port P135 RAPI_PORT_13_6 Port P136 RA
38. _RTS function has no effect UARTO UART1 UART2 RAPI_CTSRTS_DIS _CTS _RTS functions are not used RAPI_CTS_SEL _CTS function is selected RAPI_RTS_SEL _RTS function is selected For the transfer format the following values can be set If the data length selected for use in clock asynchronous serial communication mode is 7 or 9 bits long do not set these values UARTO UART1 UART2 RAPI_LSB_SEL LSB first RAPI_MSB_SEL MSB first SI O3 SI 04 RAPI_SIO_LSB_SEL LSB first RAPI_SIO_MSB_SEL MSB first Tm or serial data logic switchover the following values can be set UARTO UART1 UART2 RAPI_LOGIC_NO_REV The value written in the transmit buffer register does not have its logic inverted RAPI_LOGIC_REV The value written in the transmit buffer register is inverted before being transmitted data2 Sets the divide by N value of a communication speed 2007 11 14 19 REC10B0002 0100 If serial communication was successfully set RAPI_TRUE is returned if settings failed RAPI_FALSE is returned Functionality Serial I O Reference Remark e f an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p Boolean func void Set the data of RAPI_COM1 to serial driver Return _BasicSetSerialFormat RAPI_COM1 RAPI_SM_SYNC
39. ark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_io_port_ml6c_62p h void func void unsigned int data Get the value of port Pl register __ReadIOPortRegister RAPI_PORT_1 data 2007 11 1 80 REC10B0002 0100 _ WritelOPortRegister Synopsis Description Return value lt Write to 1 O port register gt Boolean _ WritelOPortRegister unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Data to be written to I O port register Writes the value for a specified I O port to each relevant register data1 Specify an I O port register to which data is written The definition values corresponding to each I O port register are listed below RAPI_PORT_0O Port PO register RAPI_PORT_1 Port P1 register RAPI_PORT_2 Port P2 register RAPI_PORT_3 Port P3 register RAPI_PORT_4 Port P4 register RAPI_PORT_5 Port P5 register RAPI_PORT_6 Port P6 register RAPI_PORT_7 Port P7 register RAPI_PORT_8 Port P8 register RAPI_PORT_9 Port P9 register RAPI_PORT_10 Port P10 register RAPI_PORT_11 Port P11 register RAPI_PORT_12 Port P12 register RAPI_PORT_13 Port P13 register RAPI_PORT_14 Port P14 register Functionality Reference SetlOPort If the I O port register specification is incorrec
40. as pulse width measurement mode __EnablePulseWidthMeasurementMode RAPI_TIMER_B5 RAPI_TIMER_OFF Rev 1 00 2007 11 14 REC10B0002 0100 62 _ DestroyPulseWidthMeasurementMode Synopsis Description Return value Functionality Reference Remark lt Discard settings of pulse width measurement mode gt Boolean _ DestroyPulseWidthMeasurementMode unsigned long data data Setup data Discards settings of the timer that is set to specified pulse width measurement mode data For data the following definition values can be set RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse width measurement mode CreatePulseWidthMeasurementMode _ EnablePulseWidthMeasurementMode GetPulseWidthMeasurementMode e If an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_timer_ml6c_62p h void func void Destroy the setting of timer BO as pulse width measurement mode __DestroyPulseWidthMeasurementMode RA
41. ation of pulse width measurement mode gt Boolean _ EnablePulseWidthMeasurementMode unsigned long data data Setup data Description Controls operation of the timer that is set to specified pulse width measurement mode data For data the following definition values can be set To set multiple definition values at the same time use the symbol el to separate each specified value RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 RAPI_TIMER_ON Sets the timer that is set to pulse width measurement mode to start operating RAPI_TIMER_OFF Sets the timer that is set to pulse width measurement mode to stop operating Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer pulse width measurement mode Reference CreatePulseWidthMeasurementMode _ DestroyPulseWidthMeasurementMode GetPulseWidthMeasurementMode Remark e f an undefined value is specified in the argument operation of the API cannot be Program example includ guaranteed rapi_timer_ml6c_62p h void func void Disable timer B5
42. can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI 04 If data transmission in serial communication was successfully started RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O BasicSendingStatusRead _ BasicStopSerialSending e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_sif_ml6c_62p Void func void __BasicStartSerialSending RAPI_COM1 Ox00AA 2007 11 14 REC10B0002 0100 22 _ BasicReceivingStatusRead Synopsis lt Read receive status gt unsigned int__BasicReceivingStatusRead unsigned long data data Setup data Description Returns the receive status of serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 Return value The receive status of serial communication is returned The returned value is one of the following UARTO UART1 UART2 RAPI_RX_INCOMPLETE Reception not complete yet Other than above Reception complete The value read from the UARTi receive buffer register i 0 to 2 SI O3 SI 04 RAPI_RX_INCOMPLETE Reception not complete yet Other than above Reception complete Low order 8 bits T
43. cording to specified parameters data1 For data1 the following values can be set To set multiple definition values at the same time use the symbol to separate each specified value RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI1 03 RAPI_COM5 SI 04 For serial communication mode the following values can be set UARTO UART1 UART2 RAPI_SM_SYNC Clock synchronous serial communication mode RAPI_SM_ASYNC Clock asynchronous serial communication mode SI O3 SI 04 RAPI_SIO_SM_SYNC Clock synchronous serial communication mode For the data length format of clock asynchronous serial communication the following values can be set If the API is used in clock synchronous serial communication mode do not set these values UARTO UART1 UART2 RAPI_BIT_7 Transfer data length 7 bits RAPI_BIT_8 Transfer data length 8 bits RAPI_BIT_9 Transfer data length 9 bits For the clock source of serial communication the following values can be set UARTO UART1 UART2 RAPI_CKDIR_INT Internal clock is used as the clock source of serial communication RAPI_CKDIR_EXT External clock is used as the clock source of serial communication SI O3 SI O4 RAPI_SIO_CKDIR_INT Internal clock is used as the clock source of serial communication RAPI_SIO_CKDIR_EXT External clock is used as the clock source of serial communication For the stop bit length of clock asynchronous serial communication the following values can be set If the API is used i
44. d char wordNum unsigned int SndDtBuf data Setup data wordNum Number of words transmitted SndDtBuf Pointer to the transmit data Starts transmission of serial communication and writes transmit data to the transmit buffer by a specified number of words When transmission of all transmit data is complete this API calls a notification function if a notification function is registered data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI 04 If transmission of serial communication was successfully started RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O ConfigSerialDriverNotify _ StopSerialSending e lf an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p unsigned int buffer 10 void func void Set 5 word data to transmit buffer of serial communication __StartSerialSending RAPI_COM1 5 buffer Rev 1 00 2007 11 1 35 REC10B0002 0100 __StopSerialReceiving Synopsis Description Return value Functionality Reference Remark lt Stop reception gt Boolean _ StopSerialReceiving unsigned long data data Setup data Stops reception of serial communication data
45. data2 Description lt Get timer register value gt data1 Setup data data2 Pointer to the buffer in which register value is stored data For data the following definition values can be set Gets the counter value of a specified timer RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 Selects timer B channel 5 RAPI_TIMER_B5 data2 Specify a pointer to the array in which the acquired register value is stored The content of the array is described below Return value Functionality Rev 1 00 REC10B0002 0100 2007 11 1 When using timer A RAPI_TIMER_AO to RAPI_TIMER_A4 specified 0 Store the value of timer Ai mode register i 0 4 1 Store the value of timer Ai register i 0 4 2 Store the value of the up down flag register 3 Store the value of the one shot start flag register 4 Store the value of the trigger select register 5 Store the value of the time clock prescaler reset flag register
46. de rapi_timer_ml6c_62p h void func void Destroy the setting of timer B2 as pulse period measurement mode _ DestroyPulsePeriodMeasurementMode RAPI_TIMER_B2 2007 11 1 58 REC10B0002 0100 _ GetPulsePeriodMeasurementMode Synopsis lt Get measured value in pulse period measurement mode gt Boolean _ GetPulsePeriodMeasuremenitMode unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which counter value is stored Description Gets the counter value of the timer that is set to specified pulse period measurement mode data1 For data the following definition values can be set RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer pulse period measurement mode Reference CreatePulsePeriodMeasurementMode _ EnablePulsePeriodMeasurementMode DestroyPulsePeriodMeasurementMode Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func
47. eWidthModulationMode 000 0000 cece eee eee 50 __EnablePulseWidthModulationMode 0 000 cc eee eee eee e even ee eees 53 _ DestroyPulseWidthModulationMode 0 0 00 e cece eee eens 54 _ CreatePulsePeriodMeasurementMode 000000 c eee eee 55 _ EnablePulsePeriodMeasurementMode 0 000 c eee cece eee e even eens 57 __DestroyPulsePeriodMeasurementMode onnon nnan nnna 58 __GetPulsePeriodMeasurementMode 00 00000 cece eee eee 59 _ CreatePulseWidthMeasurementMode 00000 cece eee ee eee 60 __EnablePulseWidthMeasurementMode 0 000 e cece cece eee e even eens 62 __DestroyPulseWidthMeasurementMode 00000000 e cece eee eens 63 _ GetPulseWidthMeasurementMode 00000 cece eee eee 64 Set lumerRe sister 3 ase Scheel at ee A is 65 AR iit She cee det ars sag eae ee Bea esc Ge ee ae eats oS 67 gt ClearTimerResisteri sa d hid EN A Shedd aaa EE fhe ae Se 68 timer SISTED il arenas O Salk A oad dc GA Ae AS a eRe ei a 69 AD Bl OP OMG 5 eee da tt ld e a Dace ls el 71 SetlOPOrt e A A AL ee 71 a ReadlO Por A A A a As PA ES 74 A WiitelOPRGtts A a o alioli 76 MES va sss ahs Ro A OR Ale ET Sd hee 18 Re diOPortRegister i iei a A a 80 MuitelO Pon Register 1 sl lr os Das Os od lcd 81 4 A External OD or A ne em Mee Oe a eee da 82 SUMA A SS E aici Piao a Phot ae Sal 82 Phablelmten pte resenu 5 an hee Kaede eas te Re hae ta es toe a hee 84 A eds bce eed ok 85 a Olearlnterupillagacst sai fak sei
48. each specified value Note however that multiple ports cannot be specified at the same time The definition values corresponding to each I O port are listed below RAPI_PORT_0_0 Port POo RAPI_PORT_0 1 Port PO RAPI_PORT_0_2 Port P02 RAPI_PORT_0_3 Port PO3 RAPI_PORT_0O 4 Port P04 RAPI_PORT_0_5 Port POs RAPI_PORT_0_6 Port POs RAPI_PORT_0_7 Port PO RAPI_PORT_1_0 Port P1o RAPI_PORT_1_1 Port P1 RAPI_PORT_1_2 Port P12 RAPI_PORT_1_3 Port P13 RAPI_PORT_1_4 Port P14 RAPI_PORT_1_5 Port P15 RAPI_PORT_1_6 Port P16 RAPI_PORT_1_7 Port P17 RAPI_PORT_2 0 Port P2o RAPI_PORT_2 1 Port P24 RAPI_PORT_2 2 Port P22 RAPI_PORT_2 3 Port P23 RAPI_PORT_2 4 Port P2 RAPI_PORT_2_5 Port P25 RAPI_PORT_2 6 Port P26 RAPI_PORT_2 7 Port P27 RAPI_PORT_3_0 Port P30 RAPI_PORT_3_1 Port P3 RAPI_PORT_3_ 2 Port P32 RAPI_PORT_3_3 Port P33 RAPI_PORT_3 4 Port P34 RAPI_PORT_3_5 Port P35 RAPI_PORT_3 6 Port P36 RAPI_PORT_3 7 Port P37 RAPI_PORT_4 0 Port P4o RAPI_PORT_4 1 Port P4 RAPI_PORT_4 2 Port P42 RAPI_PORT_4 3 Port P43 RAPI_PORT_4 4 Port P44 RAPI_PORT_4 5 Port P45 RAPI_PORT_4 6 Port P46 RAPI_PORT_4 7 Port P47 RAPI_PORT_5_0 Port P5o RAPI_PORT_5 1 Port P5 RAPI_PORT_5 2 Port P52 RAPI_PORT_5 3 Port P53 RAPI_PORT_5 4 Port P54 RAPI_PORT_5_ 5 Port P55 RAPI_PORT_5 6 Port P56 RAPI_PORT_5 7 Port P57 RAPI_PORT_6_0 Port P69 RAPI_PORT_6_1 Port P6 RAPI_PORT_6_2 Port P62 RAPI_PORT_6_3 Port P63 RAPI_PORT_6_4 Port P64 RAPI_PORT_6_5 Port P65 RAPI_PORT_6_6 Port P66 RAPI_PORT_6_7 Port P67 RAPI_PORT
49. eatePulseWidthMeasurementMode RAPI_TIMER_OFF Sets the timer to stop operating in _ CreatePulseWidthMeasurementMode e Specifiable definition values when timer B is used RAPI_TIMER_BO to RAPI_TIMER_B2 specified Count source Specify one from RAPI_F1 RAPI_F2 RAPI_F8 RAPI_F32 RAPI_FC32 The default value is RAPI_F2 Operating Specify one from RAPI_TIMER_ON RAPI_TIMER_OFF The default states set value is RAPI_TIMER_OFF data2 Specify the interrupt priority level 0 7 to be set in the interrupt control register data3 Specify 0 2007 11 14 60 REC10B0002 0100 data4 Specify 0 Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer pulse width measurement mode Reference EnablePulseWidthMeasurementMode _ DestroyPulseWidthMeasurementMode GetPulseWidthMeasurementMode Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void TimerIntFunc void void func void Set up timer B4 as pulse width measurement mode __CreatePulseWidthMeasurementMode RAPI_TIMER_B4 RAPI_TIMER_ON RAPI_RISING_FALLING RAPI_F8 5 0 0 TimerIntFunc Rev 1 00 2007 11 1 61 REC10B0002 0100 __EnablePulseWidthMeasurementMode Synopsis lt Control oper
50. eriod measurement mode gt Boolean _ CreatePulsePeriodMeasurementMode unsigned long data1 unsigned int data2 unsigned int data3 unsigned int data4 void func Description data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer Specify 0 if no callback functions are set data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol Sets a specified timer to pulse period measurement mode gi to separate each specified value RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 RAPI_F1 Uses timer B channel 5 Selects f for the count source RAPI_F2 Selects fz for the count source RAPI_F8 Selects fg for the count source RAPI_F32 Selects fs2 for the count source RAPI_FC32 Selects fcs2 for the count source RAPI_TIMER_ON Sets the timer to start operating in __CreatePulsePeriodMeasurementMode RAPI_TIMER_OFF Sets the timer to stop operating in __CreatePulsePeriodMeasurementMode RAPI_RISING_ RISING Selects measurement of an interval from the rise to the next rise of a measurement pulse
51. es at the same time use the symbol pP to separate each specified value RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 RAPI_TIMER_B5 Selects timer B channel 4 Selects timer B channel 5 RAPI_TIMER_ON Sets the selected timer to start operating RAPI_TIMER_OFF Sets the selected timer to stop operating Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer register manipulation Reference SetTimerRegister _ ClearTimerRegister GetTimerRegister Remark e If an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_timer_m16c_62p h void func void Activate timer Al __EnableTimerRegister RAPI_TIMER_Al1 RAPI_TIMER_ON Rev 1 00 2007 11 14 REC10B0002 0100 67 __ClearTimerRegister Synopsis Description lt Clear timer register gt Boolean _ ClearTime
52. flow interrupt occurs it calls a preset callback function 2 4 3 Pulse Width Modulation Mode PWM Mode In this mode the timer outputs pulses in a given width successively When an underflow or an overflow interrupt occurs it calls a preset callback function 2 4 4 Pulse Period Measurement Mode In this mode the timer measures the pulse period of an external signal fed in from an input pin When an underflow or an overflow interrupt occurs it calls a preset callback function 2 4 5 Pulse Width Measurement Mode In this mode the timer measures the pulse width of an external signal fed in from an input pin When an underflow or an overflow interrupt occurs it calls a preset callback function Rev 1 00 2007 11 1 8 REC10B0002 0100 2 5 I O Port Driver The I O port driver sets the I O port for input or output writes data to the I O port and reads data from the I O port Rev 1 00 2007 11 1 9 REC10B0002 0100 2 6 External Interrupt Driver The external interrupt driver sets external interrupts controls external interrupts acquires the status of external interrupt flags and clears external interrupt flags Rev 1 00 2007 11 1 10 REC10B0002 0100 2 7 A D Converter Driver The A D converter driver sets the A D converter controls the A D converter clears settings of the A D converter acquires the A D converter value acquires the status of the A D converter and clears the status of the A D converter Rev 1 00 2007 11 1 11 R
53. functions are set data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol Rev 1 00 REC10B0002 0100 Sets a specified timer to pulse width modulation mode aii to separate each specified value RAPI_TIMER_AO Uses timer A channel 0 RAPI_TIMER_A1 RAPI_TIMER_A2 Uses timer A channel 1 Uses timer A channel 2 RAPI_TIMER_A3 Uses timer A channel 3 RAPI_TIMER_A4 Uses timer A channel 4 RAPI_F1 Selects f for the count source RAPI_F2 Selects fz for the count source RAPI_F8 Selects fg for the count source RAPI_F32 Selects fs2 for the count source RAPI_FC32 Selects fc32 for the count source RAPI_TIMER_ON Sets the timer to start operating in __CreatePulseWidthModulationMode RAPI_TIMER_OFF Sets the timer to stop operating in __CreatePulseWidthModulationMode RAPI_TG_TAIIN Selects external trigger input from TAjm pin for the count start condition RAPI_EV_ TIMER_AJ Selects overflow or underflow of timer Aj j i 1 however j 4 if i 0 as the trigger for the timer to start counting RAPI_EV_TIMER_ AK Selects overflow or underflow of timer Ak k i 1 however k 0 if i 4 as the trigger for the timer to start counting RAPI_EV_TIMER_ B2 Selects overflow or underflow of timer B2 as the trigger for the timer to start counting
54. gument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void Notify unsigned char result if result amp RAPI_OVER_ERR RAPI_OVER_ERR Overrun error if result amp RAPI_FRAMING_ERR RAPI_FRAMING_ERR Framing error if result amp RAPI_PARITY_ERR RAPI_PARITY_ERR Parity error if result amp RAPI_TX_END RAPI_TX_END Transmission completion if result amp RAPI_RX_END RAPI_RX_END Reception completion Boolean func void Set callback functions of RAPI_COM1 to serial driver return __ConfigSerialDriverNotify RAPI_COM1 Notify Rev 1 00 2007 11 1 30 REC10B0002 0100 _ SetSerialFormat Synopsis lt Set serial communication gt Boolean _ SetSerialFormat unsigned long data1 unsigned char data2 data1 Setup data 1 data2 Setup data 2 Description Sets serial communication according to specified parameters For details about parameters refer to the description of __BasicSetSerialFormat Return value If serial communication was successfully set RAPI_TRUE is returned if settings failed RAPI_FALSE is returned Functionality Serial I O Reference Remark e f an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p
55. gument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func void Enable timer B1 as pulse period measurement mode __EnablePulsePeriodMeasurementMode RAPI_TIMER_B1 RAPI_TIMER_ON Rev 1 00 2007 11 1 57 REC10B0002 0100 _ DestroyPulsePeriodMeasurementMode Synopsis Description Return value Functionality Reference Remark lt Discard settings of pulse period measurement mode gt Boolean _ DestroyPulsePeriodMeasurementMode unsigned long data data Setup data Discards settings of the timer that is set to specified pulse period measurement mode data For data the following definition values can be set RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse period measurement mode CreatePulsePeriodMeasurementMode _ EnablePulsePeriodMeasurementMode GetPulsePeriodMeasurementMode e If an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 inclu
56. he default value is RAPI_FALLING The active edge of TAin pin input can only be set when RAPI_TG_TAIIN is selected Specify the interrupt priority level 0 7 to be set in the interrupt control register data3 Specify a pointer to the 16 bit variable in which the set value for the timer register is stored For 16 bit PWM specify the value of n in high level width n f period 65535 f in 16 bits For 8 bit PWM specify the values of n and m in high level width n m 1 f period 255 m 1 f in the 8 high order bits and the 8 low order bits respectively Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer pulse width modulation mode PWM mode Reference EnablePulseWidthModulationMode _ DestroyPulseWidthModulationMode Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void TimerIntFunc void Rev 1 00 2007 11 1 REC10B0002 0100 51 void func void unsigned int p_tim 0xAA 0xBB 0xCC Set up timer A3 as pulse width modulation mode __CreatePulseWidthModulationMode RAPI_TIMER_A3 RAPI_TIMER_ON RAPI_F8 5 p_tim TimerIntFunc Rev 1 00 2007 11 1 52 REC10B0002 0100 __EnablePulseWidthModulationMode Synopsis
57. he value read from the SI Oi transmit receive register i 3 4 Functionality Serial I O Reference BasicStartSerialReceiving _ BasicStopSerialReceiving Remark e Ifan undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void unsigned int rcv_data rcv_data __BasicReceivingStatusRead RAPI_COM1 Rev 1 00 2007 11 1 23 REC10B0002 0100 _ BasicSendingStatusRead Synopsis lt Read transmit status gt Boolean _ BasicSendingStatusRead unsigned long data data Setup data Description Returns the transmit status of serial communication For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 Return value lf no data exists in the transmit buffer RAPI_TRUE is returned if data exists RAPI_FALSE is returned Functionality Serial I O Reference BasicStartSerialSending _ BasicStopSerialSending Remark e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void if __BasicSendingStatusRead RAPI_COM1 RAPI_TRUE Transmission completion Rev 1 00 2007 11 14 24 REC10B0002 0100 _ Bas
58. i_interrupt_ml6c_62p h void IntFunc void void func void Set up _INTO interrupt __SetInterrupt RAPI_INTO RAPI_INT_FALLING 0 IntFunc Rev 1 00 2007 11 1 83 REC10B0002 0100 _ Enablelnterrupt Synopsis lt Control external interrupt gt Boolean _ Enablelnterrupt unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Setup data 2 Description Changes the operating condition of a specified external interrupt data1 RAPI_INTO Uses _ INTO interrupt RAPI_INT1 Uses _INT1 interrupt RAPI_INT2 Uses _INT2 interrupt RAPI_INT3 Uses _INT3 interrupt RAPI_INT4 Uses _INTA4 interrupt RAPI_INT5 Uses _INT5 interrupt RAPI_KEY Uses key input interrupt data2 Specify the interrupt priority level 0 7 to be set in the interrupt control register Return value If the external interrupt specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality External interrupt Reference Setinterrupt GetinterruptFlag _ ClearlnterruptFlaq Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_interrupt_ml6c_62p h void func void Activate _INT1 interrupt interrupt priority level 5 __Enablelnterrupt RAPI_INTI 5 Rev 1 00 2007 11 1 84 REC10B0002
59. icStopSerialReceiving Synopsis Description Return value Functionality Reference Remark lt Stop reception gt Boolean Rapi_BasicStopSerialReceiving unsigned long data data Setup data Stops receiving data in serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 If data reception in serial communication was successfully stopped RAPI_TRUE is returned if failed RAPI_FALSE is returned Serial I O BasicStartSerialReceiving e For the M16C SI 03 and SI 04 this API cannot be used e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void Stop receiving data in serial communication __ BasicStopSerialReceiving Rev 1 00 2007 11 14 REC10B0002 0100 25 RAPI_COM1 _ BasicStopSerialSending Synopsis Description Return value Functionality Reference Remark lt Stop transmission gt Boolean _ BasicStopSerialSending unsigned long data data Setup data Stops transmitting data in serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2
60. imer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 Return value Functionality Reference CreateEventCounter Remark If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer event counter mode EnableEventCounter _ DestroyEventCounter e lf an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_timer_ml6c_62p h void func void unsigned int data 2 Get the counter of timer B3 as event counter mode __GetEventCounter RAPI_TIMER_B3 data 2007 11 14 49 REC10B0002 0100 _ CreatePulseWidthModulationMode Synopsis lt Set pulse width modulation mode gt Boolean _ CreatePulseWidthModulationMode unsigned long data1 unsigned int data2 unsigned int data3 void data4 Description data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 func Callback function pointer Specify 0 if no callback
61. iption Gets the value of a specified I O port data1 Specify an I O port from which data is read The definition values corresponding to each I O port are listed below RAPI_PORT_0_0 Port POo RAPI_PORT_0 1 Port PO RAPI_PORT_0_2 Port P02 RAPI_PORT_0_3 Port POz RAPI_PORT_0_4 Port PO RAPI_PORT_0_5 Port PO RAPI_PORT_0_6 Port POs RAPI_PORT_0_7 Port PO RAPI_PORT_1_0 Port P1o RAPI_PORT_1_1 Port P1 RAPI_PORT_1_2 Port P12 RAPI_PORT_1_3 Port P13 RAPI_PORT_1_4 Port P14 RAPI_PORT_1_5 Port P15 RAPI_PORT_1_6 Port P16 RAPI_PORT_1_7 Port P17 RAPI_PORT_2_0 Port P2o RAPI_PORT_2 1 Port P2 RAPI_PORT_2 2 Port P22 RAPI_PORT_2 3 Port P23 RAPI_PORT_2 4 Port P24 RAPI_PORT_2 5 Port P25 RAPI_PORT_2 6 Port P26 RAPI_PORT_2 7 Port P27 RAPI_PORT_3_0 Port P3o RAPI_PORT_3 1 Port P3 RAPI_PORT_3_2 Port P32 RAPI_PORT_3_3 Port P33 RAPI_PORT_3 4 Port P3 RAPI_PORT_3_5 Port P35 RAPI_PORT_3 6 Port P36 RAPI_PORT_3_7 Port P37 RAPI_PORT_6_0 Port P65 RAPI_PORT_6_1 Port P6 RAPI_PORT_6_2 Port P62 RAPI_PORT_6_3 Port P63 RAPI_PORT_6_4 Port P64 RAPI_PORT_6_5 Port P65 RAPI_PORT_6_6 Port P66 RAPI_PORT_6_7 Port P67 RAPI_PORT_7_0 Port P7o RAPI_PORT_7_1 Port P74 RAPI_PORT_7_2 Port P72 RAPI_PORT_7_3 Port P73 RAPI_PORT_7_4 Port P74 RAPI_PORT_7_5 Port P75 RAPI_PORT_7_6 Port P76 RAPI_PORT_7_7 Port P77 RAPI_PORT_8_0 Port P85 RAPI_PORT_8_1 Port P8 RAPI_PORT_8 2 Port P82 RAPI_PORT_8_ 3 Port P83 RAPI_PORT_8 4 Port P8 RAPI_PORT_8_5 Port P85 RAPI_PORT_8 6 Port P86 RAPI_PORT_8 7 Port P87 RAPI_
62. iscarded RAPI_TRUE is returned if failed RAPI_FALSE is returned A D converter CreateADC _EnableADC _GetADC GetADCAII Program example include rapi_ad_ml6c_62p h void func void Destroy A D converter __DestroyADC Rev 1 00 2007 11 1 95 REC10B0002 0100 _ GetADC Synopsis lt Get A D converted value register specified gt Boolean _ GetADC unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which A D converted value is stored Description Gets the A D converted value from a specified A D register For data1 the following values can be set RAPI_ADO Selects A D register 0 RAPI_AD1 Selects A D register 1 RAPI_AD2 Selects A D register 2 RAPI_AD3 Selects A D register 3 RAPI_AD4 Selects A D register 4 RAPI_AD5 Selects A D register 5 RAPI_AD6 Selects A D register 6 RAPI_AD7 Selects A D register 7 Return value If A D converted value was successfully acquired RAPI_TRUE is returned if failed RAPI_FALSE is returned Functionality A D converter Reference CreateADC _EnableADC _ DestroyADC _ GetADCAIl Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_ad_ml6c_62p h void func void unsigned int data Get an A
63. ive interrupt priority level 4 RAPI_INT_RX_LV_5 Receive interrupt priority level 5 RAPI_INT_RX_LV_6 Receive interrupt priority level 6 RAPI_INT_RX_LV_7 Receive interrupt priority level 7 SI 03 SI O4 RAPI_INT_SIO_DIS SI O interrupt disabled RAPI_INT_SIO_LV_1 SI O interrupt priority level 1 RAPI_INT_SIO_LV_2 SI O interrupt priority level 2 RAPI_INT_SIO_LV_3 SI O interrupt priority level 3 RAPI_INT_SIO_LV_4 SI O interrupt priority level 4 RAPI_INT_SIO_LV_5 SI O interrupt priority level 5 RAPI_INT_SIO_LV_6 SI O interrupt priority level 6 RAPI_INT_SIO_LV_7 SI O interrupt priority level 7 Return value RAPI_TRUE is returned Rev 1 00 REC10B0002 0100 2007 11 14 32 If the serial port specification is incorrect RAPI_FALSE is returned otherwise Functionality Serial I O Reference Remark e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p Boolean func void Set interrupt of RAPI_COM1 to serial driver return __SetSerialInterrupt RAPI_COM1 RAPI_INT_TX_LV_1 RAPI_INT_RX_LV_2 Rev 1 00 2007 11 1 33 REC10B0002 0100 _ StartSerialReceiving Synopsis Description Return value Functionality Reference
64. l 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 RAPI_TIMER_ON Sets the timer that is set to timer mode to start operating RAPI_TIMER_OFF Sets the timer that is set to timer mode to stop operating Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer timer mode Reference CreateTimer _ DestroyTimer Remark e f an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func void Disable timer Al as timer mode __EnableTimer RAPI_TIMER_Al RAPI_TIMER_OFF Rev 1 00 2007 11 14 42 REC10B0002 0100 _ DestroyTimer Synopsis lt Discard settings of timer mode gt Boolean _ DestroyTimer unsigned long data data Setup data Description Discards settings of the timer that is set to specified timer mode Return value Functionality Reference Remark data For
65. l rivers ra aliado 17 __BasicSetSerialFormat 0 000000 n a a N aa n Na ete eee eee 18 _ BasicStartSerialReceiving e yt A eed 21 _ BasicStartSerialSending txts a os Das se bi 22 c BasicReceivingStatusRead Ss dr eee oe a tenes ii 23 Basie SendiigotatisRead tn E Paiva Seals Sie A Pe eat ea 24 BASICA OPS EUA ROS ss A AAA dies eee ieee 25 _ BasicStopSerialSending 0 ee etc ne ed es E 26 pasea Drivers jouw lak sei lot Baal ok eel tah as outa 27 GIGs Senal Driver ss st ee Se Baise SR Be ne ea iin Bn 28 sW Onis Serial Driver NOULY tases ere Saal Garhi Sen Sele tena eae Ren ete nal ta 29 Je SetS eral POrMat anti os ethno ale whe ts a os cokes a oleae Pad 31 SS A o o o ele bed 32 StartSernalReceiVing ii ci Ruki Beets eA leas E a a A Lis AE 34 MAA A Wa ahead don hel el ea 35 J STOPSe rial REGERVING nemesen teh ie tiie Bt eke ito Nik et ite ald eke he aol ler t 36 Opa Mas suit ag viedo wkd ae ana See lei 37 _PollingSerialReceiving o be lee cet 38 _PollingSerialSending lt 2 FS uses ls etal ut hil tk eee Cos ei ak des 39 ADD A A O 40 ATC E TIMED a A Star bead See Rca bE ge Bt bated tude oie Ae bee Ba Mg 40 SEnablevamer tia A eat Bie ea ee 42 Rev 1 00 2007 11 1 3 REC10B0002 0100 MD O e e ati 43 Create E ventCounter e A oe ee ee A A RA ee ee 44 __EnableEventCounter 0000000000 ec eee e eee eee 41 Ss DestroyEventCounter rada iia o in da ico blade eon 48 AGA EVE COUNT a it ce RA tee SEN Re Rae Boe eh O 49 __CreatePuls
66. l6c_62p h void func void Set inputs outputs of port P1 register __SetIOPortRegister RAPI_PORT_1 OxAA 0 0 Rev 1 00 2007 11 1 79 REC10B0002 0100 __ReadlOPortRegister Synopsis lt Read from I O port register gt Boolean _ ReadlOPortRegister unsigned long data1 unsigned int data2 Description Return value data1 Setup data 1 data2 Pointer to the variable in which the value read from I O port register is stored Gets the value of a specified I O port from each relevant register data1 Specify an I O port register from which data is read The definition values corresponding to each I O port register are listed below RAPI_PORT_0 Port PO register RAPI_PORT_1 Port P1 register RAPI_PORT_2 Port P2 register RAPI_PORT_3 Port P3 register RAPI_PORT_4 Port P4 register RAPI_PORT_5 Port P5 register RAPI_PORT_6 Port P6 register RAPI_PORT_7 Port P7 register RAPI_PORT_8 Port P8 register RAPI_PORT_9 Port P9 register RAPI_PORT_10 Port P10 register RAPI_PORT_11 Port P11 register RAPI_PORT_12 Port P12 register RAPI_PORT_13 Port P13 register RAPI_PORT_14 Port P14 register Functionality Reference If the I O port register specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned I O port SetlOPort _ ReadlOPort _ WritelOPort _ SetlOPortRegister WritelOPortRegister Rem
67. lectable only when one shot mode or repeat mode is used Rev 1 00 2007 11 14 REC10B0002 0100 92 RAPI_AN21 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN22 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN23 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN24 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN25 Uses ANszs pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN26 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN27 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANEXO Uses ANEXO pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_ANEX1 Uses ANEX1 pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_PO_GROUP Uses port Po group for the analog input pin Selectable only when sweep mode repeat sweep mode 0 or repeat sweep mode 1 is used RAPI_P10_GROUP Uses port Pio group for the analog input pin Selectable only when sweep mode repeat
68. ler reset register 6 Specify the set value for the count start flag register When using timer B RAPI_TIMER_BO to RAPI_TIMER_B5 0 Specify the set value for the timer Bi mode register i 0 5 1 Specify the set value for the timer Bi register i 0 5 3 Specify the set value for the time clock prescaler reset register 4 Specify the set value for the count start flag register Return value If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Timer register manipulation Reference EnableTimerRegister _ ClearTimerRegister _ GetTimerRegister Remark Rev 1 00 2007 11 1 65 REC10B0002 0100 If an undefined value is specified in the first argument operation of the API cannot be guaranteed e The specifiable timers differ with each CPU used Program example include rapi_timer_ml6c_62p h void func void unsigned char data 0 0 0 0 0 0 0 Set up timer AO register __SetTimerRegister RAPI_TIMER_AO data Rev 1 00 2007 11 1 66 REC10B0002 0100 __EnableTimerRegister Synopsis lt Control operation of timer register gt Boolean _ EnableTimerRegister unsigned long data data Setup data Description Controls operation of a specified timer by starting or stopping it data For data the following definition values can be set To set multiple definition valu
69. lok Baal Cok util ah eee Dl s b 86 ADA ID CONVE OS Dl Linea dee eet hla de en Le ee ERE Bee encod ti ta 87 Create ADC A Woah asic Namie Santa hin sun Namie las ate 87 PIEADC sess a chs ote a ethno al eke a ol coke te il oh aad 92 SSDestoyADe eile g a dace bye ice Aep brad arcs ie ea face tied he tee bleed bated 95 eo Get ADO 5 3 tile e ol o A ts Ah ee 96 2 GetAD CAM ae a ld A Se the A A ee 97 Rev 1 00 2007 11 1 4 REC10B0002 0100 1 Introduction The Renesas Embedded Application Programming Interface APD is a unified API for the microcomputers made by Renesas Technology Corporation Rev 1 00 2007 11 1 5 REC10B0002 0100 2 Driver 2 1 Overview The library described herein provides a peripheral facility control program peripheral driver for microcomputers Use of the Renesas API permits the peripheral driver to be built into a user program 2 2 Driver Features The library described herein has the following features available as a peripheral driver 1 Serial 1 O control feature It comprises a serial interface driver which sets or clears the conditions of serial communication as well as controls and manages the transmission reception of communication data 2 Timer control feature It comprises a timer driver which sets or clears the operating conditions of timers as well as controls the timer operation 3 I O port control feature It comprises an I O port driver which sets or clears the usage conditions of I O port
70. n clock synchronous serial communication mode do not set these values UARTO UART1 UART2 RAPI_STPB_1 1 stop bit RAPI_STPB_2 2 stop bits For the parity bit of clock asynchronous serial communication the following values can be set Rev 1 00 2007 11 1 18 REC10B0002 0100 Return value Rev 1 00 If the API is used in clock synchronous serial communication mode do not set these values UARTO UART1 UART2 RAPI_PARITY_NON No parity bit RAPI_PARITY_EVEN Even parity bit RAPI_PARITY_ODD Odd parity bit For the clock polarity of serial communication the following values can be set If the API is used in clock asynchronous serial communication mode do not set these values UARTO UART1 UART2 RAPI_DPOL_NON Polarity not inverted RAPI_DPOL_INV Polarity inverted SI O3 SI O4 RAPI_SIO_DPOL_NON Polarity not inverted RAPI_SIO_DPOL_INV Polarity inverted For the count source of the built in baud rate generator the following values can be set UARTO UART1 UART2 RAPI_BCSS_F1 f1SIO RAPI_BCSS_F2 f2SIO RAPI_BCSS_F8 f8SIO RAPI_BCSS_F32 f32SIO SI O3 SI O4 RAPI_SIO_BCSS F1 f1SIO RAPI_SIO_BCSS F2 f2SIO RAPI_SIO_BCSS_F8 f8SIO RAPI_SIO_BCSS_F32 f32SIO For the _CTS _RTS function the following values can be set If the internal clock is selected for use in clock synchronous serial communication mode the
71. nablePulseWidthModulationMode RAPI_TIMER_A2 RAPI_TIMER_ON 2007 11 1 53 REC10B0002 0100 _ DestroyPulseWidthModulationMode Synopsis Description Return value Functionality Reference Remark lt Discard settings of pulse width modulation mode gt Boolean _ DestroyPulseWidthModulationMode unsigned long data data Setup data Discards settings of the timer that is set to specified pulse width modulation mode data For data the following definition values can be set RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer pulse width modulation mode PWM mode CreatePulseWidthModulationMode EnablePulseWidthModulationMode e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_timer_ml6c_62p h void func void Destroy the setting of timer Al as pulse width modulation mode __DestroyPulseWidthModulationMode RAPI_TIMER_A1 Rev 1 00 2007 11 14 54 REC10B0002 0100 _ CreatePulsePeriodMeasurementMode Synopsis lt Set pulse p
72. nel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 to separate each specified value CreateEventCounter DestroyEventCounter RAPI_TIMER_ON Sets the timer that is set to event counter mode to start operating RAPI_TIMER_OFF Sets the timer that is set to event counter mode to stop operating If the timer specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Timer event counter mode GetEventCounter If an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 2007 11 1 include rapi_timer_ml6c_62p h void func void Disable timer Bl as event counter mode __EnableEventCounter RAPI_TIMER_B1 RAPI_TIMER_OFF 47 REC10B0002 0100 _ DestroyEventCounter Synopsis Description lt Discard settings of event counter mode gt Boolean _ DestroyEventCounter unsigned long data data Setup data Discards settings of the timer that is set to specified timer mode data For data the following definition values can be set RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 R
73. nsmission __StartSerialSending RAPI_COM1 5 buffer while 1 __ PollingSerialSending RAPI_COM1 2007 11 14 39 REC10B0002 0100 4 2 2 Timer _ CreateTimer Synopsis Description Rev 1 00 lt Set timer mode gt Boolean _ CreateTimer unsigned long data1 unsigned int data2 unsigned int data3 unsigned int data4 void func data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer Specify 0 if no callback functions are set Sets a specified timer to timer mode data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol RAPI_TIMER_AO la to separate each specified value Uses timer A channel 0 RAPI_TIMER_A1 RAPI_TIMER_A2 Uses timer A channel 1 Uses timer A channel 2 RAPI_TIMER_A3 Uses timer A channel 3 RAPI_TIMER_A4 Uses timer A channel 4 RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 RAPI_F1 Selects f for the count source RAPI_F2 Selects fz for the count source RAPI_F8 Selects fg for the count source RAPI_F32 Selects fa2 for the count source
74. o callback functions are set Sets a specified timer to event counter mode data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol RAPI_TIMER_AO a to separate each specified value Uses timer A channel 0 RAPI_TIMER_A1 RAPI_TIMER_A2 Uses timer A channel 1 Uses timer A channel 2 RAPI_TIMER_A3 Uses timer A channel 3 RAPI_TIMER_A4 Uses timer A channel 4 RAPI_TIMER_BO Uses timer B channel 0 RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 RAPI_EV_EXTERNAL Selects the external signal input to TAin pin when using timer Ai or TBin pin when using timer Bi for the count source RAPI_EV_TIMER_AJ Selects overflow or underflow of timer Aj j i 1 however j 4 if i 0 for the count source RAPI_EV_TIMER_AK Selects overflow or underflow of timer Ak k i 1 however k 0 if i 4 for the count source RAPI_EV_TIMER_B2 Selects overflow or underflow of timer B2 for the count source RAPI_EV_TIMER_BJ Selects overflow or underflow of timer Bj j i 1 however j 2 if i 0 j 5 if i 3 for the count source RAPI_TIMER_ON Sets the timer to start operating in __CreateEventCounter RA
75. ogram example include rapi_sif_ml6c_62p void func void Open serial driver return __BasicOpenSerialDriver RAPI_COM1 Rev 1 00 2007 11 14 16 REC10B0002 0100 _ BasicCloseSerialDriver Synopsis lt Close a serial port gt Boolean _ BasicCloseSerialDriver unsigned long data data Setup data Description Closes a specified serial port For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 Return value If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Serial I O Reference BasicOpenSerialDriver Remark e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void Close serial driver return __BasicCloseSerialDriver RAPI_COM1 Rev 1 00 2007 11 14 17 REC10B0002 0100 _ BasicSetSerialFormat Synopsis lt Set serial communication gt Boolean _ BasicSetSerialFormat unsigned long data1 unsigned char data2 data1 Setup data 1 data2 Setup data 2 Description Sets serial communication ac
76. ort P3o RAPI_PORT_3_1 Port P34 RAPI_PORT_3_2 Port P32 RAPI_PORT_3_3 Port P33 RAPI_PORT_3_4 Port P34 RAPI_PORT_3_5 Port P35 RAPI_PORT_3_6 Port P36 RAPI_PORT_3_7 Port P37 RAPI_PORT_6_0 Port P65 RAPI_PORT_6_1 Port P6 RAPI_PORT_6_2 Port P62 RAPI_PORT_6_3 Port P63 RAPI_PORT_6_4 Port P64 RAPI_PORT_6_5 Port P65 RAPI_PORT_6_6 Port P66 RAPI_PORT_6_7 Port P67 RAPI_PORT_7_0 Port P7o RAPI_PORT_7_1 Port P74 RAPI_PORT_7_2 Port P72 RAPI_PORT_7_3 Port P73 RAPI_PORT_7_4 Port P74 RAPI_PORT_7_5 Port P75 RAPI_PORT_7_6 Port P76 RAPI_PORT_7_7 Port P77 RAPI_PORT_8_0 Port P85 RAPI_PORT_8_1 Port P8 RAPI_PORT_8_2 Port P82 RAPI_PORT_8_ 3 Port P83 RAPI_PORT_8_4 Port P8 RAPI_PORT_8_5 Port P85 RAPI_PORT_8_6 Port P8 RAPI_PORT_8_7 Port P87 RAPI_PORT_9_0 Port P90 RAPI_PORT_9_1 Port P9 RAPI_PORT_9_2 Port P92 RAPI_PORT_9_3 Port P93 RAPI_PORT_9_4 Port P94 RAPI_PORT_9_5 Port P95 Rev 1 00 2007 11 14 76 REC10B0002 0100 RAPI_PORT_9_6 Port P96 RAPI_PORT_9_7 Port P97 RAPI_PORT_10_0 Port P10o RAPI_PORT_10_1 Port P10 RAPI_PORT_10_2 Port P102 RAPI_PORT_10_3 Port P103 RAPI_PORT_10_4 Port P104 RAPI_PORT_10_5 Port P105 RAPI_PORT_10_6 Port P106 RAPI_PORT_10_7 Port P107 RAPI_PORT_11_0 Port P110 RAPI_PORT_11_1 Port P11 RAPI_PORT_11_2 Port P112 RAPI_PORT_11_3 Port P113 RAPI_PORT_11_4 Port P114 RAPI_PORT_11_5 Port P115 RAPI_PORT_11_6 Port P116 RAPI_PORT_11_7 Port P117 RAPI_PORT_12_0 Port P12 RAPI_PORT_12_1 Port P12 RAPI_P
77. otify Registers notification function 13 SetSerialFormat Sets serial communication 14 SetSeriallnterrupt Sets transmit receive interrupt 15 StartSerialReceiving Starts reception 16 StartSerialSending Starts transmission 17 StopSerialReceiving Stops reception 18 StopSerialSending Stops transmission 19 PollingSerialReceiving Receives by polling 20 PollingSerialSending Transmits by polling 21 Timer CreateTimer Sets timer mode 22 EnableTimer Controls timer mode operation 23 DestroyTimer Clears timer mode setting 24 CreateEventCounter Sets event counter mode 25 EnableEventCounter Controls operation of event counter mode 26 DestroyEventCounter Clears setting of event counter mode 27 GetEventCounter Gets event counter mode counter value 28 _ CreatePulseWidthModulationMode Sets pulse width modulation mode 29 _ EnablePulseWidthModulationMode Controls operation of pulse width modulation mode 30 DestroyPulseWidthModulationMode Clears setting of pulse width modulation mode 31 _ CreatePulsePeriodMeasurementMode Pa period measurement 32 _ EnablePulsePeriodMeasurementMode Controls operation of pulse period measurement mode 33 DestroyPulsePeriodMeasurementMode Clears setting of pulse width measurement mode 34 _ GetPulsePeriodMeasurementMode Acquires measured value of pulse period measurement mode Rev 1 00 2007 11 1 13 REC10B0002 0100
78. priority level 0 7 to be set in the interrupt control register Return value is returned Functionality A D converter Reference EnableADC If A D converter was successfully set RAPI_TRUE is returned if failed RAPI_FALSE DestroyADC _GetADC __GetADCAII Rev 1 00 2007 11 14 REC10B0002 0100 90 Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example include rapi_ad_ml6c_62p h void AdIntFunc void void func void Set up A D converter as one short mode __CreateADC RAPI_ONE_SHOT RAPI_AN2 RAPI_FAD2 RAPI_WITH_SAMPLE_HOLD RAPI_EXTERNAL_TRIGGER RAPI_AD_ON RAPI_10BIT RAPI_ANEX_UNUSED 1 5 AdIntFunc Rev 1 00 2007 11 1 91 REC10B0002 0100 __EnableADC Synopsis lt Control operation of A D converter gt Boolean _ EnableADC unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Number of analog input pins used by A D converter Description Controls operation of the A D converter by starting or stopping it data1 RAPI_ANO Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN1 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used RAPI_AN2 Uses AN pin for the analog input pin Selectable only when one shot mode or repeat mode is used
79. rRegister unsigned long data data Setup data Sets the timer register of a specified timer to its initial value after reset data For data the following definition values can be set Return value Functionality Reference Remark If the timer specification is incorrect RAPI_FALSE RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 RAPI_TIMER_B3 Selects timer B channel 3 RAPI_TIMER_B4 Selects timer B channel 4 RAPI_TIMER_B5 Selects timer B channel 5 RAPI_TRUE is returned Timer register manipulation is returned otherwise SetTimerRegister _ EnableTimerRegister _ GetTimerRegister Program example Rev 1 00 include If an undefined value is specified in the argument operation of the API cannot be guaranteed void func void rapi_timer_ml6c_62p h Clear the setting of timer A2 __ClearTimerRegister RAPI_TIMER_A2 2007 11 14 REC10B0002 0100 68 _ GetTimerRegister Synopsis Boolean _ GetTimerRegister unsigned long data1 unsigned int
80. rementMode RAPI_TIMER_B1 data 2007 11 1 64 REC10B0002 0100 __SetTimerRegister Synopsis lt Set timer register gt Boolean _ SetTimerRegister unsigned long data1 unsigned int data2 data1 Setup data 1 data2 Pointer to the buffer in which register value is stored Description Sets the registers of a specified timer data1 For data the following definition values can be set RAPI_TIMER_AO Selects timer A channel 0 RAPI_TIMER_A1 Selects timer A channel 1 RAPI_TIMER_A2 Selects timer A channel 2 RAPI_TIMER_A3 Selects timer A channel 3 RAPI_TIMER_A4 Selects timer A channel 4 RAPI_TIMER_BO Selects timer B channel 0 RAPI_TIMER_B1 Selects timer B channel 1 RAPI_TIMER_B2 Selects timer B channel 2 data2 The content of a pointer to the buffer in which the register value is stored must be specified as described below The value is set in each register in order of buffer pointer elements When using timer A RAPI_TIMER_AO to RAPI_TIMER_A4 specified 0 Specify the set value for the timer Ai mode register i 0 4 1 Specify the set value for the timer Ai register i 0 4 2 Specify the set value for the up down flag register 3 Specify the set value for the one shot start flag register 4 Specify the set value for the trigger select register 5 Specify the set value for the time clock presca
81. s as well as control data read write operation 4 External interrupt control feature It comprises an external interrupt driver which sets or clears the usage conditions of external interrupts as well as controls interrupt operation 5 A D converter control feature It comprises an A D converter driver which sets or clears the usage conditions of A D converters as well as controls A D converter operation Rev 1 00 2007 11 1 6 REC10B0002 0100 2 3 Serial Interface Driver The serial interface driver sets serial communication clears settings transmit receives data and controls the status of serial communication There are two kinds of serial interface driver a single data transmission reception API and a multi data transmission reception API Rev 1 00 2007 11 1 7 REC10B0002 0100 2 4 Timer Driver The timer driver sets the timer clears timer settings controls timer operation and acquires a counter value with respect to the following modes e Timer mode e Event counter mode e Pulse width modulation mode PWM mode e Pulse period measurement mode e Pulse width measurement mode 2 4 1 Timer Mode In this mode the timer counts the internally generated count source When an underflow or an overflow interrupt occurs it calls a preset callback function 2 4 2 Event Counter Mode In this mode the timer counts the external signal fed in from an input pin or an overflow or underflow from other timer When an underflow or an over
82. s AN pin for the analog input pin RAPI_AN23 Uses AN pin for the analog input pin RAPI_AN24 Uses AN pin for the analog input pin RAPI_AN25 Uses AN pin for the analog input pin RAPI_AN26 Uses AN pin for the analog input pin Rev 1 00 2007 11 1 87 REC10B0002 0100 RAPI_AN27 Uses ANz pin for the analog input pin RAPI_PO_GROUP Uses port Po group for the analog input pin RAPI_P10_GROUP Uses port Po group for the analog input pin RAPI_P2_GROUP Uses port P2 group for the analog input pin RAPI_FAD Sets the AD converter s operating frequency to fap RAPI_FAD2 Sets the AD converter s operating frequency to fap divided by 2 RAPI_FAD3 Sets the AD converter s operating frequency to fap divided by 3 RAPI_FAD4 Sets the AD converter s operating frequency to fap divided by 4 RAPI_FAD6 Sets the AD converter s operating frequency to fap divided by 6 RAPI_FAD12 Sets the AD converter s operating frequency to fap divided by 12 RAPI_10BIT Sets the AD converter s resolution to 10 bits RAPI_8BIT Sets the AD converter s resolution to 8 bits RAPI_AD_ON Sets the AD converter to start operating RAPI_AD_OFF Sets the AD converter to stop operating RAPI_WITH_SAMPLE_HOLD Specifies that sample and hold action is applied RAPI_WITHOUT_SAMPLE_ HOLD Specifies that sample and hold action is not applied RAPI_SOFTWARE_TRIGGER Selects software trigger RAPI_EXTERNAL_TRIGGER
83. showing a program example for each The description of each API is divided into the following items e Synopsis Outlines the content of processing performed by the function It also shows the syntax of the function followed by a brief explanation of arguments Description Describes the function and how to use it in detail Return value Explains the returned value of the function e Functionality Indicates the functional classification of the function e Reference Indicates the related functions e Remark Describes the precautions to be taken when using the API e Program example Presents a program showing how to use the function Rev 1 00 2007 11 1 15 REC10B0002 0100 4 2 1 Serial I O _ BasicOpenSerialDriver Synopsis Description Return value Functionality Reference Remark lt Open a serial port gt Boolean _ BasicOpenSerialDriver unsigned long data data Setup data Opens and initializes a specified serial port For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI 03 RAPI_COM5 SI 04 If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Serial I O BasicCloseSerialDriver e f an undefined value is specified in the argument operation of the API cannot be guaranteed Pr
84. t RAPI_FALSE is returned otherwise RAPI_TRUE is returned 1 O port ReadlOPort ReadlOPortRegister WritelOPort _ SetlOPortRegister Remark e If an undefined value is specified in the first argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_io_port_ml6c_62p h void func void Set the data to port P2 register __WriteIOPortRegister RAPI_PORT_2 OxFF 2007 11 14 81 REC10B0002 0100 4 2 4 External interrupt _ Setinterrupt Synopsis lt Set external interrupt gt Boolean _ Setinterrupt unsigned long data1 unsigned int data2 void func data1 Setup data 1 data2 Setup data 2 func Callback function pointer Specify 0 if no callback functions are set Description Sets a specified external interrupt data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol to separate each specified value Note however that multiple external interrupts cannot be specified at the same time RAPI_INTO Uses _INTO interrupt RAPI_INT1 Uses _INT1 interrupt RAPI_INT2 Uses _INT2 interrupt RAPI_INT3 Uses _INT3 interrupt RAPI_INT4 Uses _INTA4 interrupt RAPI_INT5 Uses _INT5 interrupt RAPI_KEY Uses key input interrupt RAPI_INT_RISING Specifies a rising edge for the active edge of a selected external
85. t mode is used RAPI_REPEAT specified Rev 1 00 2007 11 14 REC10B0002 0100 Input pin Operating frequency Resolution Operating states set Conversion method Trigger External Op Amp Connection Specify one from RAPI_ANO RAPI_AN1 RAPI_AN2 RAPI_AN3 RAPI_AN4 RAPI_ANS RAPI_AN6 RAPI_AN7 RAPI_ANOO RAPI_ANO1 RAPI_ANO2 RAPI_ANO3 RAPI_ANO4 RAPI_ANO5 RAPI_ANO6 RAPI_ANO7 RAPI_AN20 RAPI_AN21 RAPI_AN22 RAPI_AN23 RAPI_AN24 RAPI_AN25 RAPI_AN26 RAPI_AN27 RAPI_INEXO RAPI_ANEX1 The default is RAPI_ANO Specify one from RAPI_FAD RAPI_FAD2 RAPI_FAD3 RAPI_FADA RAPI_FAD6 RAPI_FAD12 The default value is RAPI_FAD4 Specify one from RAPI_10BIT RAPI_8BIT The default value is RAPI_8BIT Specify one from RAPI_LAD_ON RAPI_AD_OFF The default value is RAPI_AD_OFF Specify one from RAPI_WITH_SAMPLE_HOLD RAPI_WITHOUT_SAMPLE_HOLD The default value is RAPI_WITHOUT_SAMPLE_HOLD Specify one from RAPI_SOFTWARE_TRIGGER RAPI_EXTERNAL_TRIGGER The default value is RAPISOFTWARE_TRIGGER Specify one from RAPI_ANEX_UNUSED RAPI_EXTERNAL_OP_AMP The default value is RAPI_ANEX_UNUSED e Specifiable definition values when single sweep mode is used RAPI_SINGLE_SWEEP specified Input pin Operating frequency Resolution Operating states set Conversion method Trigger External Op Amp Connection Specify one from RAPI_PO_GROUP RAPI_P1
86. tion of serial communication data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 func The function to be registered in func must be supplied to the serial I O driver by the user The serial I O driver calls the function registered in func The serial I O driver notifies the user of the transmit receive status by an argument The type of the function to be registered is shown below void any function name unsigned char notify The argument is detailed below UARTO UART1 UART2 e7 b6 b5 b4 b3 b2 b1 bo _oj olx x olx x x 0 No error 1 Error occurred Overrun error 0 No error 1 Error occurred Framing error O No error 1 Error occurred Parity error Transmission completed O Not completed 1 Completed 0 Not completed R ti leed i eception complete Completed SI 03 S1 04 0 Not completed 1 Completed Transmission completed i 0 Not completed Reception completed A Completed 2007 11 14 29 REC10B0002 0100 Return value If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Functionality Serial I O Reference StartSerialReceiving __StartSerialSending Remark e If an undefined value is specified in the first ar
87. unctions are set Description Sets the A D converter to specified mode and operating condition data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol to separate each specified value Note however that multiple analog input pin symbols cannot be specified at the same time RAPI_ONE_SHOT Selects one shot mode RAPI_REPEAT Selects repeat mode RAPI_SINGLE_SWEEP Selects single sweep mode RAPI_REPEAT_SWEEPO Selects repeat sweep mode 0 RAPI_REPEAT_SWEEP1 Selects repeat sweep mode 1 RAPI_ANO Uses AN pin for the analog input pin RAPI_AN1 Uses AN pin for the analog input pin RAPI_AN2 Uses AN pin for the analog input pin RAPI_AN3 Uses AN pin for the analog input pin RAPI_AN4 Uses AN pin for the analog input pin RAPI_AN5 Uses ANs pin for the analog input pin RAPI_AN6 Uses AN pin for the analog input pin RAPI_AN7 Uses AN pin for the analog input pin RAPI_ANOO Uses ANo pin for the analog input pin RAPI_ANO1 Uses ANo pin for the analog input pin RAPI_ANO2 Uses ANoe pin for the analog input pin RAPI_ANO3 Uses ANos pin for the analog input pin RAPI_ANO4 Uses AN pin for the analog input pin RAPI_ANO5 Uses ANos pin for the analog input pin RAPI_ANO6 Uses ANos pin for the analog input pin RAPI_ANO7 Uses ANo7 pin for the analog input pin RAPI_AN20 Uses AN pin for the analog input pin RAPI_AN21 Uses AN pin for the analog input pin RAPI_AN22 Use
88. undefined value is specified in the argument operation of the API cannot be guaranteed Program example include rapi_sif_ml6c_62p void func void Stop sending data in serial communication __StopSerialSending RAPI_COM1 Rev 1 00 2007 11 14 REC10B0002 0100 37 i _ PollingSerialReceiving Synopsis Description Return value Functionality Reference Remark lt Polling reception gt Boolean _ PollingSerialReceiving unsigned long data data Setup data Performs reception of serial communication by polling This API gets received data by an amount specified by _ StartSerialReceiving When acquisition of received data is complete it calls a notification function if a notification function is registered data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned Serial I O ConfigSerialDriverNotify _ SetSeriallnterrupt __StartSerialReceiving e lf an undefined value is specified in the argument operation of the API cannot be guaranteed Program example Rev 1 00 include rapi_sif_ml6c_62p unsigned int buffer 10 void func void Reception interrupt disable
89. v 1 00 include rapi_sif_ml6c_62p void func void Open serial driver return __OpenSerialDriver RAPI_COM1 2007 11 14 REC10B0002 0100 27 _ CloseSerialDriver Synopsis lt Close a serial port gt Boolean _ CloseSerialDriver unsigned long data data Setup data Description Closes a specified serial port data For data the following values can be set RAPI_COM1 UARTO RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI O3 RAPI_COM5 SI 04 Return value Functionality Serial I O If the serial port specification is incorrect RAPI_FALSE is returned otherwise RAPI_TRUE is returned If an undefined value is specified in the argument operation of the API cannot be Reference OpenSerialDriver Remark guaranteed Program example include rapi_sif_ml6c_62p void func void Rev 1 00 REC10B0002 0100 Close serial driver return _ CloseSerialDriver 2007 11 14 28 RAPI_COM1 _ ConfigSerialDriverNotify Synopsis Description Rev 1 00 lt Register a notification function gt Boolean _ ConfigSerialDriverNotify unsigned long data VoidFuncNotify func data Setup data func Function pointer to be registered Registers the notification function necessary to get various transmit receive informa
90. void unsigned int data 2 Get the measured value of timer B3 as pulse period measurement mode __GetPulsePeriodMeasurementMode RAPI_TIMER_B3 data Rev 1 00 2007 11 1 59 REC10B0002 0100 _ CreatePulseWidthMeasurementMode Synopsis Description Rev 1 00 lt Set pulse width measurement mode gt Boolean _ CreatePulseWidthMeasurementMode unsigned long data1 unsigned int data2 unsigned int data3 unsigned int data4 void func data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer Specify 0 if no callback functions are set Sets a specified timer to pulse with measurement mode data1 For data1 the following definition values can be set To set multiple definition values at the same time use the symbol to separate each specified value RAPI_TIMER_BO Uses timer B channel 0 el RAPI_TIMER_B1 Uses timer B channel 1 RAPI_TIMER_B2 Uses timer B channel 2 RAPI_TIMER_B3 Uses timer B channel 3 RAPI_TIMER_B4 Uses timer B channel 4 RAPI_TIMER_B5 Uses timer B channel 5 RAPI_F1 Selects f for the count source RAPI_F2 Selects fz for the count source RAPI_F8 Selects fg for the count source RAPI_F32 Selects fa2 for the count source RAPI_FC32 Selects fc32 for the count source RAPI_TIMER_ON Sets the timer to start operating in _ Cr
Download Pdf Manuals
Related Search
Related Contents
Chicago Electric 97717 Welder User Manual 取扱説明書 King Canada KC-125FX User's Manual Sony MEX-DV1700U Operating Instructions Manuale Operativo Operations Manual Tripp Lite Multimode Fiber Optics 15-m (50-ft.) Duplex MMF 50/125 Patch Cable, LC/ST Copyright © All rights reserved.
Failed to retrieve file