new Uart16550 for SCEX, try stop bits
EIVE/eive-obsw/pipeline/head This commit looks good Details

This commit is contained in:
Robin Müller 2022-10-05 18:13:49 +02:00
parent 3fa2c63a03
commit c5e5df03d9
No known key found for this signature in database
GPG Key ID: 11D4952C8CCEF814
2 changed files with 13 additions and 6 deletions

View File

@ -15,7 +15,7 @@ static constexpr char UART_PLOC_MPSOC_DEV[] = "/dev/ul-plmpsoc";
static constexpr char UART_PLOC_SUPERVSIOR_DEV[] = "/dev/ul-plsv";
static constexpr char UART_SYRLINKS_DEV[] = "/dev/ul-syrlinks";
static constexpr char UART_STAR_TRACKER_DEV[] = "/dev/ul-str";
static constexpr char UART_SCEX_DEV[] = "/dev/ul-scex";
static constexpr char UART_SCEX_DEV[] = "/dev/ttyS3";//"/dev/ul-scex";
static constexpr char UIO_PDEC_REGISTERS[] = "/dev/uio0";
static constexpr char UIO_PTME[] = "/dev/uio1";

View File

@ -107,7 +107,14 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
}
// Setting up UART parameters
tty.c_cflag &= ~PARENB; // Clear parity bit
tty.c_cflag &= ~CSTOPB; // Clear stop field, only one stop bit used in communication
if (uartCookie->getStopBits() == StopBits::TWO_STOP_BITS) {
// Use two stop bits
tty.c_cflag |= CSTOPB;
} else {
// Clear stop field, only one stop bit used in communication
tty.c_cflag &= ~CSTOPB;
}
tty.c_cflag &= ~CSIZE; // Clear all the size bits
tty.c_cflag |= CS8; // 8 bits per byte
tty.c_cflag &= ~CRTSCTS; // Disable RTS/CTS hardware flow control
@ -120,12 +127,12 @@ ReturnValue_t ScexUartReader::initializeInterface(CookieIF *cookie) {
tty.c_cc[VTIME] = 0;
tty.c_cc[VMIN] = 0;
// Q7S UART Lite has fixed baud rate. For other linux systems, set baud rate here.
#if !defined(XIPHOS_Q7S)
if (cfsetispeed(&tty, B57600) != 0) {
// The SCEX experiment has a fixed baud rate. For other linux systems, set baud rate here.
//#if !defined(XIPHOS_Q7S)
if (cfsetispeed(&tty, B38400) != 0) {
sif::warning << "ScexUartReader::initializeInterface: Setting baud rate failed" << std::endl;
}
#endif
//#endif
if (tcsetattr(serialPort, TCSANOW, &tty) != 0) {
sif::warning << "ScexUartReader::initializeInterface: tcsetattr call failed with error ["