Hitachi CE50-10 Instruction Manual page 190

Table of Contents

Advertisement

G. Library Interface Reference
(1) Compiling
To compile the program in the development environment, enter as follows:
$ sudo cc -I/hitachi/usr/include -o xxx xxx.c -L/hitachi/lib64 -lras
• xxx: Specify the object file name.
• xxx.c: Specify the source file name.
For details about include files and libraries that are to be specified when compiling the program, see Table 5‒10: Files
for application development by using the unique functions of CE50-10.
(2) Reference
(a) Format
#include <rasif.h>
int
usbctl(int req, int port);
(b) Description
This interface connects, disconnects, or obtains the status of the device, according to the request specified for the req
argument. For the port argument, specify the USB port number (1 or 2) of the device to be connected or
disconnected. The following describes details about the arguments.
(c) Arguments
req
Specify one of the following requests:
USB_DISABLE
Disconnect the device for the USB port number specified for the port argument.
USB_ENABLE
Connect the device for the USB port number specified for the port argument.
USB_STAT
Obtain the connection and disconnection states for all USB port numbers, ignoring the value of the port
argument.
port
Specify the USB port number 1 or 2. To perform operation for all ports at the same time, specify a negative value.
Note: Macro that determines the connection state
Specifying the return value of USB_STAT and the target USB port number for the arguments of the
USB_PORT_CHECK macro allows you to determine whether the device is disconnected (= 1) or connected (= 0).
USB_PORT_CHECK(return-value, port-number)
(d) Return values
■ For normal termination
If USB_DISABLE or USB_ENABLE is specified
For normal termination, 0 is returned. Note that an attempt to connect a device that is already connected or
disconnect a device that is already disconnected also causes normal termination.
If USB_STAT is specified
The value indicating a connection or disconnection state is stored in the bit string for each USB port, and then the
value is returned.
174

Advertisement

Table of Contents
loading

Table of Contents