Renesas M16C/62P Group инструкция обслуживания

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98

Идти на страницу of

Хорошее руководство по эксплуатации

Законодательство обязывает продавца передать покупателю, вместе с товаром, руководство по эксплуатации Renesas M16C/62P Group. Отсутствие инструкции либо неправильная информация, переданная потребителю, составляют основание для рекламации в связи с несоответствием устройства с договором. В законодательстве допускается предоставлении руководства в другой, чем бумажная форме, что, в последнее время, часто используется, предоставляя графическую или электронную форму инструкции Renesas M16C/62P Group или обучающее видео для пользователей. Условием остается четкая и понятная форма.

Что такое руководство?

Слово происходит от латинского "instructio", тоесть привести в порядок. Следовательно в инструкции Renesas M16C/62P Group можно найти описание этапов поведения. Цель инструкции заключается в облегчении запуска, использования оборудования либо выполнения определенной деятельности. Инструкция является набором информации о предмете/услуге, подсказкой.

К сожалению немного пользователей находит время для чтения инструкций Renesas M16C/62P Group, и хорошая инструкция позволяет не только узнать ряд дополнительных функций приобретенного устройства, но и позволяет избежать возникновения большинства поломок.

Из чего должно состоять идеальное руководство по эксплуатации?

Прежде всего в инструкции Renesas M16C/62P Group должна находится:
- информация относительно технических данных устройства Renesas M16C/62P Group
- название производителя и год производства оборудования Renesas M16C/62P Group
- правила обслуживания, настройки и ухода за оборудованием Renesas M16C/62P Group
- знаки безопасности и сертификаты, подтверждающие соответствие стандартам

Почему мы не читаем инструкций?

Как правило из-за нехватки времени и уверенности в отдельных функциональностях приобретенных устройств. К сожалению само подсоединение и запуск Renesas M16C/62P Group это слишком мало. Инструкция заключает ряд отдельных указаний, касающихся функциональности, принципов безопасности, способов ухода (даже то, какие средства стоит использовать), возможных поломок Renesas M16C/62P Group и способов решения проблем, возникающих во время использования. И наконец то, в инструкции можно найти адресные данные сайта Renesas, в случае отсутствия эффективности предлагаемых решений. Сейчас очень большой популярностью пользуются инструкции в форме интересных анимаций или видео материалов, которое лучше, чем брошюра воспринимаются пользователем. Такой вид инструкции позволяет пользователю просмотреть весь фильм, не пропуская спецификацию и сложные технические описания Renesas M16C/62P Group, как это часто бывает в случае бумажной версии.

Почему стоит читать инструкции?

Прежде всего здесь мы найдем ответы касательно конструкции, возможностей устройства Renesas M16C/62P Group, использования отдельных аксессуаров и ряд информации, позволяющей вполне использовать все функции и упрощения.

После удачной покупки оборудования/устройства стоит посвятить несколько минут для ознакомления с каждой частью инструкции Renesas M16C/62P Group. Сейчас их старательно готовят или переводят, чтобы они были не только понятными для пользователя, но и чтобы выполняли свою основную информационно-поддерживающую функцию.

Содержание руководства

  • Страница 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[...]

  • Страница 2

    Rev .1.00 2007.1 1.1 REC10 B0002-0 100 2 Renesas Embedded Application Programming Interface Reference Manual <M16C/62P Group>[...]

  • Страница 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 ......................[...]

  • Страница 4

    Rev .1.00 2007.1 1.1 REC10 B0002-0 100 4 __DestroyT imer .......................................................... 43 __CreateEven tCounter ..................................................... 44 __EnableEve ntCounter ..................................................... 47 __DestroyEventC ounter ..................................................[...]

  • Страница 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.[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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.[...]

  • Страница 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.[...]

  • Страница 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 .[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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/[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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 [...]

  • Страница 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); }[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 */ _[...]

  • Страница 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 [...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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 [...]

  • Страница 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 ); }[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 ); }[...]

  • Страница 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[...]

  • Страница 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[...]

  • Страница 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 [...]

  • Страница 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[...]