RTAI moxa cp114
Cédric <[email protected]> Thu, 28 Dec 2017 11:59:08 +0100
| Newsgroups | gmane.linux.real-time.rtai |
|---|---|
| Message-ID | <CABV3n8-ruagba+BshLiAKY6i4QGmmS-Z5_UaxVG2DPWOW1G8Kg@mail.gmail.com> |
Dear RTAI users,
I use moxa series CP-114 RTAI3.8 multiport cards. I'm trying to upgrade
from version 3.8 to version 5.1 of RTAI.
With 3.8, I loaded the 16660A module (insmod ./rtai_16550A.ko
io=0x3f8,0x2f8,0xcc00,0xcc08,0xcc10,0xcc18 irq=4,3,17,17,17,17
baud_base=115200,115200,921600,921600,921600,921600 start_index=0)
Here is my C program :
#define RTSER_FILE1 "rtser4"
static const struct rtser_config ser_config = {
0xFFFF, /* config_mask */
921600, /* baud_rate */
RTSER_NO_PARITY, /* parity */
RTSER_8_BITS, /* data_bits */
RTSER_1_STOPB, /* stop_bits */
RTSER_NO_HAND, /* handshake */
RTSER_DEF_FIFO_DEPTH, /* fifo_depth*/
1000000000LL, /* rx_timeout */
RTSER_DEF_TIMEOUT, /* tx_timeout */
1000000000LL, /* event_timeout */
RTSER_RX_TIMESTAMP_HISTORY, /* timestamp_history */
RTSER_EVENT_RXPEND /* event mask */
};
int fd;
fd = rt_dev_open(RTSER_FILE1, 0);
if(fd<0)
{
if(DEBUG_NET) rt_printk("RS485 : can't open %s (read)\n",
RTSER_FILE1);
return fd;
}
ret = rt_dev_ioctl(fd, RTSER_RTIOC_SET_CONFIG, &ser_config);
return ret;
while(flag)
{
rt_dev_ioctl(fd, RTSER_RTIOC_WAIT_EVENT, &rx_event );
rt_dev_read(fd, &buffer_rx1, sizeof(buffer_rx1));
rt_dev_write(fd, &buffer_tx1, sz);
}
rt_dev_close(fd);
Since the update, I saw that MOXA cards were detected automatically so this
way of using them no longer works. Can you give me a complete code example
to use the new module?
thank you very much
Best regards
_______________________________________________
Rtai mailing list
[email protected]
https://mail.rtai.org/cgi-bin/mailman/listinfo/rtai