Renesas M16C/62P Group manual
- Consulta online o descarga el manual de instrucciones
- 98 páginas
- 0.51 mb
Ir a la página of
manuales de instrucciones parecidos
-
Computer Hardware
Renesas H8S/2655 Series
20 páginas 0.37 mb -
Computer Hardware
Renesas RSKH836079
4 páginas 0.23 mb -
Computer Hardware
Renesas H8/3834 Series
19 páginas 0.44 mb -
Computer Hardware
Renesas H8/3257 Series
18 páginas 0.33 mb -
Computer Hardware
Renesas SH7085
48 páginas 0.42 mb -
Computer Hardware
Renesas M3T-F160-64NSA
4 páginas 0.66 mb -
Computer Hardware
Renesas H8/3001
20 páginas 0.41 mb -
Computer Hardware
Renesas M3T-42DIP-DMS
3 páginas 0.06 mb
Buen manual de instrucciones
Las leyes obligan al vendedor a entregarle al comprador, junto con el producto, el manual de instrucciones Renesas M16C/62P Group. La falta del manual o facilitar información incorrecta al consumidor constituyen una base de reclamación por no estar de acuerdo el producto con el contrato. Según la ley, está permitido adjuntar un manual de otra forma que no sea en papel, lo cual últimamente es bastante común y los fabricantes nos facilitan un manual gráfico, su versión electrónica Renesas M16C/62P Group o vídeos de instrucciones para usuarios. La condición es que tenga una forma legible y entendible.
¿Qué es un manual de instrucciones?
El nombre proviene de la palabra latina “instructio”, es decir, ordenar. Por lo tanto, en un manual Renesas M16C/62P Group se puede encontrar la descripción de las etapas de actuación. El propósito de un manual es enseñar, facilitar el encendido o el uso de un dispositivo o la realización de acciones concretas. Un manual de instrucciones también es una fuente de información acerca de un objeto o un servicio, es una pista.
Desafortunadamente pocos usuarios destinan su tiempo a leer manuales Renesas M16C/62P Group, sin embargo, un buen manual nos permite, no solo conocer una cantidad de funcionalidades adicionales del dispositivo comprado, sino también evitar la mayoría de fallos.
Entonces, ¿qué debe contener el manual de instrucciones perfecto?
Sobre todo, un manual de instrucciones Renesas M16C/62P Group debe contener:
- información acerca de las especificaciones técnicas del dispositivo Renesas M16C/62P Group
- nombre de fabricante y año de fabricación del dispositivo Renesas M16C/62P Group
- condiciones de uso, configuración y mantenimiento del dispositivo Renesas M16C/62P Group
- marcas de seguridad y certificados que confirmen su concordancia con determinadas normativas
¿Por qué no leemos los manuales de instrucciones?
Normalmente es por la falta de tiempo y seguridad acerca de las funcionalidades determinadas de los dispositivos comprados. Desafortunadamente la conexión y el encendido de Renesas M16C/62P Group no es suficiente. El manual de instrucciones siempre contiene una serie de indicaciones acerca de determinadas funcionalidades, normas de seguridad, consejos de mantenimiento (incluso qué productos usar), fallos eventuales de Renesas M16C/62P Group y maneras de solucionar los problemas que puedan ocurrir durante su uso. Al final, en un manual se pueden encontrar los detalles de servicio técnico Renesas en caso de que las soluciones propuestas no hayan funcionado. Actualmente gozan de éxito manuales de instrucciones en forma de animaciones interesantes o vídeo manuales que llegan al usuario mucho mejor que en forma de un folleto. Este tipo de manual ayuda a que el usuario vea el vídeo entero sin saltarse las especificaciones y las descripciones técnicas complicadas de Renesas M16C/62P Group, como se suele hacer teniendo una versión en papel.
¿Por qué vale la pena leer los manuales de instrucciones?
Sobre todo es en ellos donde encontraremos las respuestas acerca de la construcción, las posibilidades del dispositivo Renesas M16C/62P Group, el uso de determinados accesorios y una serie de informaciones que permiten aprovechar completamente sus funciones y comodidades.
Tras una compra exitosa de un equipo o un dispositivo, vale la pena dedicar un momento para familiarizarse con cada parte del manual Renesas M16C/62P Group. Actualmente se preparan y traducen con dedicación, para que no solo sean comprensibles para los usuarios, sino que también cumplan su función básica de información y ayuda.
Índice de manuales de instrucciones
-
Página 1
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 .1, 2007[...]
-
Página 2
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 2 Renesas Embedded Application Programming Interface Reference Manual <M16C/62P Group>[...]
-
Página 3
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 ....................................................................... 6 2.1 Overview ......................[...]
-
Página 4
Rev .1.00 2007.1 1.1 REC10 B0002-0 100 4 __DestroyT imer .......................................................... 43 __CreateEven tCounter ..................................................... 44 __EnableEve ntCounter ..................................................... 47 __DestroyEventC ounter ..................................................[...]
-
Página 5
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.[...]
-
Página 6
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. 2.2 Driver Features The library described herein has the following features av[...]
-
Página 7
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. There are two kinds of serial in terface driver: a single-data transm ission/recept ion API and a multi-data transmission/reception [...]
-
Página 8
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 following mod es: • Timer mode • Event counter mode • Pulse width modulation mode (PWM mode) • Pulse period m easurement mode • Pulse width measur[...]
-
Página 9
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.[...]
-
Página 10
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.[...]
-
Página 11
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 .[...]
-
Página 12
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. St andard type Description Boolean The Boolean type represents the enum-type data that indic ates whether successful (R API_TRUE (= 1)) or failed (R[...]
-
Página 13
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 . NO Facility classification API A PI operation 1 __BasicOpenSerialDriver Opens serial port 2 __BasicCloseSerial Driver Closes serial port 3 __BasicSetSerialFormat Sets [...]
-
Página 14
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 mode 37 __DestroyPulseWidthMeasurementMode Clears s etting of pulse width measurement mode 38 __GetPulseWidthMeasurementMode Acquir es meas ured value[...]
-
Página 15
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. It also shows the syntax of the fun[...]
-
Página 16
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM[...]
-
Página 17
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/O4 Return[...]
-
Página 18
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. [data1] For data1, the following values can be set. T [...]
-
Página 19
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. If the[...]
-
Página 20
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. Program example #include ”rapi_sif_m16c_62[...]
-
Página 21
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 S[...]
-
Página 22
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. For dat a1, the following values can be set. RAPI_COM1 UART0 RAPI_COM2 U[...]
-
Página 23
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. [data] For data, the following values can be set. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2[...]
-
Página 24
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 [...]
-
Página 25
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 Return value I[...]
-
Página 26
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 Return value [...]
-
Página 27
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/[...]
-
Página 28
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM4 SI/O3 RAPI_COM5 SI/O4 Return val[...]
-
Página 29
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) data Setup data func Function pointer to be registered Description Regist ers the notification f unction necessary to get various transmit/rece ive i[...]
-
Página 30
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. Functionality Serial I/O Reference __S tartSerialReceiving , __S tartSerialSending Remark • If an undefined value is specified in the fi rst argument, operation of the API cannot be gua[...]
-
Página 31
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. For details about parameters, refer to the description of __Basi[...]
-
Página 32
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 RAPI_COM[...]
-
Página 33
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. Program example #include ”rapi_sif_m16c_62p” Boolean func( void ) { /* Set interrupt of RAPI_COM1 to serial driver */ return __SetSerialInterrupt( RAPI_COM1 | RA[...]
-
Página 34
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 DtBuf) data Setup data wordNum Number of words received RcvDtBuf Pointer to the buffer in which received data is stored Description S tarts reception of s[...]
-
Página 35
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) data Setup data wordNum Number of words transmitted SndDtBuf Pointer to the transmit data Description S tarts transmission of serial communication an[...]
-
Página 36
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. RAPI_COM1 UART0 RAPI_COM2 UAR T1 RAPI_COM3 UART2 Return value If reception of se[...]
-
Página 37
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. RAPI_COM1 UART0 RAPI_COM2 UART1 RAPI_COM3 UART2 Return value If transmission of[...]
-
Página 38
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. When ac quisition of receiv[...]
-
Página 39
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. This API sends transmit data by an amount specified by __St artSerialS ending from the transmit data buffer[...]
-
Página 40
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 dat a4, void* func) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer (S pecify 0 if no call[...]
-
Página 41
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 . (Pulse output state) S pecify one from { RAPI_PULSE_ON, RAPI_PULSE_OFF }. The[...]
-
Página 42
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. [data] For data, the following definition values can b e set. T o set mult[...]
-
Página 43
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. RAPI_TIMER_A0 Selects timer A channel 0. RA[...]
-
Página 44
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, unsigne d int data4, void* fu nc) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func Callback function pointer (S pecify 0 i[...]
-
Página 45
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. RAPI_RISING Selects t[...]
-
Página 46
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. Functionality T imer (event counter mode) Reference __EnableEventCounter , __DestroyEventCounter , __GetEve ntCounter Remark • If an undefined value is specified i n the fi[...]
-
Página 47
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. [data] For data, the following definition values can [...]
-
Página 48
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. [data] For data, the following definition values can be set. RAPI_TIMER_A0 Select[...]
-
Página 49
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 data 1 data2 Pointer to the buffer in which counter value is stored Description Gets the counter value of the timer that is set to specified event count[...]
-
Página 50
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, unsigned int dat a2, unsigned int* dat a3, void* dat a4) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 func Callback function pointer (S pecify 0 [...]
-
Página 51
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 }. The default value is RAPI_F2. (Operating states [...]
-
Página 52
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_TIMER_A3|RAPI_TIMER_ON|RAPI_F8, 5, p_tim, TimerIntFunc); }[...]
-
Página 53
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 da t a) data Setup data Description Controls operation of the time r that is se t to specified pulse width modulation mode b y starting or stopping it[...]
-
Página 54
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. [data] For data, the followin[...]
-
Página 55
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, unsigned int data2, unsigne d int data3, u nsigned int dat a4, void* func) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 fu[...]
-
Página 56
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. Functionality Timer (pulse period measurement mode) Reference __EnablePu lsePeriodMeasurementMode , __DestroyPulsePeriodMeas urementMode , __GetPulsePerio[...]
-
Página 57
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 lon g dat a) data Setup data Description Controls operation of the timer that is set to specified pulse period measur ement mode by starting or stopp[...]
-
Página 58
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. [data] For data, th[...]
-
Página 59
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 d ata1, unsigned int *data2) data1 Setup data 1 data2 Pointer to the buffer in which counter value is stored Description Gets the counter value of th[...]
-
Página 60
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 , unsigned int dat a2, unsigned int dat a3, unsigned int da t a4, void* func) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 func[...]
-
Página 61
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. Functionality T imer (pulse width measurement mode) Reference __EnablePulseWidthMeasurementMod e , __DestroyPulseW idthMeasurementMode , __GetPulseWidthMeasurementMode Remark[...]
-
Página 62
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. [data] For data, the fol[...]
-
Página 63
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. [data] For data, the foll[...]
-
Página 64
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 ata1, unsigned int *data2) data1 Setup data 1 data2 Pointer to the buffer in which counter value is stored Description Gets the counter value of the ti[...]
-
Página 65
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 . [data1] For data, the following definition val[...]
-
Página 66
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. Program example #include " rapi_timer_m16c_62p.h" void func( void ) { unsigned char data[] = {0,0,0,0,0,0,0}; /* Set up timer A0 register */ _[...]
-
Página 67
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. [data] For data, the following definition values can be set. T o set multiple defi [...]
-
Página 68
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. [data] For data, the following definition values can be set. RAPI_TIMER_A0 Selects timer A[...]
-
Página 69
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 . [data] For data, the following definit[...]
-
Página 70
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.h" void func( void ) { unsigned int data[7]; /* Get the valu[...]
-
Página 71
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. [data1] For data1, the following definition values can be set. T o set multiple de[...]
-
Página 72
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 Port P8 0 RAPI_PORT_8_1 Port P8 1 RAPI_PORT_8_2 Port P8 2 RAPI_PORT_8_3 Port P8 3 RAPI_PORT_8_4 Port P8 4 RAPI_PORT_8_5 Port P8 5 RAPI_PORT_8_6 Port P[...]
-
Página 73
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. Program example #include " rapi_io_port_m16c_62p.h" vo[...]
-
Página 74
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. Description Gets the value of a specified I/O port. [data1] S pecify an I/O port from which data[...]
-
Página 75
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_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 RAPI_PORT_1 1_0 Port P1 1 0 RAPI_PORT_1 1 _1 Port P1[...]
-
Página 76
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. [data1] S pecify an I/O port to which data is written. The definition values correspon[...]
-
Página 77
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_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 RAPI_PORT_1 1_0 Port P1 1 0 RAPI_PORT_1 1_1 Port P1 [...]
-
Página 78
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, unsigned int dat a4) data1 Setup data 1 data2 Setup data 2 data3 Setup data 3 data4 Setup data 4 Description [dat a1] Set the operating cond ition of [...]
-
Página 79
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.h" void func( void ) { /* Set inputs/outputs of port P1 register */ __SetIOPortRegister(RAPI_PORT_1, 0xAA, 0, 0 ); }[...]
-
Página 80
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. Description Gets the value of a specified I/O port from ea[...]
-
Página 81
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 . [data1] S pecify a[...]
-
Página 82
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.) Description Sets a specified exte[...]
-
Página 83
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. Functionality External interrupt Reference __EnableInterrupt , __GetInterruptFlag , __ClearInterruptFlag Remark • If an undefined value is specified in the first argum ent, opera[...]
-
Página 84
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. [data1] RAPI_INT0 Uses _INT0 interrupt. RAPI_INT1 Uses _IN[...]
-
Página 85
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 Setup data 1 data2 Pointer to the buffer in which the acquired flag data is stored Description Gets the value of interrupt request fl ag of a specified[...]
-
Página 86
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. [data] RAPI_INT0 Uses _INT0 interrupt. RAPI_INT1 Uses _INT1 interrupt. RAPI_INT2 Uses _INT[...]
-
Página 87
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* func) data1 Setup data 1 data2 Number of analog input pins used by A/D converter data3 Setup data 3 func Callback function pointer (Specify 0 if no c[...]
-
Página 88
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. RAPI_F AD Sets the AD converter ’s operating frequency to f AD . RAPI_F A[...]
-
Página 89
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 03, RAPI_AN04, RA PI_AN05, R API_AN06 , RAPI_AN 07, RAPI_AN20, RAPI_AN 21, RAPI_AN22, RA PI_AN23, R API_AN24 , RAPI_AN 25, RAPI_AN26, RAPI_AN27, RAPI[...]
-
Página 90
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. (T ri gger) S pecify one from { RAPI_S OFTWARE_TRIGGER, RAPI_EX[...]
-
Página 91
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. Program example #include " rapi_ad_ m16 c_62p.h" void AdIntFunc( void ){} void func( void ) { /* Set up A/D converter as one short mode */ __CreateADC( RAPI_ONE_SHOT|RAPI_AN2|RAPI_F[...]
-
Página 92
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. [data1] RAPI_AN0 Uses A[...]
-
Página 93
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. RAPI_AN23 Uses AN 23 pin for the analog input pin. Selectable only when one-shot mode or[...]
-
Página 94
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 ); }[...]
-
Página 95
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. Functionality A/D converter Refer[...]
-
Página 96
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. Description Gets the A/D converted value fr om a specified A/D register . For data1, t[...]
-
Página 97
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. The A/D registers from which A/D convert ed values are acquired [...]
-
Página 98
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[...]