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) |
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.
|
Configure a 37e12's mode and baud rate
Definition at line 749 of file Coprocessor.c. |
|
Write data to a serial port
Definition at line 717 of file Coprocessor.c. |