Everything

CHAPTER 17 DATA TYPES AND MACROS


This chapter describes the data types and macros, which are used when issuing service calls provided by the RI600V4.
Note <ri_root> indicates the installation folder of RI600V4.
The default folder is "C:\Program Files\Renesas Electronics\CubeSuite+\RI600V4".
17.1 Data Types
The Following lists the data types of parameters specified when issuing a service call.
Macro definition of the data type is performed by <ri_root>\in600\kernel.h, or <ri_root>\inc600\itron.h that is included by kernel.h.
Table 17-1 Data Types
Macro
Data Type
Description
B
signed char
Signed 8-bit integer
H
signed short
Signed 16-bit integer
W
signed long
Signed 32-bit integer
D
signed long long
Signed 64-bit integer
UB
unsigned char
Unsigned 8-bit integer
UH
unsigned short
Unsigned 16-bit integer
UW
unsigned long
Unsigned 32-bit integer
UD
unsigned long long
Unsigned 64-bit integer
VB
signed char
8-bit value with unknown data type
VH
signed short
16-bit value with unknown data type
VW
signed long
32-bit value with unknown data type
VD
signed long long
64-bit value with unknown data type
VP
void *
Pointer to unknown data type
FP
void (*)
Processing unit start address (pointer to a function)
INT
signed long
Signed 32-bit integer
UINT
unsigned long
Unsigned 32-bit integer
BOOL
signed long
Boolean value (TRUE or FALSE)
ER
signed long
Error code
ID
signed short
Object ID
ATR
unsigned short
Object attribute
STAT
unsigned short
Object state
MODE
unsigned short
Service call operational mode
PRI
signed short
Priority for tasks or messages
SIZE
unsigned long
Memory area size (in bytes)
TMO
signed long
Time-out (in millisecond)
RELTIM
unsigned long
Relative time (in millisecond)
VP_INT
signed long
Pointer to unknown data type, or signed 32-bit integer
ER_UINT
signed long
Error code, or signed 32-bit integer
FLGPTN
unsigned long
Bit pattern of eventflag
IMASK
unsigned short
Interrupt mask level

17.2 Macros
This section explains the macros (for current state, processing program attributes, or the like) used when issuing a service call provided by the RI600V4.
17.2.1 Constant macros
The following lists the constant macros.
The constant macros are defined by either of following header files.
- <ri_root>\inc600\kernel.h
- <ri_root>\inc600\itron.h, which s included by kernel.h
- System information header file kernel_id.h, which is generated by the cfg600.
The contents of this file is changed according to the system configuration file.
Table 17-2 Constant Macros
Classification
Macro
Definition
Where
Description
General
NULL
0
itron.h
Null pointer
TRUE
1
itron.h
True
FALSE
0
itron.h
False
E_OK
0
itron.h
Normal completion
Attribute
TA_NULL
0
itron.h
Object attribute unspecified
TA_TFIFO
0x0000
kernel.h
Task wait queue in FIFO order
TA_TPRI
0x0001
kernel.h
Task wait queue is managed in task current priority order. Among tasks with the same priority, they are queued in FIFO order.
TA_MFIFO
0x0000
kernel.h
Message queue in FIFO order
TA_MPRI
0x0002
kernel.h
Message queue is managed in message priority order. Among messages with the same priority, they are queued in FIFO order.
TA_ACT
0x0002
kernel.h
Task is activated after creation
TA_WSGL
0x0000
kernel.h
Do not allow multiple tasks to wait for eventflag
TA_WMUL
0x0002
kernel.h
Allow multiple tasks to wait for eventflag
TA_CLR
0x0004
kernel.h
Clear eventflag when freed from WAITING state
TA_CEILING
0x0003
kernel.h
Priority ceiling protocol
TA_STA
0x0002
kernel.h
Create cyclic hander in operational state
TA_PHS
0x0004
kernel.h
Save cyclic hander phase
Time-out
TMO_POL
0
itron.h
Polling
TMO_FEVR
-1
itron.h
Waiting forever
Operation mode
TWF_ANDW
0x0000
kernel.h
Eventflag AND wait
TWF_ORW
0x0001
kernel.h
Eventflag OR wait
Object
state
TTS_RUN
0x0001
kernel.h
RUNNING state
TTS_RDY
0x0002
kernel.h
READY state
TTS_WAI
0x0004
kernel.h
WAITING state
TTS_SUS
0x0008
kernel.h
SUSPENDED state
TTS_WAS
0x000C
kernel.h
WAITING-SUSPENDED state
TTS_DMT
0x0010
kernel.h
DORMANT state
TTW_SLP
0x0001
kernel.h
Sleeping state
TTW_DLY
0x0002
kernel.h
Delayed state
TTW_SEM
0x0004
kernel.h
Waiting state for a semaphore resource
TTW_FLG
0x0008
kernel.h
Waiting state for an eventflag
TTW_SDTQ
0x0010
kernel.h
Sending waiting state for a data queue
TTW_RDTQ
0x0020
kernel.h
Receiving waiting state for a data queue
TTW_MBX
0x0040
kernel.h
Receiving waiting state for a mailbox
TTW_MTX
0x0080
kernel.h
Waiting state for a mutex
TTW_SMBF
0x0100
kernel.h
Sending waiting state for a message buffer
TTW_RMBF
0x0200
kernel.h
Receiving waiting state for a message buffer
TTW_MPF
0x2000
kernel.h
Waiting state for a fixed-sized memory block
TTW_MPL
0x4000
kernel.h
Waiting state for a variable-sized memory block
TCYC_STP
0x0000
kernel.h
Cyclic handler in non-operational state
TCYC_STA
0x0001
kernel.h
Cyclic handler in operational state
TALM_STP
0x0000
kernel.h
Alarm handler in non-operational state
TALM_STA
0x0001
kernel.h
Alarm handler in operational state
Others
TSK_SELF
0
kernel.h
Specify invoking task
TSK_NONE
0
kernel.h
No relevant task
TPRI_SELF
0
kernel.h
Specify base priority of invoking task
TPRI_INI
0
kernel.h
Specify initial priority
Kernel configura-
tion
TMIN_TPRI
1
kernel.h
Minimum task priority
TMAX_TPRI
system.priority
kernel_id.h
Maximum task priority
TMIN_MPRI
1
kernel.h
Minimum message priority
TMAX_MPRI
system.message_pri
kernel_id.h
Maximum message priority
TKERNEL_MAKER
0x011B
kernel.h
Kernel maker code
TKERNEL_PRID
0x0003
kernel.h
Identification number of the kernel
TKERNEL_SPVER
0x5403
kernel.h
Version number of the ITRON specification
TKERNEL_PRVER
0x0130
kernel.h
Version number of the kernel
TMAX_ACTCNT
255
kernel.h
Maximum number of queued task activation requests
TMAX_WUPCNT
255
kernel.h
Maximum number of queued task wake-up requests
TMAX_SUSCNT
1
kernel.h
Maximum number of nested task suspension requests
TBIT_FLGPTN
32
kernel.h
Number of bits in an eventflag
TIC_NUME
system.tic_nume
kernel_id.h
Numerator of base clock interval
TIC_DENO
system.tic_deno
kernel_id.h
Denominator of base clock interval
TMAX_MAXSEM
65535
kernel.h
Maximum value of the maximum semaphore resource count
VTMAX_TSK
Number of "task[]"s
kernel_id.h
Maximum task ID
VTMAX_SEM
Number of
"semaphore[]"s
kernel_id.h
Maximum semaphore ID
VTMAX_FLG
Number of "flag[]"s
kernel_id.h
Maximum eventflag ID
VTMAX_DTQ
Number of "dataqueue[]"s
kernel_id.h
Maximum data queue ID
VTMAX_MBX
Number of "mailbox[]"s
kernel_id.h
Maximum mailbox ID
VTMAX_MTX
Number of "mutex[]"s
kernel_id.h
Maximum mutex ID
VTMAX_MBF
Number of
"message_buffer[]"s
kernel_id.h
Maximum message buffer ID
VTMAX_MPF
Number of
"memorypool[]"s
kernel_id.h
Maximum fixed-sized memory pool ID
VTMAX_MPL
Number of
"variable_memorypool[]"s
kernel_id.h
Maximum variable-sized memory pool ID
VTMAX_CYH
Number of
"cyclic_hand[]"s
kernel_id.h
Maximum cyclic handler ID
VTMAX_ALH
Number of
"alarm_hand[]"s
kernel_id.h
Maximum alarm handler ID
VTSZ_MBFTBL
4
kernel.h
Size of message buffer's message management table (in bytes)
VTMAX_AREASIZE
0x10000000
kernel.h
Maximum size of various areas (in bytes)
VTKNL_LVL
system.system_IPL
kernel_id.h
Kernel interrupt mask level
VTIM_LVL
clock.IPL
kernel_id.h
Base clock interrupt level
Error code
E_NOSPT
-9
itron.h
Unsupported function
E_PAR
-17
itron.h
Parameter error
E_ID
-18
itron.h
Invalid ID number
E_CTX
-25
itron.h
Context error
E_ILUSE
-28
itron.h
Illegal use of service call
E_OBJ
-41
itron.h
Object state error
E_QOVR
-43
itron.h
Queuing overflow
E_RLWAI
-49
itron.h
Forced release from WAITING state
E_TMOUT
-50
itron.h
Polling failure of time-out
EV_RST
-127
itron.h
Released from WAITING state by the object reset

17.2.2 Function Macros
The following lists the function macros.
The function macros are defined by <ri_root>\inc600\itron.h.
1 ) ER MERCD ( ER ercd )
Return the main error code of ercd.
2 ) ER SERCD ( ER ercd )
Return sub error code of ercd.
3 ) ER ERCD ( ER mercd, ER sercd )
Return the error code from the main error code indicated by mercd and sub error code indicated by sercd.
Note In the error code returned from the RI600V4, all sub error code is -1, and all main error code is same as the value described in Table 17-2.