Renesas RJJ10J1643-0101 Manual de usuario

Busca en linea o descarga Manual de usuario para Redes Renesas RJJ10J1643-0101. Renesas Embedded Application Programming Manual de usuario

  • Descarga
  • Añadir a mis manuales
  • Imprimir

Indice de contenidos

Pagina 1 - Reference manual

www.renesas.comREJ10J1502-0101Renesas Embedded Application Programming InterfaceReference manualRev.1.01Feb 16, 2007

Pagina 2

Rev.1.01 2007.02.16 RJJ10J1643-0101 10 2.2 Driver Features The library described herein has the following features available as a peripheral driver

Pagina 3

Rev.1.01 2007.02.16 RJJ10J1643-0101 100Return value If the timer specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI_TRUE is retu

Pagina 4

Rev.1.01 2007.02.16 RJJ10J1643-0101 101 __DestroyPulseWidthMeasurementMode Synopsis <Discard settings of pulse width measurement mode> Bo

Pagina 5 - Table of Contents

Rev.1.01 2007.02.16 RJJ10J1643-0101 102Program example #include "rapi_timer_r8c_13.h" void func( void ) { /* Destroy the setting

Pagina 6

Rev.1.01 2007.02.16 RJJ10J1643-0101 103 __GetPulseWidthMeasurementMode Synopsis <Get measured value in pulse width measurement mode> Bool

Pagina 7

Rev.1.01 2007.02.16 RJJ10J1643-0101 104 [0]: The value of timer RA prescaler register is stored. [1]: The value of timer RA register is stored.

Pagina 8 - 1. Introduction

Rev.1.01 2007.02.16 RJJ10J1643-0101 105 __CreateInputCapture Synopsis <Set input capture mode> Boolean __CreateInputCapture(unsigned long

Pagina 9 - 2. Driver

Rev.1.01 2007.02.16 RJJ10J1643-0101 106 RAPI_FALLING Selects the falling edge of measurement pulse as active edge. RAPI_BOTH Selects both risi

Pagina 10

Rev.1.01 2007.02.16 RJJ10J1643-0101 107 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW. If input capture A, inpu

Pagina 11 - 2.3 Serial Interface Driver

Rev.1.01 2007.02.16 RJJ10J1643-0101 108 RAPI_TRD_F4 Timer RD counts with internal clockφ/4. RAPI_TRD_F8 Timer RD counts with internal clock φ/8.

Pagina 12

Rev.1.01 2007.02.16 RJJ10J1643-0101 109 (Counter clear) To specify GRA, GRB, GRC, or GRD input capture for the cause for which the counter is clea

Pagina 13 - 2.4.7 Output Compare Mode

Rev.1.01 2007.02.16 RJJ10J1643-0101 112.3 Serial Interface Driver The serial interface driver sets serial communication, clears settings, transmit/

Pagina 14 - 2.5 I/O Port Driver

Rev.1.01 2007.02.16 RJJ10J1643-0101 110 (Operating states set) Specify one from [RAPI_TIMER_ON, RAPI_TIMER_OFF]. The default is RAPI_TIMER_OFF.

Pagina 15

Rev.1.01 2007.02.16 RJJ10J1643-0101 111 [2]: Specify the set value for time measurement control register 2. [3]: Specify the set value for time

Pagina 16 - 2.7 A/D Converter Driver

Rev.1.01 2007.02.16 RJJ10J1643-0101 112 RAPI_TRD_RISING Selects the rising edge of measurement pulse as active edge. RAPI_TRD_FALLING Selects t

Pagina 17

Rev.1.01 2007.02.16 RJJ10J1643-0101 113 RAPI_CHANNEL1 Selects channel 1. RAPI_CHANNEL2 Selects channel 2. RAPI_CHANNEL3 Selects channel 3. R

Pagina 18 - 3. Standard Types

Rev.1.01 2007.02.16 RJJ10J1643-0101 114 void func( void ) { /* Set up timer C as imput capture mode */ __CreateInputCapture( RAPI_T

Pagina 19 - 4. Library Reference

Rev.1.01 2007.02.16 RJJ10J1643-0101 115 __EnableInputCapture Synopsis <Control operation of input capture mode> Boolean __EnableInputCaptu

Pagina 20

Rev.1.01 2007.02.16 RJJ10J1643-0101 116 • The specifiable timers differ with each CPU used. Program example #include "rapi_timer_r8c_13.h&q

Pagina 21

Rev.1.01 2007.02.16 RJJ10J1643-0101 117 __DestroyInputCapture Synopsis <Discard settings of input capture mode> Boolean __DestroyInputCap

Pagina 22

Rev.1.01 2007.02.16 RJJ10J1643-0101 118 void func( void ) { /* Destroy the setting of timer C as input capture mode */ __DestroyInputCaptur

Pagina 23

Rev.1.01 2007.02.16 RJJ10J1643-0101 119 __GetInputCapture Synopsis <Get input capture mode counter value> Boolean __GetInputCapture(unsign

Pagina 24

Rev.1.01 2007.02.16 RJJ10J1643-0101 122.4 Timer Driver The timer driver sets the timer, clears timer settings, controls timer operation, and acquir

Pagina 25

Rev.1.01 2007.02.16 RJJ10J1643-0101 120 • When timer RD is used (RAPI_TIMER_RD0- RAPI_TIMER_RD1 specified) [0]: Stores the value of timer count

Pagina 26

Rev.1.01 2007.02.16 RJJ10J1643-0101 121 __CreateOutputCompare Synopsis <Set output compare mode> Boolean __CreateOutputCompare(unsigned l

Pagina 27

Rev.1.01 2007.02.16 RJJ10J1643-0101 122 RAPI_TRD_F32 Selects f32 for the timer RD count source. RAPI_TRD_F40M Selects fOCO40M for the timer RD c

Pagina 28

Rev.1.01 2007.02.16 RJJ10J1643-0101 123 RAPI_UNCHANGE_0 Leaves CMP0 output unchanged even when matched in compare 0. RAPI_REVERSE_0 Inverts CM

Pagina 29

Rev.1.01 2007.02.16 RJJ10J1643-0101 124 (TC reload) To reload TC register, specify RAPID_RELOAD. If RAPID_RELOAD is not specified, “No reload” is

Pagina 30

Rev.1.01 2007.02.16 RJJ10J1643-0101 125 RAPI_TIMER_W Uses timer W. RAPI_TIMER_Z0 Uses timer Z channel 0. RAPI_TIMER_Z1 Uses timer Z channel

Pagina 31

Rev.1.01 2007.02.16 RJJ10J1643-0101 126 RAPI_COUNT_CLEAR_SYNC Clear counter in sync with the synchronized other timer counter RAPI_TIMER_SYNC Sy

Pagina 32

Rev.1.01 2007.02.16 RJJ10J1643-0101 127 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW. If compare match A, compar

Pagina 33

Rev.1.01 2007.02.16 RJJ10J1643-0101 128 (M16C) Specify a pointer to the array in which the set value for the waveform generation control registe

Pagina 34

Rev.1.01 2007.02.16 RJJ10J1643-0101 129 (Output mode) Specify one from { RAPI_SINGLE, RAPI_SR, RAPI_PHASE_DELAYED }. The default value is RAPI_SI

Pagina 35

Rev.1.01 2007.02.16 RJJ10J1643-0101 132.4.7 Output Compare Mode In this mode, the timer generates an interrupt request when the timer counter and a

Pagina 36

Rev.1.01 2007.02.16 RJJ10J1643-0101 130 [6]: Specify the comparison value of general register C in 16 bits. [7]: Specify the comparison value of

Pagina 37

Rev.1.01 2007.02.16 RJJ10J1643-0101 131 [1]: Specify a pointer to the callback function for IC/OC interrupt 0. If this pointer is not specifie

Pagina 38 - 0 0XX 0XXX

Rev.1.01 2007.02.16 RJJ10J1643-0101 132 #include "rapi_timer_r8c_13.h" void TimerIntFunc0( void ){} void TimerIntFunc1( void ){} voi

Pagina 39

Rev.1.01 2007.02.16 RJJ10J1643-0101 133 __EnableOutputCompare Synopsis <Control operation of output compare mode> Boolean __EnableOutputCo

Pagina 40

Rev.1.01 2007.02.16 RJJ10J1643-0101 134 guaranteed. • The specifiable timers differ with each CPU used. Program example #include "rapi_ti

Pagina 41

Rev.1.01 2007.02.16 RJJ10J1643-0101 135 __DestroyOutputCompare Synopsis <Discard settings of output compare mode> Boolean __DestroyOutputC

Pagina 42

Rev.1.01 2007.02.16 RJJ10J1643-0101 136 void func( void ) { /* Destroy the setting of timer C as output compare mode */ __DestroyOutputComp

Pagina 43

Rev.1.01 2007.02.16 RJJ10J1643-0101 137 __SetTimerRegister Synopsis <Set timer register> Boolean __SetTimerRegister(unsigned long data1,

Pagina 44

Rev.1.01 2007.02.16 RJJ10J1643-0101 138 [data2] The content of a pointer to the buffer in which the register value is stored must be specified as

Pagina 45

Rev.1.01 2007.02.16 RJJ10J1643-0101 139 [27]: Specify the set value for waveform generation register 4. [28]: Specify the set value for wave

Pagina 46

Rev.1.01 2007.02.16 RJJ10J1643-0101 142.5 I/O Port Driver The I/O port driver sets the I/O port for input or output, writes data to the I/O port, a

Pagina 47

Rev.1.01 2007.02.16 RJJ10J1643-0101 140 [1]: Specify the set value for the timer RB I/O control register. [2]: Specify the set value for the

Pagina 48

Rev.1.01 2007.02.16 RJJ10J1643-0101 141 [3]: Specify the set value for timer control register V0. [4]: Specify the set value for timer contr

Pagina 49

Rev.1.01 2007.02.16 RJJ10J1643-0101 142 [11]: Specify the set value for general register C. [12]: Specify the set value for general register

Pagina 50

Rev.1.01 2007.02.16 RJJ10J1643-0101 143 __EnableTimerRegister Synopsis <Control operation of timer register> Boolean __EnableTimerRegister

Pagina 51

Rev.1.01 2007.02.16 RJJ10J1643-0101 144 RAPI_TIMER_RD2 Selects timer RD channel 2. RAPI_TIMER_RD3 Selects timer RD channel 3. RAPI_TIMER_ON

Pagina 52

Rev.1.01 2007.02.16 RJJ10J1643-0101 145 __ClearTimerRegister Synopsis <Clear timer register> Boolean __ClearTimerRegister(unsigned long da

Pagina 53

Rev.1.01 2007.02.16 RJJ10J1643-0101 146Return value If the timer specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI_TRUE is retu

Pagina 54

Rev.1.01 2007.02.16 RJJ10J1643-0101 147 __GetTimerRegister Synopsis <Get timer register value> Boolean __GetTimerRegister(unsigned long da

Pagina 55

Rev.1.01 2007.02.16 RJJ10J1643-0101 148 [data2] Specify a pointer to the array in which the acquired register value is stored. The content of t

Pagina 56

Rev.1.01 2007.02.16 RJJ10J1643-0101 149 [26]: Store the value of time measurement register 3/waveform generation register 3. [27]: Store the val

Pagina 57

Rev.1.01 2007.02.16 RJJ10J1643-0101 152.6 External Interrupt Driver The external interrupt driver sets external interrupts, controls external inter

Pagina 58

Rev.1.01 2007.02.16 RJJ10J1643-0101 150 • When using timer RB (RAPI_TIMER_RB specified) [0]: Specify the set value for the timer RB one shot co

Pagina 59

Rev.1.01 2007.02.16 RJJ10J1643-0101 151 [1]: Store the value of time constant register A. [2]: Store the value of time constant register B. [3

Pagina 60

Rev.1.01 2007.02.16 RJJ10J1643-0101 152 [9]: Specify the set value for general register A. [10]: Specify the set value for general register B.

Pagina 61

Rev.1.01 2007.02.16 RJJ10J1643-0101 1534.2.3 I/O Port __SetIOPort Synopsis <Set I/O port> Boolean __SetIOPort(unsigned long data1, unsigne

Pagina 62

Rev.1.01 2007.02.16 RJJ10J1643-0101 154 RAPI_PORT_9_0 Port P90 RAPI_PORT_9_1 Port P91 RAPI_PORT_9_2 Port P92 RAPI_PORT_9_3 Port P93 RAPI_PORT_

Pagina 63

Rev.1.01 2007.02.16 RJJ10J1643-0101 155 RAPI_NOT_PULLED_HIGH Sets a selected port not to be pulled high. RAPI_DRIVE_CAPACITY_H Sets the N-channe

Pagina 64

Rev.1.01 2007.02.16 RJJ10J1643-0101 156 RAPI_PORT_D_6 PortPD6 RAPI_PORT_D_7 PortPD7 RAPI_PORT_E_0 PortPE0 RAPI_PORT_E_1 PortPE1 RAPI_PORT_E_2

Pagina 65

Rev.1.01 2007.02.16 RJJ10J1643-0101 157Program example #include " rapi_io_port_r8c_13.h void func( void ) { /* Set up port P03 as inp

Pagina 66

Rev.1.01 2007.02.16 RJJ10J1643-0101 158 __ReadIOPort Synopsis <Read from I/O port> Boolean __ReadIOPort(unsigned long data1, unsigned int

Pagina 67

Rev.1.01 2007.02.16 RJJ10J1643-0101 159 RAPI_PORT_9_5 Port P95 RAPI_PORT_9_6 Port P96 RAPI_PORT_9_7 Port P97 RAPI_PORT_10_0 Port P100 RAPI_POR

Pagina 68

Rev.1.01 2007.02.16 RJJ10J1643-0101 162.7 A/D Converter Driver The A/D converter driver sets the A/D converter, controls the A/D converter, clears

Pagina 69

Rev.1.01 2007.02.16 RJJ10J1643-0101 160 RAPI_PORT_5_1 PortP51 RAPI_PORT_5_2 PortP52 RAPI_PORT_5_3 PortP53 RAPI_PORT_5_4 PortP54 RAPI_PORT

Pagina 70

Rev.1.01 2007.02.16 RJJ10J1643-0101 161 RAPI_PORT_H_4 PortPH4 RAPI_PORT_H_5 PortPH5 RAPI_PORT_H_6 PortPH6 RAPI_PORT_H_7 PortPH7 RAPI_PORT

Pagina 71

Rev.1.01 2007.02.16 RJJ10J1643-0101 162 __WriteIOPort Synopsis <Write to I/O port> Boolean __WriteIOPort(unsigned long data1, unsigned int

Pagina 72

Rev.1.01 2007.02.16 RJJ10J1643-0101 163 RAPI_PORT_9_5 Port P95 RAPI_PORT_9_6 Port P96 RAPI_PORT_9_7 Port P97 RAPI_PORT_10_0 Port P100 RAPI_POR

Pagina 73

Rev.1.01 2007.02.16 RJJ10J1643-0101 164 RAPI_PORT_5_5 PortP55 RAPI_PORT_5_6 PortP56 RAPI_PORT_5_7 PortP57 RAPI_PORT_6_0 PortP60 RAPI_PORT

Pagina 74

Rev.1.01 2007.02.16 RJJ10J1643-0101 165 __WriteIOPortRegister Remark • If an undefined value is specified in the first argument, operation of th

Pagina 75

Rev.1.01 2007.02.16 RJJ10J1643-0101 166 __SetIOPortRegister Synopsis <Set I/O port register> Boolean __SetIOPortRegister(unsigned long dat

Pagina 76

Rev.1.01 2007.02.16 RJJ10J1643-0101 167 Specify the set value for the port control register corresponding to a selected port. [data3] (M16C)

Pagina 77

Rev.1.01 2007.02.16 RJJ10J1643-0101 168 __ReadIOPortRegister Synopsis <Read from I/O port register> Boolean __ReadIOPortRegister(unsigned

Pagina 78

Rev.1.01 2007.02.16 RJJ10J1643-0101 169 • Ports in port B of the H8/300H that are used as analog input pins cannot be used as input ports. Program

Pagina 79

Rev.1.01 2007.02.16 RJJ10J1643-0101 17 Program example #include "rapi_ad_r8c_13.h" void main( void ) { unsigned int status, dat

Pagina 80

Rev.1.01 2007.02.16 RJJ10J1643-0101 170 __WriteIOPortRegister Synopsis <Write to I/O port register> Boolean __WriteIOPortRegister(unsigne

Pagina 81

Rev.1.01 2007.02.16 RJJ10J1643-0101 171 Program example #include " rapi_io_port_r8c_13.h" void func( void ) { /* Set the data to

Pagina 82

Rev.1.01 2007.02.16 RJJ10J1643-0101 1724.2.4 External interrupt __SetInterrupt Synopsis <Set external interrupt> Boolean __SetInterrupt(un

Pagina 83

Rev.1.01 2007.02.16 RJJ10J1643-0101 173 RAPI_INT2 Uses _INT2 interrupt. RAPI_INT3 Uses _INT3 interrupt. RAPI_KEY Uses key input interrupt.

Pagina 84

Rev.1.01 2007.02.16 RJJ10J1643-0101 174 RAPI_INT_RISING Specifies a rising edge for the active edge of a selected external interrupt. RAPI_INT_

Pagina 85 - RAPI_OVERFLOW

Rev.1.01 2007.02.16 RJJ10J1643-0101 175 RAPI_TRUE is returned. Functionality External interrupt Reference __EnableInterrupt, __GetInterruptFl

Pagina 86

Rev.1.01 2007.02.16 RJJ10J1643-0101 176 __EnableInterrupt Synopsis <Control external interrupt> Boolean __EnableInterrupt(unsigned long da

Pagina 87

Rev.1.01 2007.02.16 RJJ10J1643-0101 177Return value If the external interrupt specification is incorrect, RAPI_FALSE is returned; otherwise, RAPI

Pagina 88

Rev.1.01 2007.02.16 RJJ10J1643-0101 178 __GetInterruptFlag Synopsis <Get the status of external interrupt flag> Boolean __GetInterruptFlag

Pagina 89

Rev.1.01 2007.02.16 RJJ10J1643-0101 179 Functionality External interrupt Reference __SetInterrupt, __EnableInterrupt, __ClearInterruptFlag R

Pagina 90

Rev.1.01 2007.02.16 RJJ10J1643-0101 183. Standard Types This section describes the standard types defined in the library. For details about the set

Pagina 91

Rev.1.01 2007.02.16 RJJ10J1643-0101 180 __ClearInterruptFlag Synopsis <Clear external interrupt flag> Boolean __ClearInterruptFlag(unsign

Pagina 92

Rev.1.01 2007.02.16 RJJ10J1643-0101 181 be guaranteed. • The specifiable external interrupts differ with each CPU used. Program example #inclu

Pagina 93

Rev.1.01 2007.02.16 RJJ10J1643-0101 1824.2.5 A/D converter __CreateADC Synopsis <Set A/D converter> Boolean __CreateADC(unsigned long data

Pagina 94

Rev.1.01 2007.02.16 RJJ10J1643-0101 183 RAPI_AN22 Uses AN22 pin for the analog input pin. RAPI_AN23 Uses AN23 pin for the analog input pin. RA

Pagina 95

Rev.1.01 2007.02.16 RJJ10J1643-0101 184 (Conversion method) Specify one from { RAPI_WITH_SAMPLE_HOLD, RAPI_WITHOUT_SAMPLE_HOLD }. The default va

Pagina 96

Rev.1.01 2007.02.16 RJJ10J1643-0101 185 (Resolution) Specify one from { RAPI_10BIT, RAPI_8BIT }. The default value is RAPI_8BIT. (Operating sta

Pagina 97 - (M16C) (R8C)

Rev.1.01 2007.02.16 RJJ10J1643-0101 186 (Resolution) Specify one from { RAPI_10BIT, RAPI_8BIT }. The default value is RAPI_8BIT. (Conversion me

Pagina 98

Rev.1.01 2007.02.16 RJJ10J1643-0101 187 RAPI_SOFTWARE_TRIGGER Selects software trigger. RAPI_TIMER_RD_TRIGGER Selects timer RD as trigger. • S

Pagina 99

Rev.1.01 2007.02.16 RJJ10J1643-0101 188 RAPI_AN4 Uses AN4 pin for the analog input pin. RAPI_AN5 Uses AN5 pin for the analog input pin. RAPI

Pagina 100 - RJJ10J1643-0101

Rev.1.01 2007.02.16 RJJ10J1643-0101 189 (Input pin) Specify one from { RAPI_AN0, RAPI_AN1, RAPI_AN2, RAPI_AN3, RAPI_AN4, RAPI_AN5, RAPI_AN6, RAPI_

Pagina 101

Rev.1.01 2007.02.16 RJJ10J1643-0101 194. Library Reference 4.1 API List by Peripheral Facility The table below lists the Renesas Embedded APIs clas

Pagina 102

Rev.1.01 2007.02.16 RJJ10J1643-0101 190 Delayed trigger mode 1 Repeat sweep mode Specify 1, 2, 3, or 4. (R8C) Specify 1. (H8/300H) One-

Pagina 103

Rev.1.01 2007.02.16 RJJ10J1643-0101 191 __EnableADC Synopsis <Control operation of A/D converter> Boolean __EnableADC (unsigned long data1

Pagina 104

Rev.1.01 2007.02.16 RJJ10J1643-0101 192 Selectable only when one-shot mode or repeat mode is used. RAPI_AN21 Uses AN21 pin for the analog inpu

Pagina 105

Rev.1.01 2007.02.16 RJJ10J1643-0101 193 RAPI_AN4 Uses AN4 pin for the analog input pin. RAPI_AN5 Uses AN5 pin for the analog input pin. RAPI_A

Pagina 106

Rev.1.01 2007.02.16 RJJ10J1643-0101 194 Selectable only when sweep mode or repeat sweep mode 0 is used. RAPI_AN4_GROUP Uses AN4-AN7 pins group

Pagina 107 - (H8/300H)

Rev.1.01 2007.02.16 RJJ10J1643-0101 195 void func( void ) { /* Disable A/D converter */ __EnableADC( RAPI_AN0|RAPI_AD_OFF, 1 ); }

Pagina 108

Rev.1.01 2007.02.16 RJJ10J1643-0101 196 __DestroyADC Synopsis <Discard settings of A/D converter> Boolean __DestroyADC(void) Description

Pagina 109

Rev.1.01 2007.02.16 RJJ10J1643-0101 197 __GetADC Synopsis <Get A/D converted value (register specified)> Boolean __GetADC(unsigned long da

Pagina 110

Rev.1.01 2007.02.16 RJJ10J1643-0101 198 __GetADCAll Synopsis <Get A/D converted value (all registers)> Boolean __GetADCAll(unsigned int *d

Pagina 111

Rev.1.01 2007.02.16 RJJ10J1643-0101 199 __GetADCStatus Synopsis <Get the status of A/D converter> Boolean __GetADCStatus(unsigned int *sta

Pagina 112

Rev.1.01 2007.02.16 RJJ10J1643-0101 2REVISION HISTORY Rev. Summary Date 1.00 06.04.07 1.01 ・ Additions and corrections made for support of libr

Pagina 113

Rev.1.01 2007.02.16 RJJ10J1643-0101 2035 __CreatePulseWidthMeasurementMode Sets pulse width measurement mode 36 __EnablePulseWidthMeasurementMode

Pagina 114

Rev.1.01 2007.02.16 RJJ10J1643-0101 200 __ClearADCStatus Synopsis <Clear the status of A/D converter> Boolean __ClearADCStatus(unsigned in

Pagina 115

Rev.1.01 2007.02.16 RJJ10J1643-0101 201 Renesas Embedded Application Programming Interface Reference Manual Rev. 1.01

Pagina 116

2-6-2, Ote-machi, Chiyoda-ku, Tokyo, 100-0004, JapanRenesas EmbeddedApplication Programming InterfaceReference manual

Pagina 117

Rev.1.01 2007.02.16 RJJ10J1643-0101 214.2 Description of Each API This section describes each API and explains how to use them, showing a program e

Pagina 118

Rev.1.01 2007.02.16 RJJ10J1643-0101 224.2.1 Serial I/O __BasicOpenSerialDriver Synopsis <Open a serial port> Boolean __BasicOpenSerialDri

Pagina 119

Rev.1.01 2007.02.16 RJJ10J1643-0101 23 __BasicCloseSerialDriver Synopsis <Close a serial port> Boolean __BasicCloseSerialDriver(unsigned l

Pagina 120

Rev.1.01 2007.02.16 RJJ10J1643-0101 24 __BasicSetSerialFormat Synopsis <Set serial communication> Boolean __BasicSetSerialFormat(unsigned

Pagina 121

Rev.1.01 2007.02.16 RJJ10J1643-0101 25 If the API is used in clock synchronous serial communication mode, do not set these values. (M16C) (UART0,

Pagina 122

Rev.1.01 2007.02.16 RJJ10J1643-0101 26 (R8C) (UART0, UART1) RAPI_SM_SYNC Clock synchronous serial communication mode RAPI_SM_ASYNC Clock asynch

Pagina 123

Rev.1.01 2007.02.16 RJJ10J1643-0101 27 RAPI_COM3 SCI3 channel 3 For serial communication mode, the following values can be set. (H8/300H) (

Pagina 124

Rev.1.01 2007.02.16 RJJ10J1643-0101 28Functionality Serial I/O Remark • The specifiable serial ports differ with each CPU used. • If an undefi

Pagina 125

Rev.1.01 2007.02.16 RJJ10J1643-0101 29 __BasicStartSerialReceiving Synopsis <Receive 1 data> Boolean __BasicStartSerialReceiving(unsigned

Pagina 126

Rev.1.01 2007.02.16 RJJ10J1643-0101 3 ・ Description of third argument in __CreateInputCapture corrected ・ Wording “specified” unified to “specif

Pagina 127

Rev.1.01 2007.02.16 RJJ10J1643-0101 30 __BasicStartSerialSending Synopsis <Transmit 1 data> Boolean _BasicStartSerialSending(unsigned lon

Pagina 128

Rev.1.01 2007.02.16 RJJ10J1643-0101 31 __BasicReceivingStatusRead Synopsis <Read receive status> unsigned int __BasicReceivingStatusRead(u

Pagina 129

Rev.1.01 2007.02.16 RJJ10J1643-0101 32 Remark • The specifiable serial ports differ with each CPU used. • If an undefined value is specified in

Pagina 130

Rev.1.01 2007.02.16 RJJ10J1643-0101 33 __BasicSendingStatusRead Synopsis <Read transmit status> Boolean __BasicSendingStatusRead(unsigned

Pagina 131

Rev.1.01 2007.02.16 RJJ10J1643-0101 34 __BasicStopSerialReceiving Synopsis <Stop reception> Boolean Rapi_BasicStopSerialReceiving(unsigned

Pagina 132

Rev.1.01 2007.02.16 RJJ10J1643-0101 35 __BasicStopSerialSending Synopsis <Stop transmission> Boolean __BasicStopSerialSending(unsigned lon

Pagina 133

Rev.1.01 2007.02.16 RJJ10J1643-0101 36 __OpenSerialDriver Synopsis <Open a serial port> Boolean __OpenSerialDriver(unsigned long data) d

Pagina 134

Rev.1.01 2007.02.16 RJJ10J1643-0101 37 __CloseSerialDriver Synopsis <Close a serial port> Boolean __CloseSerialDriver(unsigned long data)

Pagina 135

Rev.1.01 2007.02.16 RJJ10J1643-0101 38 __ConfigSerialDriverNotify Synopsis <Register a notification function> Boolean __ConfigSerialDrive

Pagina 136

Rev.1.01 2007.02.16 RJJ10J1643-0101 39 (R8C) (H8/300H) Return value If the serial port specification is incorrect, RAPI_FALSE is returne

Pagina 137 - __SetTimerRegister

Rev.1.01 2007.02.16 RJJ10J1643-0101 4 ・ RAPI_AN30, RAPI_AN31, RAPI_AN32, and RAPI_P9_GROUP added to the item for data1 of M16C in __CreateADC ・

Pagina 138

Rev.1.01 2007.02.16 RJJ10J1643-0101 40 Program example #include ”rapi_sif_r8c_13.h” void Notify(unsigned char result) { if ((result&R

Pagina 139

Rev.1.01 2007.02.16 RJJ10J1643-0101 41 __SetSerialFormat Synopsis <Set serial communication> Boolean __SetSerialFormat(unsigned long data

Pagina 140

Rev.1.01 2007.02.16 RJJ10J1643-0101 42 __SetSerialInterrupt Synopsis <Set serial interrupts> Boolean __SetSerialInterrupt(unsigned long da

Pagina 141

Rev.1.01 2007.02.16 RJJ10J1643-0101 43 RAPI_COM1 UART0 RAPI_COM2 UART1 For interrupt settings, the following values can set. RAPI_INT_TX_DIS

Pagina 142

Rev.1.01 2007.02.16 RJJ10J1643-0101 44 Boolean func( void ) { ……………… /* Set interrupt of RAPI_COM1 to serial driver */ return __SetSeri

Pagina 143

Rev.1.01 2007.02.16 RJJ10J1643-0101 45 __StartSerialReceiving Synopsis <Start reception> Boolean __StartSerialReceiving(unsigned long data

Pagina 144

Rev.1.01 2007.02.16 RJJ10J1643-0101 46 unsigned int buffer[10]; void func( void ) { ……………… /* Get 5 word data received in serial communicat

Pagina 145

Rev.1.01 2007.02.16 RJJ10J1643-0101 47 __StartSerialSending Synopsis <Start transmission> Boolean __StartSerialSending(unsigned long data,

Pagina 146

Rev.1.01 2007.02.16 RJJ10J1643-0101 48 unsigned int buffer[10]; void func( void ) { ……………… /* Set 5 word data to transmit buffer of serial

Pagina 147

Rev.1.01 2007.02.16 RJJ10J1643-0101 49 __StopSerialReceiving Synopsis <Stop reception> Boolean __StopSerialReceiving(unsigned long data)

Pagina 148

Rev.1.01 2007.02.16 RJJ10J1643-0101 5 Table of Contents Table of Contents ...5 1. Intr

Pagina 149

Rev.1.01 2007.02.16 RJJ10J1643-0101 50 __StopSerialSending Synopsis <Stop transmission> Boolean __StopSerialSending(unsigned long data)

Pagina 150

Rev.1.01 2007.02.16 RJJ10J1643-0101 51 __PollingSerialReceiving Synopsis <Polling reception> unsigned int __PollingSerialReceiving(unsigne

Pagina 151

Rev.1.01 2007.02.16 RJJ10J1643-0101 52 __PollingSerialSending Synopsis <Polling transmission> Unsigned __PollingSerialSending(unsigned lon

Pagina 152

Rev.1.01 2007.02.16 RJJ10J1643-0101 53 unsigned int buffer[10],count; void func( void ) { ……………… /* Transmission interrupt disable */

Pagina 153

Rev.1.01 2007.02.16 RJJ10J1643-0101 544.2.2 Timer __CreateTimer Synopsis <Set timer mode> Boolean __CreateTimer(unsigned long data1, unsig

Pagina 154

Rev.1.01 2007.02.16 RJJ10J1643-0101 55 (Operating states set) Specify one from { RAPI_TIMER_ON, RAPI_TIMER_OFF }. The default value is RAPI_TIMER

Pagina 155 - (H8/300H)

Rev.1.01 2007.02.16 RJJ10J1643-0101 56 (Count source) Specify one from { RAPI_F1, RAPI_F8, RAPI_FRING }. The default value is RAPI_F1. (Operati

Pagina 156

Rev.1.01 2007.02.16 RJJ10J1643-0101 57 RAPI_TB1_F256 Timer B1 counts with internal clock φ/256. RAPI_TB1_F512 Timer B1 counts with internal cl

Pagina 157

Rev.1.01 2007.02.16 RJJ10J1643-0101 58 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW. If no interrupts are specif

Pagina 158

Rev.1.01 2007.02.16 RJJ10J1643-0101 59 void func( void ) { /* Set up timer X as timer mode */ __CreateTimer( RAPI_TIMER_X|RAPI_TIMER_ON|RA

Pagina 159

Rev.1.01 2007.02.16 RJJ10J1643-0101 6__CreateTimer ... 54 __EnableTimer ...

Pagina 160

Rev.1.01 2007.02.16 RJJ10J1643-0101 60 __EnableTimer Synopsis <Control operation of timer mode> Boolean __EnableTimer(unsigned long data)

Pagina 161

Rev.1.01 2007.02.16 RJJ10J1643-0101 61Remark • If an undefined value is specified in the argument, operation of the API cannot be guaranteed.

Pagina 162

Rev.1.01 2007.02.16 RJJ10J1643-0101 62 __DestroyTimer Synopsis <Discard settings of timer mode> Boolean __DestroyTimer(unsigned long data)

Pagina 163

Rev.1.01 2007.02.16 RJJ10J1643-0101 63 void func( void ) { /* Destroy the setting of timer Z as timer mode */ __DestroyTimer( RAPI_TIMER_

Pagina 164

Rev.1.01 2007.02.16 RJJ10J1643-0101 64 __CreateEventCounter Synopsis <Set event counter mode> Boolean __CreateEventCounter(unsigned long d

Pagina 165

Rev.1.01 2007.02.16 RJJ10J1643-0101 65 RAPI_UDF_REGISTER Selects the UDF register for the cause of up/down switching. RAPI_TAIOUT Selects the i

Pagina 166

Rev.1.01 2007.02.16 RJJ10J1643-0101 66 RAPI_WRITE_ RELOAD_ BOTH Selects operation mode in which writing to the primary register and prescaler caus

Pagina 167

Rev.1.01 2007.02.16 RJJ10J1643-0101 67 RAPI_RISING Selects the rising edge of count source as active edge. RAPI_FALLING Selects the falling ed

Pagina 168

Rev.1.01 2007.02.16 RJJ10J1643-0101 68 [data4] (M16C) (H8/300H) Specify 0. (R8C) Specify the set value for the prescaler register in 8 bi

Pagina 169

Rev.1.01 2007.02.16 RJJ10J1643-0101 69 __EnableEventCounter Synopsis <Control operation of event counter mode> Boolean __EnableEventCount

Pagina 170

Rev.1.01 2007.02.16 RJJ10J1643-0101 7__GetADC ... 197 __GetADCAll ...

Pagina 171

Rev.1.01 2007.02.16 RJJ10J1643-0101 70Functionality Timer (event counter mode) Reference __CreateEventCounter, __DestroyEventCounter, __GetEv

Pagina 172

Rev.1.01 2007.02.16 RJJ10J1643-0101 71 __DestroyEventCounter Synopsis <Discard settings of event counter mode> Boolean __DestroyEventCount

Pagina 173

Rev.1.01 2007.02.16 RJJ10J1643-0101 72 void func( void ) { /* Destroy the setting of timer Y as event counter mode */ __DestroyEventCounter

Pagina 174

Rev.1.01 2007.02.16 RJJ10J1643-0101 73 __GetEventCounter Synopsis <Get event counter mode counter value> Boolean __GetEventCounter(unsign

Pagina 175

Rev.1.01 2007.02.16 RJJ10J1643-0101 74 [1]: The value of timer RA register is stored. (H8/300H) • When using timer B1 (RAPI_TIMER_B1 specified)

Pagina 176

Rev.1.01 2007.02.16 RJJ10J1643-0101 75 __CreatePulseWidthModulationMode Synopsis <Set pulse width modulation mode> Boolean __CreatePulseWi

Pagina 177

Rev.1.01 2007.02.16 RJJ10J1643-0101 76 RAPI_RISING Selects the rising edge of TAiIN pin input signal as active edge. RAPI_FALLING Selects the

Pagina 178

Rev.1.01 2007.02.16 RJJ10J1643-0101 77 (Count source) Specify one from { RAPI_F1, RAPI_F2, RAPI_F8, RAPI_TIMER_Y_UNDERFLOW}. The default value is

Pagina 179

Rev.1.01 2007.02.16 RJJ10J1643-0101 78 • Specifiable definition values when timer V is used (RAPI_TIMER_V specified) (Clock) Specify one from {

Pagina 180

Rev.1.01 2007.02.16 RJJ10J1643-0101 79Reference __EnablePulseWidthModulationMode, __DestroyPulseWidthModulationMode Remark • If an undefined

Pagina 181

Rev.1.01 2007.02.16 RJJ10J1643-0101 81. Introduction The Renesas Embedded Application Programming Interface (API) is a unified API for the microcom

Pagina 182

Rev.1.01 2007.02.16 RJJ10J1643-0101 80 __EnablePulseWidthModulationMode Synopsis <Control operation of pulse width modulation mode> Boolea

Pagina 183

Rev.1.01 2007.02.16 RJJ10J1643-0101 81 Remark • If an undefined value is specified in the argument, operation of the API cannot be guaranteed.

Pagina 184

Rev.1.01 2007.02.16 RJJ10J1643-0101 82 __DestroyPulseWidthModulationMode Synopsis <Discard settings of pulse width modulation mode> Boolea

Pagina 185

Rev.1.01 2007.02.16 RJJ10J1643-0101 83 __CreatePulsePeriodMeasurementMode Synopsis <Set pulse period measurement mode> Boolean __CreatePul

Pagina 186

Rev.1.01 2007.02.16 RJJ10J1643-0101 84 RAPI_TIMER_RA Uses timer RA. RAPI_F1 Selects f1 for the count source. RAPI_F2 Selects f2 for the count

Pagina 187

Rev.1.01 2007.02.16 RJJ10J1643-0101 85 RAPI_TIMER_RD3 Uses timer RD0 channel 3. RAPI_TW_F1 Timer W counts with internal clock φ. RAPI_TW_F2

Pagina 188

Rev.1.01 2007.02.16 RJJ10J1643-0101 86 RAPI_FTIOB Use FTIOB pin as input pin. • Specifiable definition values when timer W is used (RAPI_TIMER_

Pagina 189 - [data2]

Rev.1.01 2007.02.16 RJJ10J1643-0101 87 (Interrupt) If overflow interrupt requests are enabled, specify RAPI_OVERFLOW. If no interrupts are specif

Pagina 190

Rev.1.01 2007.02.16 RJJ10J1643-0101 88 __EnablePulsePeriodMeasurementMode Synopsis <Control operation of pulse period measurement mode> Bo

Pagina 191

Rev.1.01 2007.02.16 RJJ10J1643-0101 89 RAPI_TIMER_ OFF Sets the timer that is set to pulse period measurement mode to stop operating. Return val

Pagina 192 - RAPI_P9_GROUP

Rev.1.01 2007.02.16 RJJ10J1643-0101 92. Driver 2.1 Overview The library described herein provides a peripheral facility control program (peripheral

Pagina 193

Rev.1.01 2007.02.16 RJJ10J1643-0101 90 __DestroyPulsePeriodMeasurementMode Synopsis <Discard settings of pulse period measurement mode> Bo

Pagina 194

Rev.1.01 2007.02.16 RJJ10J1643-0101 91 • When used for the H8/300H, this API places a specified timer into module stanby state after discarding it.

Pagina 195

Rev.1.01 2007.02.16 RJJ10J1643-0101 92 __GetPulsePeriodMeasurementMode Synopsis <Get measured value in pulse period measurement mode> Bool

Pagina 196

Rev.1.01 2007.02.16 RJJ10J1643-0101 93 [0]: The value of timer RA prescaler register is stored. [1]: The value of timer RA register is stored.

Pagina 197

Rev.1.01 2007.02.16 RJJ10J1643-0101 94 __CreatePulseWidthMeasurementMode Synopsis <Set pulse width measurement mode> Boolean __CreatePulse

Pagina 198

Rev.1.01 2007.02.16 RJJ10J1643-0101 95 RAPI_FOCO Selects fOCO for the count source. RAPI_TIMER_ONSets the timer to start operating in __CreatePu

Pagina 199

Rev.1.01 2007.02.16 RJJ10J1643-0101 96 RAPI_TW_F8 Timer W counts with internal clock φ/8. RAPI_TZ_F1 Timer Z counts with internal clock φ. R

Pagina 200

Rev.1.01 2007.02.16 RJJ10J1643-0101 97 (Count source) Specify one from { RAPI_TW_F1, RAPI_TW_F2, RAPI_TW_F4, RAPI_TW_F8 }. The default value is R

Pagina 201

Rev.1.01 2007.02.16 RJJ10J1643-0101 98 Specify the interrupt priority level (0–7) to be set in the interrupt control register. (H8/300H) Specif

Pagina 202 - Renesas Embedded

Rev.1.01 2007.02.16 RJJ10J1643-0101 99 __EnablePulseWidthMeasurementMode Synopsis <Control operation of pulse width measurement mode> Bool

Comentarios a estos manuales

Sin comentarios