57
RSB-4220 User Manual
Chapter 3
S
oftware
Functionality
3.9.2
Development of GUI Programs with QT Library
With the development kit, you can develop a qt-based GUI program. Follow these
steps, you can quickly convert your QT Project to a GUI application for RSB-4220:
1.
On your host PC, set up QT Build Environment.
2.
Build QT Instructions:
3.9.3
Demo program source code
3.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 the uart application.
3.9.3.2
Watchdog Programming
RSB-4220 support hardware watchdog, the watchdog API is follow posix standards.
The valid timeout value is from 1 to 6553 seconds, if the timeout value to set is not in
this scope, 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>
int fd;
int main(int argc, const char *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*/
#source /usr/local/cross_compiler/linux-devkit/environment-setup
# cd projectdir
# qmake projectName.pro
# make
3.Run QT demo:
# ./qtappName -qws
Note!
The -qws Parameter tell the QT Application to run as a server.
# ./uart_ctrl read /dev/ttyO1
# ./uart_ctrl write /dev/ttyO2
Содержание RSB-4220
Страница 10: ...RSB 4220 User Manual 4 ...
Страница 20: ...RSB 4220 User Manual 14 Figure 2 5 Ethernet Connector ...
Страница 41: ...Chapter 3 3 Software Functionality This chapter details the Linux operating system on the RSB 4220 platform ...
Страница 66: ...RSB 4220 User Manual 60 ...
Страница 77: ...71 RSB 4220 User Manual Chapter 5 Advantech Services ...