RSB-4221 User Manual
58
2.
Build QT Instructions:
3.
Run QT demo:
Note.
The -qwsParameter tell the QT Application to run as a server.
4.9.3
Demo program source code
4.9.3.1
Serial Port Programming
Please refer to <BSP_PATH>/source/demo/uart
It is an example of sending and receiving data via the serial port.
Receiving data:
Sending data:
Before using your program of serial port, please ensure that your serial port is in 232/
422/485 mode. User can reference the uart demo source code to develop a uart
application.
4.9.3.2
Watchdog Programming
RSB-4221 support hardware watchdog, the watchdog API follows posix standards.
The valid timeout value is from 1 to 6553 seconds, if the timeout value set is not in
this scope, the driver will set timeout value to default value (60 seconds).
Sample C code:
#include<stdio.h>
#include<stdlib.h>
#include<fcntl.h>
#include<signal.h>
#include<linux/watchdog.h>
intfd;
int main(intargc, constchar *argv[]) {
int timeout = 10;
/*open watchdog device, the watchdog device node is /dev/watchdog */
fd=open("/dev/watchdog",O_WRONLY);
/*set timeout to 10 seconds*/
/*when set timeout value, the watchdog driver will enable the watch
dog automatically.*/
ioctl (fd, WDIOC_SETTIMEOUT, &timeout);
while (1)
{
/*feed the watchdog every 5 seconds*/
# cd projectdir
# qmake projectName.pro
# make
# ./qtappName -qws
# ./uart_ctrl read /dev/ttyO1
# ./uart_ctrl write /dev/ttyO2
Summary of Contents for RSB-4221
Page 6: ...RSB 4221 User Manual vi...
Page 10: ...RSB 4221 User Manual x...
Page 14: ...RSB 4221 User Manual 4...
Page 33: ...23 RSB 4221 User Manual Chapter 2 H W Installation 2 3 2 Board Dimension...
Page 48: ...RSB 4221 User Manual 38...