13.4.7 Cyclic handler information

Define the following items as cyclic handler information:

1 ) Cyclic handler name: cycid

2 ) Attribute (coding language, initial activation status, saving activation phase): cycatr

3 ) System-reserved area: exinf

4 ) Start address: cychdr

5 ) Activation cycle: cyctim

6 ) Activation phase: cycphs

The number of cyclic handler information items that can be specified is defined as being within the range of 0 to 127.

The following shows the cyclic handler information format.

 CRE_CYC ( cycid, { cycatr, exinf, cychdr, cyctim, cycphs } );


The items constituting the cyclic handler information are as follows.

1 ) Cyclic handler name: cycid

Specifies the cyclic handler name.
An object name can be specified for cycid.


Note The CF78V4 outputs to the system information header file the correspondence between the cyclic handler names and IDs, in the following format. Consequently, cyclic handler names can be used in the place of IDs by including the relevant system information header file using the processing program.

[ Output format to system information header file (for C) ]

 #define cycid   ID


[ Output format to system information header file (for assembly language) ]

 cycid   .EQU    ID


2 ) Attribute (coding language, initial activation status, saving activation phase): cycatr

Specifies the attributes (coding language, initial activation status) of the cyclic handler.
The keywords that can be specified for cycatr are TA_HLNG, TA_ASM and TA_STA, TA_PHS.


[ Coding language ]

TA_HLNG: Start a processing unit through a C language interface.

TA_ASM: Start a processing unit through an assembly language interface.

[ Initial operation status ]

TA_STA: Cyclic handler is in an operational state after the creation.

[ Saving activation phase ]

TA_PHS: Saves activation phase.

Note If specification of TA_STA is omitted, the cyclic handler initial activation status is set to "non-operational state (STP state)".

3 ) System-reserved area: exinf

System-reserved area.
Values that can be specified for exinf are limited to 0.


4 ) Start address: cychdr

Specifies the start address of the cyclic handler.
Values that can be specified for cychdr are symbol names written in C.


Note 1 When the cyclic handler is in written in C as shown below, the value specified by this item is "func_cychdr".

 #include    <kernel.h>
 #include    <kernel_id.h>
 
 void
 func_cychdr ( void )
 {
     /* ............ */
 
     return;
 }


Note 2 When the cyclic handler is in written in assembly language as shown below, the value specified by this item is "func_cychdr".

 $INCLUDE    (kernel.inc)
 $INCLUDE    (kernel_id.inc)
 
     .PUBLIC  _func_cychdr
     .SECTION .text, TEXT
 _func_cychdr:
     ; ............
 
     RET


5 ) Activation cycle: cyctim

Specifies the activation cycle (unit: ticks) of the cyclic handler.
A value between 1 and 4294967295 can be specified for cyctim.


6 ) Activation phase: cycphs

Specifies the activation phase (in millisecond) for a cyclic handler.
A value from 0x1 to 0x7fffffff (aligned to `clkcyc' multiple values) can be specified for cycphs.


Note 1 In the RI78V4, the initial activation phase means the relative interval from when generation of s cyclic handler is completed until the first activation request is issued.

Note 2 If a value other than an integral multiple of the base clock cycle defined in Clock timer interrupt source is specified for cycphs, the CF78V4 assumes that an integral multiple is specified and performs processing.