GUF-Yocto-34.0-r5756-0
VINCELL
User Manual
A more detailed documentation of the GPIO handling in the Linux kernel can be found in the documentation
directory of the Linux kernel source tree.
6.2
Serial interfaces (RS-232 / RS-485 / MDB)
Most of the serial interfaces are exported as TTY devices and thus accessible via their device nodes under
/dev/t-
tymxc<number>
. Depending on your hardware platform (and maybe its assembly option), different transceivers
(RS232, RS485, MDB) can be connected to these TTY devices. See the following table for the mapping between
device nodes and hardware connectors on VINCELL:
TTY device
Hardware function
/dev/ttymxc0
RS-232 #1 (X13)
/dev/ttymxc1
RS-232 #2 / MDB (X13)
/dev/ttymxc2
RS-485 (X39)
/dev/ttymxc3
internal UART (X11)
RS485 can be used in half duplex or full duplex mode. This mode has to be set on the hardware (see the
according hardware manual) as well as in the software. Per default, the interface is working in full duplex mode.
See the following C code example for setting the RS485 interface to half duplex mode:
#include <termios.h>
void set_rs485_half_duplex_mode()
{
struct serial_rs485 rs485;
int fd;
/* Open port */
fd = open ("/dev/ttymxc2", O_RDWR | O_SYNC);
/* Enable RS485 half duplex mode */
rs485.flags = SER_RS485_ENABLED | SER_RS485_RTS_ON_SEND;
ioctl(fd, TIOCSRS485, &rs485);
close(fd);
}
For a full source code example, see the BSP folder
sources/meta-guf/meta/recipes-guf/ltp-guf-tests/ltp-guf-
tests/testcases/rs485pingpong
.
Interfaces with an MDB transceiver should not be accessed directly via their device nodes. Instead, there is a
library for MDB communication in the BSP. Please see the folder
sources/meta-guf/meta/recipes-guf/mdbtest
for a full source code example.
6.3
Ethernet
If all network devices are properly configured as described in
[
I
4.2.1 Garz & Fricke system configuration]
and
[
I
they can be used by the POSIX socket API.
There is a huge amount of documentation about socket programming available. Therefore it is not documented
here.
The POSIX specification is available at:
http://pubs.opengroup.org/onlinepubs/9699919799/functions/contents.html
6.4
Real Time Clock (RTC)
All Garz & Fricke systems are equipped with a hardware real time clock. The system time is automatically set
during the boot sequence by reading the RTC. You can read the current time and date using the Linux
hwclock
command:
27