EKI-1121L/1122L/1124L User Manual
40
Then, use the following instructions to set the termios structure, followed by the
tcsetattr function to set the new configuration.
switch(gMode) {
case MODE_RS232:
PortTermios.c_iflag &= ~IRS422;
PortTermios.c_iflag &= ~IRS485;
break;
case MODE_RS422:
PortTermios.c_iflag |= IRS422;
PortTermios.c_iflag &= ~IRS485;
break;
case MODE_RS485:
PortTermios.c_iflag &= ~IRS422;
PortTermios.c_iflag |= IRS485;
break;
}
//Set the new serial port interface type
tcsetattr(portHandle, TCSANOW, &PortTermios);
For a complete example of serial port configuration, please see the provided seria-
lecho.c example.
4.3.2
RTC APIs
To access a RTC device, you simply open the corresponding device file.
4.3.3
LED APIs
To access a LED device, you simply open the corresponding device file.
Developing in C, you will first need to include the <stdio.h> <sys/types.h> <sys/
ioctl.h> <unistd.h> and "ledman.h" header file to use the required functions.
Then, use the following program to set the command, followed by the ioctl function to
control leds.
if(flag)
{
flag = 0;
cmd = LEDMAN_CMD_ON;
/*your action*/
}
Peripheral
Device File
Real Time Clock
/dev/rtc
Peripheral
Device File
LED Indicator
/dev/led
Содержание EKI-1121L
Страница 1: ...User Manual EKI 1121L EKI 1122L EKI 1124L 1 2 4 port Programmable Serial Device Servers...
Страница 7: ...Chapter 1 1 Introduction...
Страница 10: ...EKI 1121L 1122L 1124L User Manual 4...
Страница 11: ...Chapter 2 2 Getting Started...
Страница 14: ...EKI 1121L 1122L 1124L User Manual 8 Figure 2 3 Back View of EKI 1121L Figure 2 4 Top View of EKI 1121L...
Страница 16: ...EKI 1121L 1122L 1124L User Manual 10 Figure 2 7 Back View of EKI 1122L Figure 2 8 Top View of EKI 1122L...
Страница 18: ...EKI 1121L 1122L 1124L User Manual 12 Figure 2 11 Back View of EKI 1124L Figure 2 12 Top View of EKI 1224L...
Страница 23: ...Chapter 3 3 Installation and Configuration...
Страница 42: ...EKI 1121L 1122L 1124L User Manual 36...
Страница 43: ...Chapter 4 4 Development Guide...
Страница 48: ...EKI 1121L 1122L 1124L User Manual 42...
Страница 49: ...Chapter 5 5 Troubleshooting...
Страница 51: ...Appendix A A Restore the Platform Kernel...
Страница 53: ...Appendix B B Erase JFFS2 File System...
Страница 55: ...Appendix C C Command Collection...
Страница 59: ...53 EKI 1121L 1122L 1124L User Manual Appendix C Command Collection...