Gebruiksaanwijzing /service van het product M16C/62P Group van de fabrikant Renesas
Ga naar pagina of 98
www.renesas.com Reference Manual REC10 B 0002-0100 M16C/62P Group Renesas Embedded Application Programming Interface Reference Manual Rev .1.00 Revision Date: Nov .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 2 Renesas Embedded Application Programming Interface Reference Manual <M16C/62P Group>.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 3 T able of Contents T able of Contents ............................................................... 3 1. Introduction ................................................................... 5 2. Driver ..........
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 4 __DestroyT imer .......................................................... 43 __CreateEven tCounter ..................................................... 44 __EnableEve ntCounter ...............................
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 5 1. Introduction The Renesas Embe dded Applicati o n Programmin g Interface (API) is a unified API for the microcomputers ma de by Re nesas T e chnology Corporation.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 6 2. Driver 2.1 Overview The library described herein pr ovid es a peripheral facility control program (peripheral driver) for microc omputers. Use of t he Renesas API perm its the peripheral driver t o be built into a user program.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 7 2.3 Serial Interface Driver The serial interf ace driver sets serial communicati on, clears settings, transmit/recei ves data, and controls the status of serial communicat ion.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 8 2.4 Timer Driver The timer driver sets th e timer , clears timer settings, c o ntrols timer oper ation, and acquires a counter value with respect to the follow.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 9 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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 10 2.6 External Interrupt Driver The external interru pt driver sets external interrupts, controls external interru pts, acquires the status of ext e rnal interrupt fl ags, and clears external interrupt flags.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 11 2.7 A/D Converter Drive r The A/D converter dr iver sets the A/ D converter , controls t he A/D converter , clears settings of the A/D con verter , acquires the A/D convert er value, acquires the status of the A/D converter , and clears the status of the A/D converter .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 12 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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 13 4. Library Reference 4.1 API List by Peripheral Facility The table below lists the Renesas Embedded APIs classified by peripheral facility .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 14 35 __CreatePulseWidthMeasure mentMode Sets pulse width measurement mode 36 __EnablePulseWidthMeasurem entMode Controls operat ion of puls e width measurement .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 15 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 int o the followin g items. • Synop sis : Outlines the content of processing performed by the f unction.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 16 4.2.1 Serial I/O __BasicOpenSerialDriver Synopsis <Open a serial port> Boolean __BasicOpenSerialDri ver(unsigned long data) data Setup data Description Opens and initializes a specifi ed seri al port. For dat a, the follo wing values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 17 __BasicCloseSerialDriver Synopsis <Close a serial port> Boolean __BasicClos eSerialDri ver(unsigned long dat a) data Setup data Description Closes a specified serial p ort. For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 18 __BasicSetSerialFormat Synopsis <Set serial communication> Boolean __Bas icSetSerialFormat(unsign ed long dat a1, unsigned cha r dat a2) data1 Setup data 1 data2 Setup data 2 Description Sets serial communication according to specified parameters.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 19 If the API is used in clock synchronous seri a l communication mode, do not set these values. (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 atio n , the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 20 If serial communication was successfully set, R API_TRUE is returned; if settings failed, RAPI_F ALSE is returned. Functionality Serial I/O Reference Remark • If an undefined value is spec ified in the first argument, operation of the A PI cannot be guaranteed.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 21 __BasicSt artSerialReceiving Synopsis <Receive 1 data> Boolean __Bas icSt artSerialReceiving(uns igned long dat a) data Setup data Description S tarts receiving 1 data of serial communication. [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 22 __BasicSt artSerialSending Synopsis <Transmit 1 dat a> Boolean _Basic St artSerialSending( unsigned long dat a1, unsigned int da ta2) data Setup data data T ransmit data Description S tarts sending 1 data of serial communication.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 23 __BasicReceivingSt atusRead Synopsis <Read receive status> unsigned int _ _BasicRece ivingSt atusRead(unsigned lo ng dat a) data Setup data Description Returns the re ceive status of serial communication.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 24 __BasicSendingSt atusRead Synopsis <Read transmit status> Boolean __BasicSe ndingS ta tus R ea d(uns igne d long data) data Setup data Description Returns the transmit status of serial comm unication. For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 25 __BasicStopSerialReceiving Synopsis <S top reception> Boolean Rapi_B asicS topSerialReceiving(unsigned long da t a) data Setup data Description S tops receiving data in serial communication [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 26 __BasicStopSerialSending Synopsis <S top transmission> Boolean __Bas icSt opSerialSending(uns igned long da t a) data Setup data Description S tops transmitting data in serial communication. [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 27 __OpenSerialDriver Synopsis <Open a serial port> Boolean __OpenSeria lDriver(unsigned long da ta) data Setup data Description Opens and initializes a specifi ed seri al port. [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 28 __CloseSerialDriver Synopsis <Close a serial port> Boolean __Clos eSerialDriver(unsigne d long data) data Setup data Description Closes a specif ied serial port. [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 29 __ConfigSerialDriverNotify Synopsis <Register a notifi cation function> Boolean __ConfigSerialDriv erNotify(unsigned lo ng data, V oidFuncNoti fy *func).
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 30 Return value If the serial port specification is inco rr ect, RAPI_F ALSE is returned; otherwise, RAPI_TRUE is returned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 31 __SetSerialFormat Synopsis <Set serial communication> Boolean __SetSeria lFormat(unsigned long dat a1, unsigned char da ta 2) data1 Setup data 1 data2 Setup data 2 Description Sets serial communication according to spec ified parameters.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 32 __SetSerialInterrupt Synopsis < Set serial inte rrupts> 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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 33 Functionality Serial I/O Reference Remark • If an undefined value is specified in the ar gument, operation of the API cann ot be guaranteed.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 34 __St artSerialReceiving Synopsis <S tart reception> Boolean __S tartSerialReceiv i ng(unsigned long da ta, unsigned char wordNum, unsigned int *Rcv DtBu.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 35 __St artSerialSending Synopsis <S tart transmission> Boolean __S tartSerialSending(unsigne d long dat a, unsigned char w ordNum, unsigned int *SndDtBuf).
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 36 __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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 37 __StopSerialSending Synopsis <S top transmission> Boolean __S topSerialSending(unsigned long data) data Setup data Description S tops transmission of serial communicatio n. [data] For data, the following values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 38 __PollingSerialReceiving Synopsis <Polling reception> Boolean __PollingSerialRecei ving(unsigned lon g data ) data Setup data Description Performs reception of serial communicatio n by polling. This API gets received data by an amount specified by __St a rtSerialReceivi ng.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 39 __PollingSerialSending Synopsis <Polling transmission> Boolean __PollingSerialSe nding(unsigne d long data) data Setup data Description Performs transmission of serial communicati on by polling.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 40 4.2.2 Timer __CreateTimer Synopsis <Set timer mode> Boolean __Cre ateT imer(unsigned long dat a1, unsigned int dat a2, unsigned int dat a3, unsigned int.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 41 (Count sou rce) S pecify one from { RAPI_ F1, RAPI_F2, RAPI_F8, RAPI_F32, RAPI_FC32 }. The default value is RAPI_F2. (Operating states set) Specify one from { RAPI_TIMER_ON, RAPI_TI MER_OFF }. The default value is RAPI_TIMER_OFF .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 42 __EnableTimer Synopsis <Control o peration of timer mode> Boolean __EnableT imer(unsigned long dat a) data Setup data Description Controls operation of the tim er that is se t to specified timer mode by starting or stopping it.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 43 __DestroyTimer Synopsis <Discard settings of timer mode> Boolean __DestroyT imer(unsigned long dat a) data Setup data Description Discards settings of the timer that is set to specified timer mode. [data] For data, the following definition values can be set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 44 __CreateEventCounter Synopsis <Set event counter mode> Boolean __Cre ateEventCounter(unsigne d long data 1, unsigned int data2, unsigned int data3, unsi.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 45 RAPI_UP_COUNT Selects up-count for the count operation. RAPI_DOWN_COUNT Selects down-count for the count operation. RAPI_UDF_REGISTER Selects the UDF register for the cause of up/down switching. RAPI_T AIOUT Selects the input signal at T A iOU T pin for the cause of up/do wn switching.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 46 [data4] Specify 0. Return value If the timer specification is incorrect, R API_F ALSE is returned; other wise, RAPI_TRUE is returned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 47 __EnableEventCounter Synopsis <Control operation of event counter mode> Boolean __Enable E ventCounter(uns igned long data) data Setup data Description Controls operation of the timer that is set to specified timer mode b y starting or stopping it.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 48 __DestroyEventCounter Synopsis <Discard settings of event counter mode> Boolean __Des troyEventCounter(unsigne d long data ) data Setup data Description Discards settings of the timer that is set to specified timer mode.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 49 __GetEventCounter Synopsis <Get event counter mode counter value> Boolean __GetEv entCounter(unsigned long da ta 1, unsigned int *dat a2) data1 Setup da.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 50 __CreatePulseWid thMo dulationMode Synopsis <Set pulse width modulation mode> Boolean __Cre atePuls eWid thModulationMode(unsig ned long dat a1, unsigne.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 51 RAPI_F ALLING Select s 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) S pecify one from { RAPI_F1, R API_F2, RAPI_F32, RAPI_FC32 }.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 52 void func( void ) { unsigned int p_tim[] = {0xAA, 0xBB, 0xCC}; /* Set up timer A3 as pulse width modulation mode */ __CreatePulseWidthModulationMode( RAPI_TIM.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 53 __EnablePulseWid thModulationMode Synopsis <Control operation of puls e width modulation mode> Boolean __Enable PulseWidthMod ulationMode(unsigned long .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 54 __DestroyPulseWid thModulationMode Synopsis <Discard settings of pulse width modulation mode> Boolean __Des troyPulseWid thModulationMode(unsig ned long data ) data Setup data Description Discards settings of the timer that is set to specified pulse width modulation mode.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 55 __CreatePulsePeriodMeasurementMode Synopsis < Set pulse period measurement mode> Boolean __CreatePul sePeriodMeasu rem entMode(unsigned lon g data1, uns.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 56 [data3] S pecify 0. [data4] S pecify 0. Return value If the timer specification is incorrect , RAPI_F ALSE is returned; otherwise, RAPI_TRUE is returned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 57 __EnablePulsePeriodMeasurementMode Synopsis <Control operation of pulse pe riod me asurement mode> Boolean __EnablePu lsePeriodMeasurem entMode(unsigned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 58 __DestroyPulsePeriodMeasurementMode Synopsis <Discard settings of pulse period meas ureme nt mode> Boolean __Destro yPulsePeriodMeasuremen tMo d e(unsigned long data) data Setup data Description Discards settings of the timer that is set to specified pulse period measure ment mode.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 59 __GetPulsePeriodMeasurementMode Synopsis <Get measured value in pulse peri od measurement mode> Boolean __GetPulsePeriod MeasurementM od e(unsigned long.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 60 __CreatePulseWid thMea surementMode Synopsis <Set pulse width measurement mode> Boolean __CreatePul seWidthMeasurementMode(unsigned long dat a1 , unsign.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 61 [data4] S pecify 0. Return value If the timer specification is incorrect, R API_F ALSE is returned; otherwise, RAPI_TRUE is returned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 62 __EnablePulseWid thMeasurementMode Synopsis <Control operation of pulse width measurement mode> Boolean __Enab l ePu lseWidthMeasurementMode(unsig ned long data) data Setup data Description Controls operation of the timer that is se t to specified pulse width measurement mode.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 63 __DestroyPulseWid thMeasurement Mode Synopsis <Discard settings of pulse width measurement mode> Boolean __Destro yPulseWidthMeasurementMode(un sign ed long data) data Setup data Description Discards settings of the timer that is set to specified pulse width measurement mode.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 64 __GetPulseWid thMeasurementMode Synopsis <Get measured value in pulse width measurement mode> Boolean __GetPulseWidthMeasurementMode(u nsign ed long d a.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 65 __SetTimerRegister Synopsis <Set timer register> Boolean __SetT imerRegister(unsigned long dat a1, unsigned int *dat a2) data1 Setup data 1 data2 Pointer to the buffer in which register value is stored Description Sets the registers of a specified timer .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 66 If an undefined value is specified in the first argum ent, operation of the API cannot be guaranteed. • The specifiable timers differ with each CPU used.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 67 __EnableTimerRegister Synopsis <Control operation of timer register> Boolean __Enable TimerRegister(uns igned long data ) data Setup data Description Controls operation of a spec ified timer by starting or stopping it.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 68 __ClearTimerRegister Synopsis <Clear timer register> Boolean __Cle arTime rRegister(unsigned long dat a) data Setup data Description Sets the timer register of a specified timer to its initial value after reset.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 69 __GetTimerRegister Synopsis <Get timer register value> Boolean __GetT imerRegister(unsigned long dat a1, unsigned int *dat a2) data1 Setup data data2 Pointer to the buffer in which register value is stored Description Gets the counter value of a specified timer .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 70 Reference __SetT imerRegister , __EnableTimerRegister , __ClearTimerRegister Remark • If an undefined value is specified i n the first argument, operation of the AP I cannot be guaranteed. Program example #include " rapi_timer_m16c_62p.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 71 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 data2 Setup data 2 Description Sets the operating conditions of a specified I/O port.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 72 RAPI_PORT_7_2 Port P7 2 RAPI_PORT_7_3 Port P7 3 RAPI_PORT_7_4 Port P7 4 RAPI_PORT_7_5 Port P7 5 RAPI_PORT_7_6 Port P7 6 RAPI_PORT_7_7 Port P7 7 RAPI_PORT_8_0 .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 73 Functionality I/O port Reference __ReadIOPort , __WriteIOPort , __SetIOPortRegister , __ReadIOPortRegister , __WriteIOPortRegister Remark • If an undefined value is specified i n the first argument, operation of the API cannot be guaranteed.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 74 __ReadIOPort Synopsis <Read from I/O port> Boolean __Rea dIOPort(unsigned long da ta1, unsigned int *data2) data1 Setup data 1 data2 Pointer to the variable in which the value read from I/O port is stored.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 75 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_P.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 76 __WriteIOPort Synopsis <Write to I/ O port> Boolean __W riteIOPort(unsigned long dat a1, unsigned int da t a2) data1 Setup data 1 data2 Data to be written to I/O port Description Writes data to a specified I/O port.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 77 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_P.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 78 __SetIOPortRegister Synop sis <Set I/O port register> Boolean __Set IOPortRegiste r(unsigne d l ong da t a1, unsigned int da t a2, unsigned int dat a3, .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 79 If an undefined value is specified in the first argum ent, operation of the API cannot be guaranteed. Program example #include " rapi_io_port_m16c_62p.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 80 __ReadIOPortRegister Synopsis <Read from I/O port register> Boolean __ReadIOPortRegi ster(unsigned long data 1, unsigned int *dat a2) data1 Setup data 1 data2 Pointer to the var iable in which the val ue read from I/O port register i s stored.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 81 __WriteIOPortRegister Synopsis <Write to I/O port register> Boolean __W riteIOPortRegister(unsigned long dat a1, unsigned int dat a2) data1 Setup dat a 1 data2 Dat a to be written to I/O port register Description Writes the value for a specified I/O port to eac h relevant register .
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 82 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 data2 Setup data 2 func Callback function pointer (S pecify 0 if no callback functions are set.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 83 Return value If the external interrupt specification is inc orrect, RAPI_F ALSE is returned; other wise, RAPI_TRUE is returned.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 84 __EnableInterrupt Synopsis <Control external interrupt> Boolean __Enable Interrupt(unsigned long dat a1, unsigned int dat a2) data1 Setup data 1 data2 Setup data 2 Description Changes the operating conditi on of a specified external interrupt.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 85 __GetInterruptFlag Synopsis <Get the status of external interrupt flag> Boolean __GetInterruptFlag (unsigned long dat a1, unsigned int *dat a2)) data1 S.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 86 __ClearInterruptFlag Synopsis <Clear external interrupt flag> Boolean __Cle arInterruptFlag(unsigne d long data ) data Setup data Description Clears the interrupt request flag of a specified exter nal interrupt.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 87 4.2.5 A/D converter __CreateADC Synopsis <Set A/D converter> Boolean __Cre ateADC(unsigned l ong data1 , unsigned int dat a2, unsigned int dat a3, void*.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 88 RAPI_AN27 Uses AN 27 pin for the analog input pin. RAPI_P0_GROUP Uses port P 0 group for the analog input pin. RAPI_P10_GROUP Uses port P 10 group for the analog input pin. RAPI_P2_GROUP Uses port P 2 group for the analog input pin.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 89 (Input pin) S pecify one from { RA PI_AN0, RAPI_AN1, RAPI_AN2, R API_AN3, RAPI_AN4, RAPI_AN5, R API_AN6, RAPI_AN7, RAP I_AN00, R API_AN01, RA PI_AN02, RAPI_AN.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 90 (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 is RAPI_WITHOUT_SAMPLE_HOLD.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 91 Remark • If an undefined value is spec ified in th e fi rst ar gument, operat ion of the API cannot be guaranteed.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 92 __EnableADC Synopsis <Control operation of A/D converter> Boolean __EnableA DC (unsigned long dat a1, unsigned int dat a2) data1 Setup data 1 data2 Number of analog input pins used by A/D converter Description Controls operation of the A/D conv erter by starting or stopping it.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 93 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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 94 Program example #include "rapi_ad_ m16 c_62p.h" void func( void ) { /* Disable A/D converter */ __EnableADC( RAPI_AN0|RAPI_AD_OFF, 1 ); }.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 95 __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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 96 __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 data2 Pointer to the buffer in which A/D converted value is stored.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 97 __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.
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 98 M16C/62P Group Renesas Embedded Application Programming Interface Reference Manual Rev . 1.00 Issued: November 2007.
Een belangrijk punt na aankoop van elk apparaat Renesas M16C/62P Group (of zelfs voordat je het koopt) is om de handleiding te lezen. Dit moeten wij doen vanwege een paar simpele redenen:
Als u nog geen Renesas M16C/62P Group heb gekocht dan nu is een goed moment om kennis te maken met de basisgegevens van het product. Eerst kijk dan naar de eerste pagina\'s van de handleiding, die je hierboven vindt. Je moet daar de belangrijkste technische gegevens Renesas M16C/62P Group vinden. Op dit manier kan je controleren of het apparaat aan jouw behoeften voldoet. Op de volgende pagina's van de handleiding Renesas M16C/62P Group leer je over alle kenmerken van het product en krijg je informatie over de werking. De informatie die je over Renesas M16C/62P Group krijgt, zal je zeker helpen om een besluit over de aankoop te nemen.
In een situatie waarin je al een beziter van Renesas M16C/62P Group bent, maar toch heb je de instructies niet gelezen, moet je het doen voor de hierboven beschreven redenen. Je zult dan weten of je goed de alle beschikbare functies heb gebruikt, en of je fouten heb gemaakt die het leven van de Renesas M16C/62P Group kunnen verkorten.
Maar de belangrijkste taak van de handleiding is om de gebruiker bij het oplossen van problemen te helpen met Renesas M16C/62P Group . Bijna altijd, zal je daar het vinden Troubleshooting met de meest voorkomende storingen en defecten #MANUAl# samen met de instructies over hun opplosinge. Zelfs als je zelf niet kan om het probleem op te lossen, zal de instructie je de weg wijzen naar verdere andere procedure, bijv. door contact met de klantenservice of het dichtstbijzijnde servicecentrum.