Chapter 3 Introduction to MR308
- 41 -

3.5.7 Synchronization and Communication Function (Data Queue)

The data queue is a mechanism to perform data communication between tasks. In Figure 3.32, for example,
task A can transmit data to the data queue and task B can receive the transmitted data from the data queue.
Data
Data
Data

Data Data

Task B
Task A
Figure 3.32 Data queue
Data in width of 32 bits can be transmitted to this data queue.
The data queue has the function to accumulate data. The accumulated data is retrieved in order of FIFO33.
However, the number of data that can be accumulated in the data queue is limited. If data is transmitted to the
data queue that is full of data, the service call issuing task goes to a data transmission wait state.
There are following data queue service calls that are provided by the MR308 kernel.
Send to Data Queue(snd_dtq, tsnd_dtq)
Transmits data. Namely, data is transmitted to the data queue. If the data queue is full of data, the
task goes to a data transmission wait state.
Send to Data Queue (psnd_dtq, ipsnd_dtq)
Transmits data. Namely, data is transmitted to the data queue. If the data queue is full of data, the
task returns error code without going to a data transmission wait state.
Forced Send to Data Queue (fsnd_dtq, ifsnd_dtq)
Transmits data. Namely, data is transmitted to the data queue. If the data queue is full of data, the
data at the top of the data queue or the oldest data is removed, and the transmitted data is stored at
the tail of the data queue.
Receive from Data Queue (rcv_dtq, trcv_dtq)
Receives data. Namely, data is retrieved from the data queue. If the data queue has no data in it, the
task is kept waiting until data is transmitted to the data queue.
Receive from Data Queue (prcv_dtq,iprcv_dtq)
Receives data. Namely, data is received from the data queue. If the data queue has no data in it, the
task returns error code without going to a data reception wait state.
Reference Data Queue Status (ref_dtq,iref_dtq)
Checks to see if there are any tasks waiting for data to be entered in the target data queue and refers
to the number of the data in the data queue.
33 First In First Out