Vai alla pagina of
Manuali d’uso simili
-
Network Card
Renesas M3T-100LCC-80QSB
4 pagine 0.07 mb -
Network Card
Renesas PCA4738F-100A
26 pagine 0.13 mb -
Network Card
Renesas PCA7435FPG02
18 pagine 0.14 mb -
Network Card
Renesas M16C/6NM
404 pagine 2.73 mb -
Network Card
Renesas Emulator MCU Board M37549T-RLSS
4 pagine 0.83 mb -
Network Card
Renesas PCA4738GF-80
18 pagine 0.2 mb -
Network Card
Renesas R0E436049CFJ10
6 pagine 0.35 mb -
Network Card
Renesas PCA7427G02
18 pagine 0.1 mb
Un buon manuale d’uso
Le regole impongono al rivenditore l'obbligo di fornire all'acquirente, insieme alle merci, il manuale d’uso Renesas RJJ10J1643-0101. La mancanza del manuale d’uso o le informazioni errate fornite al consumatore sono la base di una denuncia in caso di inosservanza del dispositivo con il contratto. Secondo la legge, l’inclusione del manuale d’uso in una forma diversa da quella cartacea è permessa, che viene spesso utilizzato recentemente, includendo una forma grafica o elettronica Renesas RJJ10J1643-0101 o video didattici per gli utenti. La condizione è il suo carattere leggibile e comprensibile.
Che cosa è il manuale d’uso?
La parola deriva dal latino "instructio", cioè organizzare. Così, il manuale d’uso Renesas RJJ10J1643-0101 descrive le fasi del procedimento. Lo scopo del manuale d’uso è istruire, facilitare lo avviamento, l'uso di attrezzature o l’esecuzione di determinate azioni. Il manuale è una raccolta di informazioni sull'oggetto/servizio, un suggerimento.
Purtroppo, pochi utenti prendono il tempo di leggere il manuale d’uso, e un buono manuale non solo permette di conoscere una serie di funzionalità aggiuntive del dispositivo acquistato, ma anche evitare la maggioranza dei guasti.
Quindi cosa dovrebbe contenere il manuale perfetto?
Innanzitutto, il manuale d’uso Renesas RJJ10J1643-0101 dovrebbe contenere:
- informazioni sui dati tecnici del dispositivo Renesas RJJ10J1643-0101
- nome del fabbricante e anno di fabbricazione Renesas RJJ10J1643-0101
- istruzioni per l'uso, la regolazione e la manutenzione delle attrezzature Renesas RJJ10J1643-0101
- segnaletica di sicurezza e certificati che confermano la conformità con le norme pertinenti
Perché non leggiamo i manuali d’uso?
Generalmente questo è dovuto alla mancanza di tempo e certezza per quanto riguarda la funzionalità specifica delle attrezzature acquistate. Purtroppo, la connessione e l’avvio Renesas RJJ10J1643-0101 non sono sufficienti. Questo manuale contiene una serie di linee guida per funzionalità specifiche, la sicurezza, metodi di manutenzione (anche i mezzi che dovrebbero essere usati), eventuali difetti Renesas RJJ10J1643-0101 e modi per risolvere i problemi più comuni durante l'uso. Infine, il manuale contiene le coordinate del servizio Renesas in assenza dell'efficacia delle soluzioni proposte. Attualmente, i manuali d’uso sotto forma di animazioni interessanti e video didattici che sono migliori che la brochure suscitano un interesse considerevole. Questo tipo di manuale permette all'utente di visualizzare tutto il video didattico senza saltare le specifiche e complicate descrizioni tecniche Renesas RJJ10J1643-0101, come nel caso della versione cartacea.
Perché leggere il manuale d’uso?
Prima di tutto, contiene la risposta sulla struttura, le possibilità del dispositivo Renesas RJJ10J1643-0101, l'uso di vari accessori ed una serie di informazioni per sfruttare totalmente tutte le caratteristiche e servizi.
Dopo l'acquisto di successo di attrezzature/dispositivo, prendere un momento per familiarizzare con tutte le parti del manuale d'uso Renesas RJJ10J1643-0101. Attualmente, sono preparati con cura e tradotti per essere comprensibili non solo per gli utenti, ma per svolgere la loro funzione di base di informazioni e di aiuto.
Sommario del manuale d’uso
-
Pagina 1
www.renesas.com REJ10J1502-0101 Renesas Embedded Application Programming Interface Reference manual Rev .1.01 Feb 1 6, 2007[...]
-
Pagina 2
Rev .1.01 2007.02.16 RJJ10J1643-0101 2 REVISION HISTOR Y Rev . Summary Date 1.00 06.04.07 1.01 ・ Additions and corrections made for support of libraries for the H8/36094, H8/36077, H8/36109, and R8C/24 and 25 ・ Unnecessary periods in Chapte r 1, “Instruction,” deleted ・ Port P73 of H8 deleted ・ Channels A–D written in CreateInputCaptu[...]
-
Pagina 3
Rev .1.01 2007.02.16 RJJ10J1643-0101 3 ・ Description of third argument in __CreateInput Capture corrected ・ W ording “specified” uni fie d to “specified” ・ RAPI_BOTH deleted from the description of timer B1 count edges of H8/300H in __CreateEventCounter ・ RAPI_FTIOA and RAPI_FTIOB added to __CreatePulsePeriodMeasurem entMode and __C[...]
-
Pagina 4
Rev .1.01 2007.02.16 RJJ10J1643-0101 4 ・ RAPI_AN30, RAPI_AN31, RAPI_AN32, and RAPI_P9_GROUP add e d to the item for data1 of M16C in __CreateADC ・ RAPI_AN30, RAPI_AN31, RAPI_AN32, and RAPI_P9_GROUP add e d to the item for data1 of M16C in __EnableADC ・ Error in writing of H8/300H interrupt set values in __CreateOutputCompare corrected ・ Err[...]
-
Pagina 5
Rev .1.01 2007.02.16 RJJ10J1643-0101 5 T able of Contents T able of Contents ............................................................... .5 1. Introduction ................................................................... 8 2. Driver ....................................................................... 9 2.1 Overview .......................[...]
-
Pagina 6
Rev .1.01 2007.02.16 RJJ10J1643-0101 6 __CreateT imer ........................................................... 54 __EnableT imer ........................................................... 60 __DestroyT imer .......................................................... 62 __CreateEven tCounter ..................................................... 6[...]
-
Pagina 7
Rev .1.01 2007.02.16 RJJ10J1643-0101 7 __GetADC ............................................................. 197 __GetADCAll ........................................................... 198 __GetADCS tatus ......................................................... 199 __ClearADCS tatus ....................................................... 200[...]
-
Pagina 8
Rev .1.01 2007.02.16 RJJ10J1643-0101 8 1. Introduction The Renesas Embe dded Applic ation Programming Interface ( API) is a unified API for the microcomputers ma de by Re nesas T e chnology Corporation.[...]
-
Pagina 9
Rev .1.01 2007.02.16 RJJ10J1643-0101 9 2. Driver 2.1 Overview The library described herein pr ovid es a peripheral facility control program (peripheral driver) for microc o mputers. Use of t he Renesas API permits the p eripheral driver to be built into a user program. Configuration of R enesas APIs is shown below . File name Description rapi_ xxx [...]
-
Pagina 10
Rev .1.01 2007.02.16 RJJ10J1643-0101 10 2.2 Driver Features The library described herein has the following features available as a peripheral driver . (1) Serial I/O control feature It comprises a serial int erface driver , which sets or clears the conditi ons of serial communication, as well as control s and manages the transmission/reception of c[...]
-
Pagina 11
Rev .1.01 2007.02.16 RJJ10J1643-0101 11 2.3 Serial Interface Driver The serial interf ace driver sets serial communic ation, clears settings, trans mit/receives data, and controls the status of serial communicat ion. There are two kinds of serial in terface driver: a single-data tran smission/recept ion API and a multi-data transmission/reception A[...]
-
Pagina 12
Rev .1.01 2007.02.16 RJJ10J1643-0101 12 2.4 Timer Driver The timer driver sets th e timer , clears timer settings, c ontrols timer operation, and acquires a counter value with respect to the following m o des: • Timer mode • Event counter mode • Pulse width modulation mode (PWM mode) • Pulse period m easurement mode • Pulse width measur e[...]
-
Pagina 13
Rev .1.01 2007.02.16 RJJ10J1643-0101 13 2.4.7 Output Comp are Mode In this mode, the timer generates an inte rrupt request wh en the timer counter and a comparison value m atch. When a compare match int errupt or an underflow or an overflow interrupt occurs, it calls a preset callbac k function.[...]
-
Pagina 14
Rev .1.01 2007.02.16 RJJ10J1643-0101 14 2.5 I/O Port Driver The I/O port driver sets the I/O port for inpu t or output, writes data to th e I/O port, and reads data from the I/O port.[...]
-
Pagina 15
Rev .1.01 2007.02.16 RJJ10J1643-0101 15 2.6 External Interrupt Driver The external interru pt driver sets external interrupts, controls external interru pts, acquires the status of ext ernal interrupt fl ags, and clears external interrupt flags.[...]
-
Pagina 16
Rev .1.01 2007.02.16 RJJ10J1643-0101 16 2.7 A/D Converter Driver The A/D converter dr iver sets the A/ D converter , controls the A/D conver ter , clears settings of the A/D con verter , acquires the A/D conv erter value, acquires the status of the A/D converter , and clears the status of the A/D converter . [A/D converter driv er usage example (si[...]
-
Pagina 17
Rev .1.01 2007.02.16 RJJ10J1643-0101 17 Program example #include "rapi_ad_r8c_13.h" void main( void ) { unsigned int status, data; /* Set up A/D converter as one short mode */ __ CreateADC( RAPI _ ONE _ SHOT|RAPI _ AN0|RAPI _ FAD2| RAPI_WITH_SAMPLE_HOLD| RAPI_AD_OFF|RAPI_10BIT, 1, 0, 0 ); while( 1 ){ /* Disable A/D converter */ __EnableAD[...]
-
Pagina 18
Rev .1.01 2007.02.16 RJJ10J1643-0101 18 3. St andard T ypes This section describes the st andard types defined in the library . For details about the set values, refer to the description of each API. St andard type Description Boolean The Boolean type represents the enum-typ e data that ind icates whether successful (R API_TRUE (= 1)) or failed (RA[...]
-
Pagina 19
Rev .1.01 2007.02.16 RJJ10J1643-0101 19 4. Library Reference 4.1 API List by Peripheral Facility The table below lists the Renesas Embedded APIs classified by peripheral facility . NO Facility classification API A P I operation 1 __BasicOpenSerialDriver Opens serial port 2 __BasicCloseSerial Driver Closes serial port 3 __BasicSetSerialFormat Sets s[...]
-
Pagina 20
Rev .1.01 2007.02.16 RJJ10J1643-0101 20 35 __CreatePulseWidthMeasure mentMode Sets pulse width measurement mode 36 __EnablePulseWidthMeasurem entMode Controls opera tion of pulse width measurement mode 37 __DestroyPulseWidthMeasurementMode Clears s etting of pulse width measurement mode 38 __GetPulseWidthMeasurementMode Acquir es measured value of [...]
-
Pagina 21
Rev .1.01 2007.02.16 RJJ10J1643-0101 21 4.2 Description of Each API This section describes each API and explains how to use them, showing a program example for each. The description of eac h API is divided into the followin g items. • Synop sis : Outlines the content of processing performed by the f unction. It also shows the syntax of the functi[...]
-
Pagina 22
Rev .1.01 2007.02.16 RJJ10J1643-0101 22 4.2.1 Serial I/O __BasicOpenSerialDriver Synopsis <Open a serial port> Boolean __BasicOpenSerialDri ver(unsigned long d ata) data Setup data Description Opens and initializes a specifi ed serial port. For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_[...]
-
Pagina 23
Rev .1.01 2007.02.16 RJJ10J1643-0101 23 __BasicCloseSerialDriver Synopsis <Close a serial port> Boolean __BasicClos eSerialDriver(unsigned long dat a) data Setup data Description Closes a specified serial p ort. For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/O4 (R[...]
-
Pagina 24
Rev .1.01 2007.02.16 RJJ10J1643-0101 24 __BasicSetSerialFormat Synopsis <Set serial communication> Boolean __Bas icSetSerialFormat(unsigned long dat a1, unsigned cha r data2 ) data1 Setup data 1 data2 Setup data 2 Description Sets serial communication according to specified parameters. [data1] For data1, the following values can be set. T o s[...]
-
Pagina 25
Rev .1.01 2007.02.16 RJJ10J1643-0101 25 If the API is used in clock synchronous seri a l communication mode, do not set these values. (M16C) (UART0, UAR T 1, UART2) RAPI_P ARIT Y_NON No parity bit R API_P ARITY_EVEN Even parity bit RAPI_P ARITY_ ODD Odd parity bit For the clock polarity of serial communic ation, the following values can be set. If [...]
-
Pagina 26
Rev .1.01 2007.02.16 RJJ10J1643-0101 26 (R8C) (UART0, UART1) RAPI_SM_SYNC Clock synchronous serial communication mode RAPI_SM_ASYNC Clock asy nchron ous serial communication mode For the data length format of clock asynchro nous serial communication, the follo wing values can be set. If the API is used in clock synchronous seri a l communication mo[...]
-
Pagina 27
Rev .1.01 2007.02.16 RJJ10J1643-0101 27 RAPI_COM3 SCI3 channel 3 For serial communication mode, the follo wing values can be set. (H8/300H) (SCI3 channel 1, SCI3 chan nel 2, SCI3 channel 3) RAPI_SM_SYNC Clock synchronous serial communication mode RAPI_SM_ASYNC Clock asynchronous serial communication mode For the data length format of clock asynchro[...]
-
Pagina 28
Rev .1.01 2007.02.16 RJJ10J1643-0101 28 Functionality Serial I/O Remark • The specifiable serial p orts differ w it h each CPU used. • If an undefined value is spec ified in the first argument, operation of the A PI cannot be guaranteed. Program example #include ”rapi_sif_r8c_13.h” Boolean func( void ) { /* Set the data of RAPI_COM1 to seri[...]
-
Pagina 29
Rev .1.01 2007.02.16 RJJ10J1643-0101 29 __BasicSt artSerialReceiving Synopsis <Receive 1 data> Boolean __Bas icStartSe rialReceiving(unsigned long d ata) data Setup data Description S tarts receiving 1 data of serial communication. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_CO[...]
-
Pagina 30
Rev .1.01 2007.02.16 RJJ10J1643-0101 30 __BasicSt artSerialSending Synopsis <Transmit 1 dat a> Boolean _Basic Sta rtSerialSending(unsigne d long data 1, unsigned int dat a2) data Setup data data T ransmit data Description S tarts sending 1 data of serial communication. For data1, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_CO[...]
-
Pagina 31
Rev .1.01 2007.02.16 RJJ10J1643-0101 31 __BasicReceivingSt atusRead Synopsis <Read receive status> unsigned int _ _BasicReceivingSt atusRead(unsigned long data) data Setup data Description Returns the receive status of serial communication. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART[...]
-
Pagina 32
Rev .1.01 2007.02.16 RJJ10J1643-0101 32 Remark • The specifiable serial ports differ with each CPU used. • If an undefined value is specified in the argument, operation of the API cannot be guaranteed. Program example #include ”rapi_sif_r8c_13.h” void func( void ) { unsigned int rcv_data; .......... rcv_data = __BasicReceivingStatusRead( RA[...]
-
Pagina 33
Rev .1.01 2007.02.16 RJJ10J1643-0101 33 __BasicSendingSt atusRead Synopsis <Read transmit status> Boolean __BasicSe ndingS t a tus R ea d(uns igne d lon g data) data Setup data Description Returns the transmit status of serial comm unication. For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAP[...]
-
Pagina 34
Rev .1.01 2007.02.16 RJJ10J1643-0101 34 __BasicStopSerialReceiving Synopsis <S top reception> Boolean Rapi_B asicStopSerialReceiv ing(unsigned long dat a) data Setup data Description S tops receiving data in serial communication [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 (R8C) RAPI[...]
-
Pagina 35
Rev .1.01 2007.02.16 RJJ10J1643-0101 35 __BasicStopSerialSending Synopsis <S top transmission> Boolean __Bas icStopSerialSending( unsigned long dat a) data Setup data Description S tops transmitting data in serial communication. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 (R8C) RAPI[...]
-
Pagina 36
Rev .1.01 2007.02.16 RJJ10J1643-0101 36 __OpenSerialDriver Synopsis <Open a serial port> Boolean __OpenSeria lDri ver(unsigned lon g data) data Setup data Description Opens and initializes a specifi ed serial port. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM[...]
-
Pagina 37
Rev .1.01 2007.02.16 RJJ10J1643-0101 37 __CloseSerialDriver Synopsis <Close a serial port> Boolean __Clos eSerialDriver(unsigned long dat a) data Setup data Description Closes a specified serial port. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/O4 (R8C) [...]
-
Pagina 38
Rev .1.01 2007.02.16 RJJ10J1643-0101 38 __ConfigSerialDriverNotify Synopsis <Register a notifi cation function> Boolean __ConfigSerialDriv erNotify(unsigned long dat a, V oidFuncNotify *func) data Setup data func Function pointer to be registered Description Regist ers the notification f unction necessar y to get various transmit/receive info[...]
-
Pagina 39
Rev .1.01 2007.02.16 RJJ10J1643-0101 39 (R8C) (H8/300H) Return value If the serial port specification is inco rr ect, RAPI_F ALSE is returned; otherwise, RAPI_TRUE is returned. Functionality Serial I/O Reference __S tartSerialReceiving , __S tartSerialSending Remark • The specifiable serial ports differ with each CPU used. • If an undefined val[...]
-
Pagina 40
Rev .1.01 2007.02.16 RJJ10J1643-0101 40 Program example #include ”rapi_sif_r8c_13.h” void Notify(unsigned char result) { if ((result&RAPI_OVER_ERR) == RAPI_OVER_ERR) { /* Overrun error */ } if ((result&RAPI_FRAMING_ERR) == RAPI_FRAMING_ERR) { /* Framing error */ } if ((result&RAPI_PARITY_ERR) == RAPI_PARITY_ERR) { /* Parity error */[...]
-
Pagina 41
Rev .1.01 2007.02.16 RJJ10J1643-0101 41 __SetSerialFormat Synopsis <Set serial communication> Boolean __SetSeria lFormat(unsigned long dat a1, unsigned char data2) data1 Setup data 1 data2 Setup data 2 Description Sets serial communication according to spec ified parameters. For details about pa rameters, refer to the description of __BasicSe[...]
-
Pagina 42
Rev .1.01 2007.02.16 RJJ10J1643-0101 42 __SetSerialInterrupt Synopsis < Set serial interrupts> Boolean __SetSerialInterrupt(unsigne d l ong da t a) data Setup data Description Sets serial interrupts accord ing to specified parameters. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI[...]
-
Pagina 43
Rev .1.01 2007.02.16 RJJ10J1643-0101 43 RAPI_COM1 UART0 RAPI_COM2 UART1 For interrupt settings, the following values can set. RAPI_INT_TX_DIS T ransmit interrupt disabled RAPI_INT_TX_L V_1 T ransmit interrup t priority level 1 RAPI_INT_TX_L V_2 T ransmit interrupt priority level 2 RAPI_INT_TX_L V_3 T ransmit interrup t priority level 3 RAPI_INT_TX_[...]
-
Pagina 44
Rev .1.01 2007.02.16 RJJ10J1643-0101 44 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 ); ……………… }[...]
-
Pagina 45
Rev .1.01 2007.02.16 RJJ10J1643-0101 45 __St artSerialReceiving Synopsis <S tart reception> Boolean __S tartSerialReceiv ing(unsigned long dat a, unsigned char w ordNum, unsigned int *Rcv DtBuf) data Setup data wordNum Number of words received RcvDtBuf Pointer to the buf fer in which received data is stored Description S tarts reception of se[...]
-
Pagina 46
Rev .1.01 2007.02.16 RJJ10J1643-0101 46 unsigned int buffer[10]; void func( void ) { ……………… /* Get 5 word data received in serial communication */ __StartSerialReceiving( RAPI_COM1, 5, buffer ); ……………… }[...]
-
Pagina 47
Rev .1.01 2007.02.16 RJJ10J1643-0101 47 __St artSerialSending Synopsis <S tart transmission> Boolean __S tartSerialSending(uns igned long data , unsigned char wordNum, unsigned int *SndDtBuf) data Setup data wordNum Number of words transmitted SndDtBuf Pointer to the t ransmit data Description S tarts transmission of serial communication and [...]
-
Pagina 48
Rev .1.01 2007.02.16 RJJ10J1643-0101 48 unsigned int buffer[10]; void func( void ) { ……………… /* Set 5 word data to transmit buffer of serial communication */ __StartSerialSending( RAPI_COM1, 5, buffer ); ……………… }[...]
-
Pagina 49
Rev .1.01 2007.02.16 RJJ10J1643-0101 49 __StopSerialReceiving Synopsis <S top reception> Boolean __StopSerialReceiving( u nsigned long data) data Setup data Description S tops reception of serial communic ation. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UAR T1 RAPI_COM3 UART2 (R8C) RAPI_COM1 UART0 RAPI[...]
-
Pagina 50
Rev .1.01 2007.02.16 RJJ10J1643-0101 50 __StopSerialSending Synopsis <S top transmission> Boolean __S topSerialSending(unsigne d long data ) data Setup data Description S tops transmission of serial communicatio n. [data] For data, the following values can be set. (M16C) RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 (R8C) RAPI_COM1 UART0 RA[...]
-
Pagina 51
Rev .1.01 2007.02.16 RJJ10J1643-0101 51 __PollingSerialReceiving Synopsis <Polling reception> unsigned int __PollingSerialRec eiving(unsigned l ong data) data Setup data Description Performs reception of serial communicatio n by polling. T his API gets received data by an amount specified by __St artSerialR eceivi ng. When ac quisition of rec[...]
-
Pagina 52
Rev .1.01 2007.02.16 RJJ10J1643-0101 52 __PollingSerialSending Synopsis <Polling transmission> Unsigned __Polli ngSerialSending(unsigned long da ta) data Setup data Description Performs transmission of serial communicati on by polling. This API sends transmit data by an amount specified by __St artSerialS ending from the transmit data buffer [...]
-
Pagina 53
Rev .1.01 2007.02.16 RJJ10J1643-0101 53 unsigned int buffer[10],count; void func( void ) { ……………… /* Transmission interrupt disable */ __SetSerialInterrupt( RAPI_COM1 | RAPI_INT_TX_DIS | RAPI_INT_RX_DIS ); /* Start transmission */ __StartSerialSending( RAPI_COM1, 5, buffer ); do{ count = __PollingSerialSending( RAPI_COM1 ); }while(count[...]
-
Pagina 54
Rev .1.01 2007.02.16 RJJ10J1643-0101 54 4.2.2 Timer __CreateTimer Synopsis <Set timer mode> Boolean __Cre ateTimer(unsigned l ong data1, uns igned int data2 , unsigned int dat a3, unsigned int dat a4, void* func) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) data3 Setup data 3 (content d[...]
-
Pagina 55
Rev .1.01 2007.02.16 RJJ10J1643-0101 55 (Operating states set) Specify one from { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The default value is RAPI_TIMER_OFF . (Pulse output state) Specify one from { RAPI_PULSE_ON, RAPI_PULSE_OFF }. The default value is RAPI_PULSE_OFF . (Gate facility) S pecify one from { RAPI _GA TE_L, RAPI_GA TE_H }. If omitted, “No g[...]
-
Pagina 56
Rev .1.01 2007.02.16 RJJ10J1643-0101 56 (Count source) S pecify one from { RAPI_F1, RAPI_F8, RAPI_F RING }. The default value is RAPI_F1. (Operating states set) S pecify one fro m { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The default value is RAPI_TIMER_OFF . (Write control) S pecify one from { RAPI_WRI TE_RELOAD_ONL Y , RAPI_WRITE_RELOAD_BOTH }. The defa[...]
-
Pagina 57
Rev .1.01 2007.02.16 RJJ10J1643-0101 57 RAPI_TB1_F256 T imer B1 counts with internal clock φ /256. RAPI_TB1_F512 T imer B1 counts with internal clock φ /512. RAPI_TB1_F2048 T imer B1 counts with internal clock φ /2048. RAPI_TB1_F8192 T imer B1 counts with internal clock φ /8192. RAPI_TV_F4 T imer V counts on falling edges of internal clock φ /[...]
-
Pagina 58
Rev .1.01 2007.02.16 RJJ10J1643-0101 58 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW . If no interrupts are specified, “No interrupt request” is set. (Operating states set) S pecify one from { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The default value is RAPI_TIMER_OFF . [data2] (M16C) (R8C) S pecify the interrupt prior[...]
-
Pagina 59
Rev .1.01 2007.02.16 RJJ10J1643-0101 59 void func( void ) { /* Set up timer X as timer mode */ __CreateTimer( RAPI_TIMER_X|RAPI_TIMER_ON|RAPI_F8, 5, 0x80, 0x80, TimerIntFunc ); }[...]
-
Pagina 60
Rev .1.01 2007.02.16 RJJ10J1643-0101 60 __EnableTimer Synopsis <Control o peration of timer mode> Boolean __EnableT imer(unsigned long dat a) data Setup data (content differs w i th MCU type) Description Controls operation of the tim er that is se t to specified timer mod e by starting or stopping it. [data] For data, the following definition[...]
-
Pagina 61
Rev .1.01 2007.02.16 RJJ10J1643-0101 61 Remark • If an undefined value is specif ied in t he arg ument, operation of the API cannot be guaranteed. • The specifiable timers differ with each CPU used. Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Disable timer Y as timer mode */ __EnableTimer( RAPI_TIMER_Y| RAPI_[...]
-
Pagina 62
Rev .1.01 2007.02.16 RJJ10J1643-0101 62 __DestroyTimer Synopsis <Discard settings of timer mode> Boolean __DestroyT imer(unsigned long dat a) data Setup data (content differs with MCU type) Description Discards s ettings of the timer that is set to specified timer mode. [data] For data, the following definition values can be set. (M16C) RAPI_[...]
-
Pagina 63
Rev .1.01 2007.02.16 RJJ10J1643-0101 63 void func( void ) { /* Destroy the setting of timer Z as timer mode */ __DestroyTimer( RAPI_TIMER_Z ); }[...]
-
Pagina 64
Rev .1.01 2007.02.16 RJJ10J1643-0101 64 __CreateEventCounter Synopsis <Set event counter mode> Boolean __Cre ateE ventCounter(unsigne d long dat a1, unsigned int dat a2, unsigned int data3, unsign ed int data4 , void* func) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) data3 Setup data 3[...]
-
Pagina 65
Rev .1.01 2007.02.16 RJJ10J1643-0101 65 RAPI_UDF_REGISTER Selects the UDF register for the cause of up/down switching. RAPI_T AIOUT Selects the input signal at T A iOUT pin for the cause of up/down switching. RAPI_RISING Select s the rising edge of count source as active edge. RAPI_F ALLING Selects the falling edge of count source as active edge. R[...]
-
Pagina 66
Rev .1.01 2007.02.16 RJJ10J1643-0101 66 RAPI_WRITE_ RELOAD_ BOTH Selects operation mode in which writing to the primary register and prescaler causes the set data to be written to both the reload register and the counter , respectively . RAPI_RISING Select s the rising edge of count source as active edge. RAPI_F ALLING Selects the falling edge of c[...]
-
Pagina 67
Rev .1.01 2007.02.16 RJJ10J1643-0101 67 RAPI_RISING Select s the rising edge of count source as active edge. RAPI_F ALLING Selects the falling edge of count source as active edge. RAPI_BOTH Selects both rising and falling edges of count source as active edges. RAPI_TRGV_RISING Selects the rising edge of TR GV pin input signal as active edge. RAPI_ [...]
-
Pagina 68
Rev .1.01 2007.02.16 RJJ10J1643-0101 68 [data4] (M16C) (H8/300H) Specify 0. (R8C) Specify the set value for the prescaler register in 8 bits. Return value If the timer specification is incorrect, R API_F ALSE is returned; other wise, RAPI_TRUE is returned. Functionality T imer (event counter mode) Reference __EnableEventCounter , __DestroyEventCoun[...]
-
Pagina 69
Rev .1.01 2007.02.16 RJJ10J1643-0101 69 __EnableEventCounter Synopsis <Control operation of event counter mode> Boolean __Enable E ventCounter(uns igned long data ) data Setup data (content differs with MCU type) Description Controls operation of the timer that is set to specified timer mode b y starting or stopping it. [data] For data, the f[...]
-
Pagina 70
Rev .1.01 2007.02.16 RJJ10J1643-0101 70 Functionality Ti mer (event counter mo de) Reference __CreateEvent Counter , __DestroyEventCoun ter , __GetEventCounter Remark • If an undefined value is specified in th e argument, oper ation of the API cannot be guaranteed. • The specifiable timers differ with each CPU used. Program example #include &qu[...]
-
Pagina 71
Rev .1.01 2007.02.16 RJJ10J1643-0101 71 __DestroyEventCounter Synopsis <Discard settings of event counter mode> Boolean __Des tro yEventCounter(uns igned long dat a) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified timer mode. [data] For data, the following definition values c[...]
-
Pagina 72
Rev .1.01 2007.02.16 RJJ10J1643-0101 72 void func( void ) { /* Destroy the setting of timer Y as event counter mode */ __DestroyEventCounter( RAPI_TIMER_Y ); }[...]
-
Pagina 73
Rev .1.01 2007.02.16 RJJ10J1643-0101 73 __GetEventCounter Synopsis <Get event counter mode counter value> Boolean __GetEv entCounter(unsigned long da ta1, unsi gned int *data 2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the buffer in which counter value is stored Description Gets the counter value of the timer that i[...]
-
Pagina 74
Rev .1.01 2007.02.16 RJJ10J1643-0101 74 [1]: The value of timer RA register is stored. (H8/300H) • When using timer B1 (RAPI_ TIMER_B1 specified) [0]: The value of timer counter B1 is stored. • When using timer V (RAPI_T IMER_V specified) [0]: The value of timer counter V is stored. Return value If the timer specification is incorrect, R API_F [...]
-
Pagina 75
Rev .1.01 2007.02.16 RJJ10J1643-0101 75 __CreatePulseWid thMo dulationMode Synopsis <Set pulse width modulation mode> Boolean __Creat ePulseW id thMod ulationM ode(unsigne d long da t a 1, unsigned int dat a2, unsigned int* dat a3, void* dat a4) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU ty[...]
-
Pagina 76
Rev .1.01 2007.02.16 RJJ10J1643-0101 76 RAPI_RISING Selects the rising edge of T A iIN pin input signal as active edge. RAPI_F ALLING Selects the falling edge of T A iIN pin input signal as active edge. • Specifiable definition values when timer A is used (R API_TIMER_A0 to RAPI_TIMER_A4 specified) (Count source) Specify one fro m { RAPI_F1, RAPI[...]
-
Pagina 77
Rev .1.01 2007.02.16 RJJ10J1643-0101 77 (Count source) S pecify one from { RAPI_F 1, RAPI_F2, RAPI_F8, RAPI_TIMER_Y_UNDERFLOW}. The default value is RAPI_F1. (Operating states set) S pecify one fro m { RAPI_TIMER_ON, RAPI_ TIMER_OFF }. The default value is RAPI_TIMER_OFF . (Output) Specify one from { RAPI_H_L_L, RAPI_L_H_H }. The default value is R[...]
-
Pagina 78
Rev .1.01 2007.02.16 RJJ10J1643-0101 78 • Specifiable definition values when timer V is u sed (RAPI_TIMER_V specified ) (Clock) S pecify one from { RAPI_TV_F4, RAPI_TV_F8, RAPI_TV_F16, RAPI_TV_F32, RAPI_TV_F64, RAPI_TV_F1 28 }. If clock specification is omitted, s pecify “Disable clock input.” (Interrupt) If compare match A interrupt requests[...]
-
Pagina 79
Rev .1.01 2007.02.16 RJJ10J1643-0101 79 Reference __EnablePulseWidthModulationMode , __De stroyPulseWidthModulationMode Remark • If an undefined value is specified in the fi rst a rgument, operation of the API cannot be guaranteed. • The specifiable timers differ with each CPU used. • For the H8/300H, make sure that comparison value A < co[...]
-
Pagina 80
Rev .1.01 2007.02.16 RJJ10J1643-0101 80 __EnablePulseWid thModulationMode Synopsis <Control operation of puls e width modulation mode> Boolean __Enable PulseWidt hModulationMode(unsigned lon g data) data Setup data (content differs with MCU type) Description Controls operation of the time r that is se t to specified pulse width modulation mod[...]
-
Pagina 81
Rev .1.01 2007.02.16 RJJ10J1643-0101 81 Remark • If an undefined value is specif ied in the argument, operati on of the API cannot be guaranteed. • The specifiable timers differ with each CPU used. Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Enable timer Y as pulse width modulation mode */ __EnablePulseWidthM[...]
-
Pagina 82
Rev .1.01 2007.02.16 RJJ10J1643-0101 82 __DestroyPulseWid thModulationMode Synopsis <Discard settings of pulse width modulation mode> Boolean __Des tro yPulseWid thModulationMode(u nsigned long dat a) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified pulse width modulation mode[...]
-
Pagina 83
Rev .1.01 2007.02.16 RJJ10J1643-0101 83 __CreatePulsePeriodMeasurementMode Synopsis <Set pulse period meas urement mode> Boolean __CreatePul sePeriodM easu rementMode(unsign ed long data1, unsigned int dat a2, unsigned int dat a3, unsigned int data4, v oid* func) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content d[...]
-
Pagina 84
Rev .1.01 2007.02.16 RJJ10J1643-0101 84 RAPI_TIMER_RA Uses timer RA. RAPI_F1 Selects f 1 for the count source. RAPI_F2 Selects f 2 for the count source. RAPI_F8 Selects f 8 for the count source. RAPI_F32 Selects f 32 for the count source. RAPI_FC32 Selects f C32 for the count source. RAPI_FOCO Selects fOCO for the count source. RAPI_TIMER_ON Sets t[...]
-
Pagina 85
Rev .1.01 2007.02.16 RJJ10J1643-0101 85 RAPI_TIMER_RD3 Uses timer RD0 channel 3. RAPI_TW_F1 T imer W counts with internal clock φ . RAPI_TW_F2 T imer W counts with internal clock φ /2. RAPI_TW_F4 T imer W counts with internal clock φ /4. RAPI_TW_F8 T imer W counts with internal clock φ /8. RAPI_TZ_F1 T i mer Z counts with internal clock φ . RA[...]
-
Pagina 86
Rev .1.01 2007.02.16 RJJ10J1643-0101 86 RAPI_FTIOB Use FTIOB pin as input pin. • Specifiable definition values when timer W is used (RAPI_TIMER_W specified ) (Count source) Specify one from { RAPI_TW_F1, RAPI_TW_F2, RAPI_TW_F4, RAPI_TW_F8 }. The default value is RAPI_TW_F1. (Operating states set) S pecify one from { RAPI_TIMER_ ON, RAPI_TIMER_OFF[...]
-
Pagina 87
Rev .1.01 2007.02.16 RJJ10J1643-0101 87 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW . If no interrupts are specified, “No interrupt request” is set. (Input pin) S pecify one from { RAPI_ FTIOA, RAPI_FTIOB }. The default value is RAPI_FTIOA. (Clock for digital filter) S pecify one from { RAPI_T RC_FIL TER_F1, RA[...]
-
Pagina 88
Rev .1.01 2007.02.16 RJJ10J1643-0101 88 __EnablePulsePeriodMeasurementMode Synopsis <Control operation of pulse pe riod measurement mode> Boolean __EnablePu lsePeriodMeasu rem entMode(unsigned long data) data Setup data (content differs with MCU type) Description Controls operation of the timer that is set to specified pulse period measur eme[...]
-
Pagina 89
Rev .1.01 2007.02.16 RJJ10J1643-0101 89 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, R API_F ALSE is returned; otherwise, RAPI_TRUE is returned. Functionality T imer (pulse p eriod measurement mode) Reference __CreatePulsePeriodMeas urementMode ,[...]
-
Pagina 90
Rev .1.01 2007.02.16 RJJ10J1643-0101 90 __DestroyPulsePeriodMeasurementMode Synopsis <Discard settings of pulse period meas urement mode> Boolean __Destro yPulsePeriodMeasurem en tMo de(unsigned lon g dat a) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified pulse period measure[...]
-
Pagina 91
Rev .1.01 2007.02.16 RJJ10J1643-0101 91 • When used for the H8/300H, this API plac es a specified ti mer into module stanby state after discarding it. Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Destro y the setting of timer X as pulse period measurement mode */ __DestroyPulsePeriodMeasurementMode( RAPI_TIMER_X[...]
-
Pagina 92
Rev .1.01 2007.02.16 RJJ10J1643-0101 92 __GetPulsePeriodMeasurementMode Synopsis <Get measured value in pulse peri od measurement mode> Boolean __GetPulsePeriod MeasurementM o de(unsigned lo ng data1, unsigned int *data2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the buffer in which counter value is stored Descriptio[...]
-
Pagina 93
Rev .1.01 2007.02.16 RJJ10J1643-0101 93 [0]: The value of timer RA prescaler register i s stored. [1]: The value of timer RA register is stored. (H8/300H) • When using timer W (RAPI_TIMER_W specified) [0]: (The value of gener al register A) – (The value of gen eral register C) is stored. [1]: (The value of gener al register B) – (The value of[...]
-
Pagina 94
Rev .1.01 2007.02.16 RJJ10J1643-0101 94 __CreatePulseWid thMeasurementMode Synopsis <Set pulse width measurement mode> Boolean __CreatePul seWidthMeasurementMode(unsigned lo ng data1, unsigned int dat a2, unsigned int dat a3, unsigned int data4, v oid* func) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differ[...]
-
Pagina 95
Rev .1.01 2007.02.16 RJJ10J1643-0101 95 RAPI_FOCO Selects fO CO for the count source . RAPI_TIMER_ON Sets the timer to st art operating in __C reatePulsePeriodMeasureme ntMode. RAPI_TIMER _OFF Sets the timer t o stop operating in __Cre atePulsePeriodMeasurementM ode. RAPI_RISING_ RISING Selects measurement of an interval from the rise to the next r[...]
-
Pagina 96
Rev .1.01 2007.02.16 RJJ10J1643-0101 96 RAPI_TW_F8 Timer W count s with internal clock φ /8. RAPI_TZ_F1 Timer Z counts with internal clock φ . RAPI_TZ_F2 Timer Z counts with internal clock φ /2. RAPI_TZ_F4 Timer Z counts with internal clock φ /4. RAPI_TZ_F8 Timer Z counts with internal clock φ /8. RAPI_TRC_F1 T i mer RC counts with internal cl[...]
-
Pagina 97
Rev .1.01 2007.02.16 RJJ10J1643-0101 97 (Count source) S pecify one from { RAPI_TW_F1, RAPI_TW_F2, RAPI_TW_F4, RAPI_TW_F8 }. The default value is RAPI_TW_F1. (Operating states set) S pecify one from { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The default value is RAPI_TIMER_OFF . (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW [...]
-
Pagina 98
Rev .1.01 2007.02.16 RJJ10J1643-0101 98 S pecify the interrupt priority le vel (0 – 7) to be set in the interrupt control register . (H8/300H) Specify the interrupt priority level (0–1) to be set in the interrupt control register. F or the CPUs that do not have an inte rrupt control register, specify 0. [data3] (M16C)(H8/300H) S pecify 0. (R8C)[...]
-
Pagina 99
Rev .1.01 2007.02.16 RJJ10J1643-0101 99 __EnablePulseWid thMeasurementMode Synopsis <Control operation of pulse width measurement mode> Boolean __Enab l ePu lseWidthMeasurementMode(un signed long data) data Setup data (content differs with MCU type) Description Controls operation of the timer that is se t to specified pulse width measurement [...]
-
Pagina 100
Rev .1.01 2007.02.16 RJJ10J1643-0101 100 Return value If the timer specification is incorrect, R API_F ALSE is returned; otherwise, RAPI_TRUE is returned. Functionality T imer (pulse width measurement mode) Reference __CreatePulseWidthMeasure mentMode , __DestroyPulseW idthMeasurementMode , __GetPulseWidthMeasurementMode Remark • If an undefined [...]
-
Pagina 101
Rev .1.01 2007.02.16 RJJ10J1643-0101 101 __DestroyPulseWid thMeasurementMode Synopsis <Discard settings of pulse width measurement mode> Boolean __Destro yPulseWidthMeasurementMode(un sign ed long data) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified pulse width measurement m[...]
-
Pagina 102
Rev .1.01 2007.02.16 RJJ10J1643-0101 102 Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Destroy the setting of timer X as pulse width measurement mode */ __DestroyPulseWidthMeasurementMode( RAPI_TIMER_X ); }[...]
-
Pagina 103
Rev .1.01 2007.02.16 RJJ10J1643-0101 103 __GetPulseWid thMeasurementMode Synopsis <Get measured value in puls e width measurement mode> Boolean __GetPulseWidthMeasurementMode(u nsign ed long d ata1, unsigned int *data2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the buffer in which counter value is stored Description [...]
-
Pagina 104
Rev .1.01 2007.02.16 RJJ10J1643-0101 104 [0]: The value of timer RA prescaler register i s stored. [1]: The value of timer RA register is stored. (H8/300H) • When using timer W (RAPI_TIMER_W specified) [0]: (The value of gener al register A) – (The value of gen eral register C) is stored. [1]: (The value of gener al register B) – (The value o[...]
-
Pagina 105
Rev .1.01 2007.02.16 RJJ10J1643-0101 105 __CreateInputCapture Synopsis <Set input capture mode> Boolean __Cre ateInputCapture(unsigned long dat a1, unsigne d int* data2, unsigned int* da ta3, unsigne d int* data4, v oid** data5) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) data3 Setup d[...]
-
Pagina 106
Rev .1.01 2007.02.16 RJJ10J1643-0101 106 RAPI_F ALLING Selects the falling edge of measurement pulse as active edge. RAPI_BOTH Select s both rising and falling edges of measurement pulse as active edge. RAPI_FIL TER_F1 Uses the digital filter facility that has a sampling frequency f 1 . RAPI_FIL TER_F8 Uses the digital filter facility that has a sa[...]
-
Pagina 107
Rev .1.01 2007.02.16 RJJ10J1643-0101 107 (Inter rupt) If overflo w interrupt reques ts are enabled, specify RAPI_OVERFLOW. If input capture A, input capture B, input capture C, or input capture D interrupt requests are enabled, specify RAPI_INPUT_CAPURE_A, RAPI_INPUT_CAPURE_B, RAPI_INPUT_CAPURE _C, or RAPI_INPUT_CAPURE_D, respectively . When not sp[...]
-
Pagina 108
Rev .1.01 2007.02.16 RJJ10J1643-0101 108 RAPI_TRD_F4 T i mer RD counts with internal clock φ /4. RAPI_TRD_F8 T i mer RD counts with internal clock φ /8. RAPI_TRD_F32 T imer RD counts with internal clock φ /32. RAPI_TRD_F40M T imer RD counts with internal clock φ 40M. RAPI_TIMER_ON Sets the timer to st art operating in __CreateInputCapture. RAPI[...]
-
Pagina 109
Rev .1.01 2007.02.16 RJJ10J1643-0101 109 (Counter clear) T o specify GRA, GRB, GRC, or GRD input capture for the cause for which the counter is cleared, select RAPI_COUNT_CLEAR_A, RAPI_COUNT_CLEAR_B, RAPI_COUNT_CLEA R_C, or RAPI_COUNT_CLEAR_D, respectively . If cleared at the same time a synchronously operating counter on anot her channel is cleare[...]
-
Pagina 110
Rev .1.01 2007.02.16 RJJ10J1643-0101 110 (Operating states set) S pecify one from [RAPI_TIME R_ON, RAPI_TIMER_OFF]. The default is RAPI_TIMER_OFF . (Interrupt) If overflow interrupt r equests are enabled, specify RAPI_OVERFLOW. If input capture A, input capture B, i nput capture C, or input capture D interrupt requests are enabled, specify RAPI_INP[...]
-
Pagina 111
Rev .1.01 2007.02.16 RJJ10J1643-0101 111 [2]: S pecify the set value for time measurement control re gister 2. [3]: S pecify the set value for time measurement control re gister 3. [4]: S pecify the set value for time measurement control re gister 4. [5]: S pecify the set value for time measurement control re gister 5. [6]: S pecify the set value f[...]
-
Pagina 112
Rev .1.01 2007.02.16 RJJ10J1643-0101 112 RAPI_TRD_RISING Selects the rising edge of measurement pulse as active edge. RAPI_TRD_F ALLING Selects the falling edge of measurement pulse as active edge. RAPI_TRD_BOTH Selects both ris ing and falling edges of measurement pulse as active edge. RAPI_FIL TER_ON Selects digital filter on. If not select “RA[...]
-
Pagina 113
Rev .1.01 2007.02.16 RJJ10J1643-0101 113 RAPI_CHANNEL1 Selects channel 1. RAPI_CHANNEL2 Selects channel 2. RAPI_CHANNEL3 Selects channel 3. RAPI_CHANNEL4 Selects channel 4. RAPI_CHANNEL5 Selects channel 5. RAPI_CHANNEL6 Selects channel 6. RAPI_CHANNEL7 Selects channel 7. (R8C) (H8/300H) S pecify 0. [data5] (M16C) S pecify a point er to the array in[...]
-
Pagina 114
Rev .1.01 2007.02.16 RJJ10J1643-0101 114 void func( void ) { /* Set up timer C as imput capture mode */ __CreateInputCapture( RAPI_TIMER_C|RAPI_TIMER_ON|RAPI_BOTH|RAPI_F32| RAPI_FRING128, 5, TimerIntFunc); }[...]
-
Pagina 115
Rev .1.01 2007.02.16 RJJ10J1643-0101 115 __EnableInputCapture Synopsis <Control operation of input capture mod e> Boolean __Enable InputCapture(unsigned long dat a) data Setup data (content differs with MCU type) Description Controls operation of the time r that is set to specified input capture mod e by starting or stopping it. [data] For da[...]
-
Pagina 116
Rev .1.01 2007.02.16 RJJ10J1643-0101 116 • The specifiable timers differ with each CPU used. Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Enable timer C as input capture mode */ __EnableInputCapture( RAPI_TIMER_C|RAPI_TIMER_ON ); }[...]
-
Pagina 117
Rev .1.01 2007.02.16 RJJ10J1643-0101 117 __DestroyInputCapture Synopsis <Discard settings of input capture mode> Boolean __DestroyInputCa pture(unsigned long dat a) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified input capture mode. [data] For data, the following definition v[...]
-
Pagina 118
Rev .1.01 2007.02.16 RJJ10J1643-0101 118 void func( void ) { /* Destroy the setting of timer C as input capture mode */ __DestroyInputCapture( RAPI_TIMER_C ); }[...]
-
Pagina 119
Rev .1.01 2007.02.16 RJJ10J1643-0101 119 __GetInputCapture Synopsis <Get input capture mode counter value> Boolean __GetInputCa p ture(unsigned long dat a1, unsigned int *dat a2) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) Description Gets the counter value of the timer that is set to [...]
-
Pagina 120
Rev .1.01 2007.02.16 RJJ10J1643-0101 120 • When timer RD is used (R API_TIMER_RD0- RAPI_TIMER_ RD1 specified) [0]: S tores the value of timer counter . [1]: S tores the value of general register A. [2]: S tores the value of general register B. [3]: S tores the value of general register C. [4]: S tores the value of general register D. (H8/300H) [0[...]
-
Pagina 121
Rev .1.01 2007.02.16 RJJ10J1643-0101 121 __CreateOutputCompare Synopsis <Set output compare mode> Boolean __Cre ateOutputCompare(uns igned long data 1, unsigned int* dat a2, unsigned int* dat a3, unsigned int* dat a4, void** dat a5) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) data3 Set[...]
-
Pagina 122
Rev .1.01 2007.02.16 RJJ10J1643-0101 122 RAPI_TRD_F32 Selects f 32 for the timer RD count source. RAPI_TRD_F40M Selects fOCO40M for the timer RD count source. RAPI_TRE_F4 Selects f 4 for the timer RE count source. RAPI_TRE_F8 Selects f 8 for the timer RE count source. RAPI_TRE_F32 Selects f 32 for the timer RE count source. RAPI_TRE_FC4 Selects fC4[...]
-
Pagina 123
Rev .1.01 2007.02.16 RJJ10J1643-0101 123 RAPI_UNCHANGE_0 Leaves CMP0 output unchanged even when matched in compare 0. RAPI_REVERSE_0 Inverts CMP0 output upon compare 0 match signal. RAPI_L_0 Forces CMP0 output low upon compare 0 match signal. RAPI_H_0 Forces CMP0 output high upon compare 0 match signal. RAPI_UNCHANGE_1 Leaves CMP1 output unchanged [...]
-
Pagina 124
Rev .1.01 2007.02.16 RJJ10J1643-0101 124 (TC reload) T o reload TC register , specify RAPID_RELOAD. If RAPID_RELOAD is not specified, “No reload” is set. (CMP0 output mode) S pecify one from { RAPI_UNCHA NGE_0, RAPI_REVERSE_0, RAPI_L_0, RAPI_H_0 }. The default value is RAPI_UNCHANGE_0. (CMP1 output mode) S pecify one from { RAPI_UNCHA NGE_1, RA[...]
-
Pagina 125
Rev .1.01 2007.02.16 RJJ10J1643-0101 125 RAPI_TIMER_W Uses timer W. RAPI_TIMER_Z0 Uses timer Z channel 0. RAPI_TIMER_Z1 Uses timer Z channel 1. RAPI_TIMER_RC Uses timer RC. RAPI_TIMER_RD0 Uses timer RD0 channel 0. RAPI_TIMER_RD1 Uses timer RD0 channel 1. RAPI_TIMER_RD2 Uses timer RD0 channel 2. RAPI_TIMER_RD3 Uses timer RD0 channel 3. RAPI_TW_F1 T [...]
-
Pagina 126
Rev .1.01 2007.02.16 RJJ10J1643-0101 126 RAPI_COUNT_CLEAR_S YNC Clear counter in sync with the synchronized other timer counter RAPI_TIMER_SYNC S ynchronizes timer on channels 0 and 1. • Specifiable definition values when timer W is used (RAPI_TIMER_W specified ) (Count source) S pecify one from { RAPI_TW_F1, RAPI_TW_F2, RAPI_TW_F4, RAPI_TW_F8 }.[...]
-
Pagina 127
Rev .1.01 2007.02.16 RJJ10J1643-0101 127 (Interrupt) If overflow interrupt reques ts are enabled, specify RAPI_OVERFLOW. If compare match A, comp are match B, compare match C, or compare match D interrupt requests are enabled, specify RAPI_COMP A RE_MA TCH_A, RAPI_COMP ARE_MA TCH_B, RAPI_COMP A RE_MA TCH_C, or RAPI_COMP ARE_M A TCH_D, respectively [...]
-
Pagina 128
Rev .1.01 2007.02.16 RJJ10J1643-0101 128 (M16C) S pecif y a pointer to the array in which the set value for the waveform generation control register or waveform g eneration r egister is stored. [0]: S pecify the set value for waveform generation control re gister 0. [1]: S pecify the set value for waveform generation control re gister 1. [2]: S pec[...]
-
Pagina 129
Rev .1.01 2007.02.16 RJJ10J1643-0101 129 (Output mode) S pecify one from { RAPI_SINGLE, RAPI_SR, RAPI_PHASE_DELA YED }. The default value is RAPI_SINGLE. (Initial output value) S pecify one from { RAPI_OUT_ INIT_0, RAPI_OUT_INIT_1 }. Th e default value is RAPI_OUT_INIT_0. (Output inversion) T o invert the output, specify RAPI_OUTPUT_REVERSED. If ou[...]
-
Pagina 130
Rev .1.01 2007.02.16 RJJ10J1643-0101 130 [6]: S pecify the comparison value of general register C i n 16 bits. [7]: S pecify the comparison value of general register D i n 16 bits. To specify output operation for each output compare of array elements, the following definition values can be used. To specify multiple definition values at the same tim[...]
-
Pagina 131
Rev .1.01 2007.02.16 RJJ10J1643-0101 131 [1]: S pecify a pointer to the callba ck function for IC/OC interrupt 0. If this pointer is not specified, 0 is set. [2]: S pecify a pointer to the callba ck function for IC/OC interrupt 1. If this pointer is not specified, 0 is set. (R8C) • When timer C is used (R API_TIMER_C specified) S pecify a point e[...]
-
Pagina 132
Rev .1.01 2007.02.16 RJJ10J1643-0101 132 #include "rapi_timer_r8c_13.h" void TimerIntFunc0( void ){} void TimerIntFunc1( void ){} void TimerIntFunc2( void ){} void func( void ) { unsigned int *p_func[] = {(void*) TimerIntFunc0,(void*) TimerIntFunc1, (void*) TimerIntFunc2}; unsigned char p_ic[] = {1,2,3}; unsigned int p_cmp[] = {0x1234, 0x[...]
-
Pagina 133
Rev .1.01 2007.02.16 RJJ10J1643-0101 133 __EnableOutputComp are Synopsis <Control operation of output compare mode> Boolean __EnableOutputCo mpare(unsigned long da ta) data Setup data (content differs with MCU type) Description Controls operation of the timer that is set to specifi ed output compare mode by starting or stopping it. [data] For[...]
-
Pagina 134
Rev .1.01 2007.02.16 RJJ10J1643-0101 134 guaranteed. • The specifiable timers differ with each CPU used. Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Enable timer C as output compare mode */ __EnableOutputCompare( RAPI_TIMER_C|RAPI_TIMER_ON ); }[...]
-
Pagina 135
Rev .1.01 2007.02.16 RJJ10J1643-0101 135 __DestroyOutputCompare Synopsis <Discard settings of output compare mode> Boolean __DestroyOutputComp are(unsigned long data) data Setup data (content differs with MCU type) Description Discards settings of the timer that is set to specified output compare mode. [data] For data, the following definitio[...]
-
Pagina 136
Rev .1.01 2007.02.16 RJJ10J1643-0101 136 void func( void ) { /* Destroy the setting of timer C as output compare mode */ __DestroyOutputCompare( RAPI_TIMER_C ); }[...]
-
Pagina 137
Rev .1.01 2007.02.16 RJJ10J1643-0101 137 __SetTimerRegister Synopsis <Set timer register> Boolean __SetT imerRegister(unsigned long dat a1, unsigned int *dat a2) data1 Setup dat a 1 (content differs with MCU type) data2 Pointer to the buf fer in which register value is stored Description Sets the registers of a specified timer . [data1] For d[...]
-
Pagina 138
Rev .1.01 2007.02.16 RJJ10J1643-0101 138 [data2] The content of a pointer to the buffer in which the register value is stored must be specifie d as described below . The value is set in each r egister in order of buffer pointer element s. (M16C) • When using timer A (RAPI_TIMER_A0 to RAPI_TIMER_A 4 specified) [0]: S pecify the set value for t he [...]
-
Pagina 139
Rev .1.01 2007.02.16 RJJ10J1643-0101 139 [27]: S pecify the set value for waveform generation register 4. [28]: S pecify the set value for waveform generation register 5. [29]: S pecify the set value for waveform generation register 6. [30]: S pecify the set value for waveform generation register 7. [31]: S pecify the set value for the facility sel[...]
-
Pagina 140
Rev .1.01 2007.02.16 RJJ10J1643-0101 140 [1]: S pecify the set value for the timer RB I/O control register . [2]: S pecify the set value for the timer RB prescaler register . [3]: S pecify the set value for the timer RB primary register . [4]: S pecify the set value for the timer RB secondary register. [5]: S pecify the set value for the timer RB m[...]
-
Pagina 141
Rev .1.01 2007.02.16 RJJ10J1643-0101 141 [3]: S pecify the set value fo r timer control register V0. [4]: S pecify the set value fo r timer control register V1. [5]: S pecify the set value for ti mer control/status register V . • When using timer W (RAPI_TIMER_W specified) [0]: S pecify the set value for timer control register W . [1]: S pecify t[...]
-
Pagina 142
Rev .1.01 2007.02.16 RJJ10J1643-0101 142 [1 1]: S pecify the set value for general registe r C. [12]: S pecify the set value for general register D. [13]: S pecify the set value for timer RC mode register . • When using timer RD (RAPI_TIMER_RD 0 to RAPI_TIMER_RD3 specified) [0]: S pecify the set value for the timer RD mode register . [1]: S pecif[...]
-
Pagina 143
Rev .1.01 2007.02.16 RJJ10J1643-0101 143 __EnableTimerRegister Synopsis <Control operation of timer register> Boolean __Enable TimerRegister (unsigned long dat a) data Setup data (content differs with MCU type) Description Controls operation of a spec ified timer by starting or stopping it. [data] For data, the following definition values can[...]
-
Pagina 144
Rev .1.01 2007.02.16 RJJ10J1643-0101 144 RAPI_TIMER_RD2 Selects timer RD channel 2. RAPI_TIMER_RD3 Selects timer RD channel 3. 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, R API_F ALSE is returned; otherwise, RAPI_TRUE is ret[...]
-
Pagina 145
Rev .1.01 2007.02.16 RJJ10J1643-0101 145 __ClearTimerRegister Synopsis <Clear timer register> Boolean __Cle arTimerRegister(unsigne d long data) data Setup data (content differs w i th MCU type) Description Sets the timer register of a specified timer to its initial value after reset. [data] For data, the following definition values can be se[...]
-
Pagina 146
Rev .1.01 2007.02.16 RJJ10J1643-0101 146 Return value If the timer specification is incorrec t, RAPI_F ALSE is returned; otherwise, RAPI_TRUE is returned. Functionality T imer (register mani pulation) Reference __SetT imerRe gister , __EnableTimerRegister , __GetTimerRegister Remark • If an undefined value is specified in the ar gument, operation[...]
-
Pagina 147
Rev .1.01 2007.02.16 RJJ10J1643-0101 147 __GetTimerRegister Synopsis <Get timer register value> Boolean __GetT imerRegister(unsigned long dat a1, unsigned int *dat a2) data1 Setup data (content differs with MCU type) data2 Pointer to the buffer in which register value is stored Description Gets the counter value of a specified timer . [data] [...]
-
Pagina 148
Rev .1.01 2007.02.16 RJJ10J1643-0101 148 [data2] S pecify a point er to the array in which the acquired reg ister value is stored. The content of the array is described bel ow . (M16C) • When using timer A (RAPI_TIMER_ A0 to RAPI_TIMER_A4 specified) [0]: S tore the value of timer Ai mode register (i = 0 –4). [1]: S tore the value of timer Ai re[...]
-
Pagina 149
Rev .1.01 2007.02.16 RJJ10J1643-0101 149 [26]: S tore the value of time measurement r egister 3/waveform generation register 3. [27]: S tore the value of time measurement r egister 4/waveform generation register 4. [28]: S tore the value of time measurement r egister 5/waveform generation register 5. [29]: S tore the value of time measurement r egi[...]
-
Pagina 150
Rev .1.01 2007.02.16 RJJ10J1643-0101 150 • When using timer RB (R API_TIMER_RB specified) [0]: S pecify the set value for the timer RB one shot control register . [1]: S pecify the set value for t he timer RB I/O control register . [2]: S pecify the set value for t he timer RB prescaler register . [3]: S pecify the set value for the timer RB prim[...]
-
Pagina 151
Rev .1.01 2007.02.16 RJJ10J1643-0101 151 [1]: S tore the value of time constant register A. [2]: S tore the value of time constant register B. [3]: S tore the value of timer control register V0. [4]: S tore the value of timer control register V1. [5]: S tore the value of timer control/status register V . • When using timer W (RAPI_TI MER_W specif[...]
-
Pagina 152
Rev .1.01 2007.02.16 RJJ10J1643-0101 152 [9]: S pecify the set value for general register A. [10]: S pecify the set value for general register B. [1 1]: S pecify the set value for general registe r C. [12]: S pecify the set value for general register D. [13]: S pecify the set value for timer RC mode register . • When using timer RD (RAPI_TIMER_RD[...]
-
Pagina 153
Rev .1.01 2007.02.16 RJJ10J1643-0101 153 4.2.3 I/O Port __SetIOPort Synopsis <Set I/O port> Boolean __SetIOPort(uns igned long dat a1, unsigned int dat a2) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) Description Sets the operating conditions of a specified I/O port. [data1] For data1, [...]
-
Pagina 154
Rev .1.01 2007.02.16 RJJ10J1643-0101 154 RAPI_PORT_9_0 Port P9 0 RAPI_PORT_9_1 Port P9 1 RAPI_PORT_9_2 Port P9 2 RAPI_PORT_9_3 Port P9 3 RAPI_PORT_9_5 Port P9 5 RAPI_PORT_9_6 Port P9 6 RAPI_PORT_9_7 Port P9 7 RAPI_PORT_10_0 Port P10 0 RAPI_PORT_10_1 Port P10 1 RAPI_PORT_10_2 Port P10 2 RAPI_PORT_10_3 Port P10 3 RAPI_PORT_10_4 Port P10 4 RAPI_PORT_1[...]
-
Pagina 155
Rev .1.01 2007.02.16 RJJ10J1643-0101 155 RAPI_NOT_PULLED_HIGH Sets a selected port not to be pulled high. RAPI_DRIVE_CAP ACITY_H Sets the N-channel output transistor drive capacity of a selected port to High. S pecifiable only when port P1 is used. RAPI_DRIVE_CAP ACITY_L Sets the N-channel output transistor drive capacity of a selected port to Low [...]
-
Pagina 156
Rev .1.01 2007.02.16 RJJ10J1643-0101 156 RAPI_PORT_D_6 PortPD6 RAPI_PORT_D_7 PortPD7 RAPI_PORT_E_0 PortPE0 RAPI_PORT_E_1 PortPE1 RAPI_PORT_E_2 PortPE2 RAPI_PORT_E_3 PortPE3 RAPI_PORT_E_4 PortPE4 RAPI_PORT_E_5 PortPE5 RAPI_PORT_E_6 PortPE6 RAPI_PORT_E_7 PortPE7 RAPI_PORT_F_0 PortPF0 RAPI_PORT_G_0 PortPG0 RAPI_PORT_G_1 PortPG1 RAPI_PORT_G_2 PortPG2 R[...]
-
Pagina 157
Rev .1.01 2007.02.16 RJJ10J1643-0101 157 Program example #include " rapi_io_port_r8c_13.h void func( void ) { /* Set up port P03 as input port */ __SetIOPort(RAPI_PORT_0_3| RAPI_PORT_INPUT| RAPI_PULLED_HIGH, 0, 0 ); }[...]
-
Pagina 158
Rev .1.01 2007.02.16 RJJ10J1643-0101 158 __ReadIOPort Synopsis <Read from I/O port> Boolean __Rea dIOPort(unsigned long dat a1, unsigned int *dat a2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the variable in which the value read from I/O po rt is stored. Description Gets the value of a specified I/O port. [data1] S p[...]
-
Pagina 159
Rev .1.01 2007.02.16 RJJ10J1643-0101 159 RAPI_PORT_9_5 Port P9 5 RAPI_PORT_9_6 Port P9 6 RAPI_PORT_9_7 Port P9 7 RAPI_PORT_10_0 Port P10 0 RAPI_PORT_10_1 Port P10 1 RAPI_PORT_10_2 Port P10 2 RAPI_PORT_10_3 Port P10 3 RAPI_PORT_10_4 Port P10 4 RAPI_PORT_10_5 Port P10 5 RAPI_PORT_10_6 Port P10 6 RAPI_PORT_10_7 Port P10 7 (R8C) RAPI_PORT_0_0 Port P0 0[...]
-
Pagina 160
Rev .1.01 2007.02.16 RJJ10J1643-0101 160 RAPI_PORT_5_1 PortP51 RAPI_PORT_5_2 PortP52 RAPI_PORT_5_3 PortP53 RAPI_PORT_5_4 PortP54 RAPI_PORT_5_5 PortP55 RAPI_PORT_5_6 PortP56 RAPI_PORT_5_7 PortP57 RAPI_PORT_6_0 PortP60 RAPI_PORT_6_1 PortP61 RAPI_PORT_6_2 PortP62 RAPI_PORT_6_3 PortP63 RAPI_PORT_6_4 PortP64 RAPI_PORT_6_5 PortP65 RAPI_PORT_6_6 PortP66 R[...]
-
Pagina 161
Rev .1.01 2007.02.16 RJJ10J1643-0101 161 RAPI_PORT_H_4 PortPH4 RAPI_PORT_H_5 PortPH5 RAPI_PORT_H_6 PortPH6 RAPI_PORT_H_7 PortPH7 RAPI_PORT_J_0 PortPJ0 RAPI_PORT_J_1 PortPJ1 Return value If the I/O port specification is incorrect , RAPI_F ALSE is returned; otherwise, RAPI_TRUE is returned. Functionality I/O port Reference __SetIOPort , __WriteIOPort[...]
-
Pagina 162
Rev .1.01 2007.02.16 RJJ10J1643-0101 162 __WriteIOPort Synopsis <Write to I/O p ort> Boolean __W riteIOPort(unsigned long dat a1, unsigned i nt data2) data1 Setup data 1 (content differs with MCU type) data2 Data to be written to I/O port Description Writes data to a specified I/O port. [data1] S pecify an I/O port to which data is written. T[...]
-
Pagina 163
Rev .1.01 2007.02.16 RJJ10J1643-0101 163 RAPI_PORT_9_5 Port P9 5 RAPI_PORT_9_6 Port P9 6 RAPI_PORT_9_7 Port P9 7 RAPI_PORT_10_0 Port P10 0 RAPI_PORT_10_1 Port P10 1 RAPI_PORT_10_2 Port P10 2 RAPI_PORT_10_3 Port P10 3 RAPI_PORT_10_4 Port P10 4 RAPI_PORT_10_5 Port P10 5 RAPI_PORT_10_6 Port P10 6 RAPI_PORT_10_7 Port P10 7 (R8C) RAPI_PORT_0_0 Port P0 0[...]
-
Pagina 164
Rev .1.01 2007.02.16 RJJ10J1643-0101 164 RAPI_PORT_5_5 PortP55 RAPI_PORT_5_6 PortP56 RAPI_PORT_5_7 PortP57 RAPI_PORT_6_0 PortP60 RAPI_PORT_6_1 PortP61 RAPI_PORT_6_2 PortP62 RAPI_PORT_6_3 PortP63 RAPI_PORT_6_4 PortP64 RAPI_PORT_6_5 PortP65 RAPI_PORT_6_6 PortP66 RAPI_PORT_6_7 PortP67 RAPI_PORT_7_0 PortP70 RAPI_PORT_7_1 PortP71 RAPI_PORT_7_2 PortP72 R[...]
-
Pagina 165
Rev .1.01 2007.02.16 RJJ10J1643-0101 165 __WriteIOPortRegister Remark • If an undefined value is specified in the first argum ent, operation of the API cannot be guaranteed. • The specifiable I/O ports differ with each CPU used. Program example #include " rapi_io_port_r8c_13.h" void func( void ) { unsigned int data; /* Set the data to[...]
-
Pagina 166
Rev .1.01 2007.02.16 RJJ10J1643-0101 166 __SetIOPortRegister Synop sis <Set I/O port register> Boolean __Set IOPortRegiste r(unsigne d l ong da t a1, unsigned int dat a2, unsigned int dat a3, unsigned int dat a4) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) data3 Setup data 3 (content d[...]
-
Pagina 167
Rev .1.01 2007.02.16 RJJ10J1643-0101 167 S pecify the set value for the port contro l register corresponding to a select ed port. [data3] (M16C) (R8C) S pecif y the set value for the pullup control re gister corresponding to a s elected port. (H8/300H) S pecif y the set value for the pullup control re gister corresponding to a s elected port. [data[...]
-
Pagina 168
Rev .1.01 2007.02.16 RJJ10J1643-0101 168 __ReadIOPortRegister Synopsis <Read from I/O port register> Boolean __ReadIOPortRegi ster(unsigned long dat a1, unsigned int *dat a2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the variable in which the val ue read from I/O port register i s stored. Description Gets the value o[...]
-
Pagina 169
Rev .1.01 2007.02.16 RJJ10J1643-0101 169 • Ports in port B of the H8/300H that are us ed as analog input pins cannot be used as input ports. Program example #include " rapi_io_port_r8c_13.h" void func( void ) { unsigned int data; /* Get the value of port P1 register */ __ReadIOPortRegister( RAPI_PORT_1, &data ); }[...]
-
Pagina 170
Rev .1.01 2007.02.16 RJJ10J1643-0101 170 __WriteIOPortRegister Synopsis <W rite to I/O port register> Boolean __W riteIOPortRegister(unsigned long dat a1, unsigned int dat a2) data1 Setup data 1 (content differs with MCU type) data2 Data to be written to I/O port register Description Writes the value for a specified I/O port to eac h relevant[...]
-
Pagina 171
Rev .1.01 2007.02.16 RJJ10J1643-0101 171 Program example #include " rapi_io_port_r8c_13.h" void func( void ) { /* Set the data to port P1 register */ __WriteIOPortRegister( RAPI_PORT_1, 0xFF ); }[...]
-
Pagina 172
Rev .1.01 2007.02.16 RJJ10J1643-0101 172 4.2.4 External interrupt __SetInterrupt Synopsis <Set external interrupt> Boolean __SetInterrupt(uns igned long dat a1, unsigned int dat a2, void* func) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) func Callback function pointer (S pecify 0 if no[...]
-
Pagina 173
Rev .1.01 2007.02.16 RJJ10J1643-0101 173 RAPI_INT2 Uses _INT2 interrupt. RAPI_INT3 Uses _INT3 interrupt. RAPI_KEY Uses key input interrupt. RAPI_INT_RISING S pecifies a rising edge for the active edge of a selected external interrupt. RAPI_INT_F ALLING Specifies a falling edge for the active edge of a selected external interrupt. RAPI_INT_BOTH Spec[...]
-
Pagina 174
Rev .1.01 2007.02.16 RJJ10J1643-0101 174 RAPI_INT_RISING S pecifies a rising edge for the ac tive edge of a selected external interrupt. RAPI_INT_F ALLING S pecifies a falling edge fo r the active edge of a selected external interrupt. RAPI_WKP0_F ALLING Enables _WKP0 pin input whose falling edge is the active edge. RAPI_WKP0_RISING Enables _WKP0 p[...]
-
Pagina 175
Rev .1.01 2007.02.16 RJJ10J1643-0101 175 RAPI_TRUE is returned. Functionality External interrupt Reference __EnableInterrupt , __GetInterruptFlag , __ClearInterruptF lag Remark • If an undefined value is specified in the first argum ent, operation of the API cannot be guaranteed. • The specifiable exter nal interrupts differ with each CPU used.[...]
-
Pagina 176
Rev .1.01 2007.02.16 RJJ10J1643-0101 176 __EnableInterrupt Synopsis <Control external interrupt> Boolean __Enable Interrupt(unsigned long dat a1, unsigned int da ta2) data1 Setup data 1 (content differs with MCU type) data2 Setup data 2 (content differs with MCU type) Description Changes the operating conditi on of a specified external inter [...]
-
Pagina 177
Rev .1.01 2007.02.16 RJJ10J1643-0101 177 Return value If the external interrupt specification is inc orrect, RAPI_F ALSE is returned; other wise, RAPI_TRUE is returned. Functionality External interrupt Reference __SetInterrupt , __GetInterruptFlag , __C learInterruptFlag Remark • If an undefined value is specified in the first argum ent, operatio[...]
-
Pagina 178
Rev .1.01 2007.02.16 RJJ10J1643-0101 178 __GetInterruptFlag Synopsis <Get the status of external interrupt flag> Boolean __GetInterruptFlag (unsigned long dat a1, unsigned int *dat a2)) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the buffer in which the acquired flag data is stored Description Gets the value of interru[...]
-
Pagina 179
Rev .1.01 2007.02.16 RJJ10J1643-0101 179 Functionality External interrupt Reference __SetInterrupt , __EnableInter rupt , __ClearInterruptFlag Remark • If an undefined value is specified in the first argum ent, operation of the API cannot be guaranteed. • The specifiable exter nal interrupts differ with each CPU used. Program example #include &[...]
-
Pagina 180
Rev .1.01 2007.02.16 RJJ10J1643-0101 180 __ClearInterruptFlag Synopsis <Clear external interrupt flag> Boolean __Cle arInterruptFlag(unsigned long da ta) data Setup data (content differs with MCU type) Description Clears the interrupt request flag of a specified exter nal interrupt. [data] (M16C) RAPI_INT0 Uses _INT0 interrupt. RAPI_INT1 Uses[...]
-
Pagina 181
Rev .1.01 2007.02.16 RJJ10J1643-0101 181 be guaranteed. • The specifiable exter nal interrupts differ with each CPU used. Program example #include " rapi_interrupt_r8c_13.h" void func( void ) { /* Clear status of _INT0 interrupt */ __ClearInterruptFlag( RAPI_INT0 ); }[...]
-
Pagina 182
Rev .1.01 2007.02.16 RJJ10J1643-0101 182 4.2.5 A/D converter __CreateADC Synopsis <Set A/D converter> Boolean __Cre ate ADC(unsigne d long data 1, unsigned int dat a2, unsigned int dat a3, void* func) data1 Setup data 1 (content differs with MCU type) data2 Number of analog input pins used by A/D converter (differs with MCU t ype) data3 Setup[...]
-
Pagina 183
Rev .1.01 2007.02.16 RJJ10J1643-0101 183 RAPI_AN22 Uses AN 22 pin for the analog input pin. RAPI_AN23 Uses AN 23 pin for the analog input pin. RAPI_AN24 Uses AN 24 pin for the analog input pin. RAPI_AN25 Uses AN 25 pin for the analog input pin. RAPI_AN26 Uses AN 26 pin for the analog input pin. RAPI_AN27 Uses AN 27 pin for the analog input pin. RAP[...]
-
Pagina 184
Rev .1.01 2007.02.16 RJJ10J1643-0101 184 (Conversion method) S pecify one from { RAPI_WITH_S AMPLE_HOLD, RAPI_WITHOUT_SAMPLE_HOLD }. The default value is RAPI_WITHOUT_SAMPLE_HOLD. (T rigge r) S pecify one from { RAPI_SOFTWARE_TRIGGER, RAPI_EXTERNAL_TRIGGER }. The default value is RAPI_SOFTWARE_TRIGGER. • Specifiable definition values when repeat [...]
-
Pagina 185
Rev .1.01 2007.02.16 RJJ10J1643-0101 185 (Resolution) Specify o ne from { RAPI_10BIT , RAPI_8BIT }. The default value is RAPI_8BIT . (Operating states set) S pecify one from { RAPI_AD_ON, RAPI_AD_ OFF }. The default value is RAPI_AD_OFF . (Conversion method) S pecify one from { RAPI_WITH_S AMPLE_HOLD, RAPI_WITHOUT_SAMPLE_HOLD }. The default value i[...]
-
Pagina 186
Rev .1.01 2007.02.16 RJJ10J1643-0101 186 (Resolution) Specify o ne from { RAPI_10BIT , RAPI_8BIT }. The default value is RAPI_8BIT . (Conversion method) S pecify RAPI_WITH_SAMPLE_HOLD. • Specifiable definition values when dela yed trigger mode 1 is used (RAPI_DELA YE D_TRIGGER1 specified) (Input pin) S pecify one from { RAPI_P0_GROUP , RAPI_P10_G[...]
-
Pagina 187
Rev .1.01 2007.02.16 RJJ10J1643-0101 187 RAPI_SOFTW A RE_TRI GGER Selects sof tware trigger. RAPI_TIMER_RD_TRIG GER Selects timer RD as trigger . • Speci fiable definition v alues when one-shot mode i s used (RAPI_ONE_S HO T specified) (Input pin) S pecify one from { RAPI_AN 0, RAPI_AN1, RAPI_AN2, RAPI_AN3, RAPI_AN4, RAPI_AN5, RAPI_AN6, RAPI_AN7,[...]
-
Pagina 188
Rev .1.01 2007.02.16 RJJ10J1643-0101 188 RAPI_AN4 Uses AN4 pin for the analog input pin. RAPI_AN5 Uses AN5 pin for the analog input pin. RAPI_AN6 Uses AN6 pin for the analog input pin. RAPI_AN7 Uses AN7 pin for the analog input pin. RAPI_AN8 Uses AN8 pin for the analog input pin. RAPI_AN9 Uses AN9 pin for the analog input pin. RAPI_AN10 Uses AN10 p[...]
-
Pagina 189
Rev .1.01 2007.02.16 RJJ10J1643-0101 189 (Input pin) S pecify one from { RAPI_AN0, RAPI_AN 1, RAPI_AN2, RAPI_AN 3, RAPI_AN4, RAPI_AN5, RAPI _AN6, RAPI_AN7 , RAPI_AN8, RAPI _AN9, RAPI_AN1 0, RAPI_AN1 1, RAPI_AN12, RAPI_AN13, RAPI_A N14, RAPI_AN15 } T he default value is RAPI_A N0. (Conversion time) S pecify one from { RAPI_134 _ST A TES, RAPI_ 70_ST[...]
-
Pagina 190
Rev .1.01 2007.02.16 RJJ10J1643-0101 190 Delayed trigger mode 1 Repeat sweep mode S pecify 1, 2, 3, or 4. (R8C) S pecify 1. (H8/300H) One-shot mode S pecify 1. Repeat mode Single sweep mode Specify 1, 2, 3, or 4. Repeat sweep mode 0 [data3] (M16C) (R8C) S pecify the interrupt priority le vel (0 – 7) to be set in the interrupt control register . ([...]
-
Pagina 191
Rev .1.01 2007.02.16 RJJ10J1643-0101 191 __EnableADC Synopsis <Control operation of A/D converter> Boolean __EnableA DC (unsigned long dat a1, unsigned int da ta2) data1 Setup data 1 (content differs with MCU type) data2 Number of analog input pins used by A/D converter (differs with MCU type) Description Controls operation of the A/D conv er[...]
-
Pagina 192
Rev .1.01 2007.02.16 RJJ10J1643-0101 192 Selectable only when one -shot mode or repeat mode is used. RAPI_AN21 Uses AN 21 pin for the analog input pin. Selectable only when one -shot mode or repeat mode is used. RAPI_AN22 Uses AN 22 pin for the analog input pin. Selectable only when one -shot mode or repeat mode is used. RAPI_AN23 Uses AN 23 pin fo[...]
-
Pagina 193
Rev .1.01 2007.02.16 RJJ10J1643-0101 193 RAPI_AN4 Uses AN 4 pin for the analog input pin. RAPI_AN5 Uses AN 5 pin for the analog input pin. RAPI_AN6 Uses AN 6 pin for the analog input pin. RAPI_AN7 Uses AN 7 pin for the analog input pin. RAPI_AN8 Uses AN 8 pin for the analog input pin. RAPI_AN9 Uses AN 9 pin for the analog input pin. RAPI_AN10 Uses [...]
-
Pagina 194
Rev .1.01 2007.02.16 RJJ10J1643-0101 194 Selectable only when sweep mode or repeat s weep mode 0 is used. RAPI_AN4_GROUP Uses AN4-AN7 pi ns group for the analog input pin. Selectable only when sweep mode or repeat s weep mode 0 is used. RAPI_AN8_GROUP Uses AN8-AN1 1 pi ns group for the analog input pin. Selectable only when sweep mode or repeat s w[...]
-
Pagina 195
Rev .1.01 2007.02.16 RJJ10J1643-0101 195 void func( void ) { /* Disable A/D converter */ __EnableADC( RAPI_AN0|RAPI_AD_OFF, 1 ); }[...]
-
Pagina 196
Rev .1.01 2007.02.16 RJJ10J1643-0101 196 __DestroyADC Synopsis <Discard settings of A/D converter> Boolean __Destroy ADC(void) Description Discards settings of a specified A/D converter . Return value If converter setting was successfully discar ded, RAPI_TRUE is returned; if failed, RAPI_F ALSE is returned. Functionality A/D converter Refere[...]
-
Pagina 197
Rev .1.01 2007.02.16 RJJ10J1643-0101 197 __GetADC Synopsis <Get A/D converted val ue (register spec ified)> Boolean __GetA DC(unsigned long dat a1, unsigned int *dat a2) data1 Setup data 1 (content differs with MCU type) data2 Pointer to the buffer in which A/D converted value is stored. Description Gets the A/D converted value fr om a specif[...]
-
Pagina 198
Rev .1.01 2007.02.16 RJJ10J1643-0101 198 __GetADCAll Synopsis <Get A/D converted va lue (all registers)> Boolean __Get ADCAll(unsigned int *data) data Pointer to the buffer in which A/D converted value is stored. Description Gets the A/D converted valu e from all A/D registers. The A/D registers from which A/D convert ed values are acquired a[...]
-
Pagina 199
Rev .1.01 2007.02.16 RJJ10J1643-0101 199 __GetADCSt atus Synopsis <Get the status of A/D converter> Boolean __GetADCSta tu s(u nsigned int *st atu s) st at us Pointer to the buffer in which the r egister content indicating A/D converter status is stored. Description Gets the status of a s pecified A/D converter . The status of interrupt bit ([...]
-
Pagina 200
Rev .1.01 2007.02.16 RJJ10J1643-0101 200 __ClearADCSt atus Synopsis <Clear the status of A/D converter> Boolean __Clear ADCSt atus(unsig n ed int st atu s) status S tatus of A/D converter Description Clears the status flag of a specified A/D converter . S pecify the status of interrupt bit (when using the M16C or R8C) or the value of A/D end [...]
-
Pagina 201
Rev .1.01 2007.02.16 RJJ10J1643-0101 201 Renesas Embedded Application Programming Interface Reference Manual Rev . 1.01 Issued: April 2007[...]
-
Pagina 202
2- 6 -2, Ote-machi, Chiyoda-ku, Tokyo, 1 00-0004, Japan Renesas Embedded Application Programming Interface Reference manual[...]