Main Page   Modules   Alphabetical List   Data Structures   File List   Data Fields   Related Pages  

e12_serial - Serial.c


Data Structures

struct  Serconfig

Defines

#define RS232PORT   0
#define RS422PORT   1
#define EIGHT_BIT   0x00
#define NINE_BIT   0x10

Typedefs

typedef Serconfig Serconfig

Functions

int E12_Serial_Config (int fd, int port, int baud, int mode)
int E12_Serial_Write (int fd, int port, int numchars, char *buffer)

Detailed Description

This module is used to build the e12_serial application. The e12_serial program is used to set the baud rate of the 37e12's serial ports and to send/receive data over them.

Serial ports on the 37e12 are asychronous devices, and as such, can receive data at any time. Parsed serial data is stored as a string in Cop_Data.RS232_string or Cop_Data.RS422_string depending on the port that received it. The maximum size of this string is RS232BUFSIZE or RS422BUFSIZE. It gets cat'ed to with each received data packet. To see exactly what happens look in the CopParsePacket function inside the switch statement for the SER232 and SER422 cases.

To reset these strings just write a zero to the first element of the string, the cat functions will then start overwriting from that point.

received data sets the BITMASK(SER232) and BITMASK(SER422) bits for new received data on the 232 or 422 ports respectively. This is typically redundant however as it will also result in a stringlen>0 with the Cop_Data structure's RXxxx_string elements.


Function Documentation

int E12_Serial_Config int    fd,
int    port,
int    baud,
int    mode
 

Configure a 37e12's mode and baud rate

Parameters:
fd  file descriptor of the 37e12
port  port to address RS232PORT or RS422PORT
baud  the baud rate
mode  EIGHT_BIT OR NINE_BIT

Definition at line 749 of file Coprocessor.c.

int E12_Serial_Write int    fd,
int    port,
int    numchars,
char *    buffer
 

Write data to a serial port

Parameters:
fd  file descriptor of the 37e12

Definition at line 717 of file Coprocessor.c.


Generated on Thu Jan 8 09:51:01 2004 for PCM-37e12 by doxygen1.2.15