Force_Restart (Forced Cpu Restart); Usbctl (Usb Device Connection/Disconnection Operation) - Hitachi CE50-10 Instruction Manual

Table of Contents

Advertisement

ret = didoctl(board, cmd, &bufdata);
if (ret == -1) {
perror("didoctl");
exit(1);
}
printf("DI data = 0x%x\n", bufdata);
cmd = DIO_WRITE;
bufdata |= 0x00000001;
ret = didoctl(board, cmd, &bufdata);
if (ret == -1) {
perror("didoctl");
exit(1);
}
exit(0);
}
G.3 force_restart (forced CPU restart)
This interface allows the user to forcibly reset and restart the CPU.
(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
force_restart(void);
(b) Description
Issuing this function without an argument forcibly resets and restarts the CPU within approximately 20 to 60 seconds.
(c) Return values
0
Normal termination
-1
Abnormal termination. The following code is returned for the error number (errno).
ENXIO
The driver for monitoring the hardware watchdog timer has not started or the device file for accessing the
driver cannot be opened.
G.4 usbctl (USB device connection/disconnection operation)
This interface allows the user to connect, disconnect, or obtain the status of the device connected to the USB port.
/* Write DO data. */
/* Output 1 for CH1.*/
G. Library Interface Reference
173

Advertisement

Table of Contents
loading

Table of Contents