int86(0x33,®s,®s);
| } |
|
|
|
00 | Set Communication parameters |
|
| |
| Entry Parameters: | AH = 0 | BIT # |
|
|
|
| 76543210 |
|
|
| AL = bit 0 | xxxxxxx0 | 7 data bits |
|
|
| xxxxxxx1 | 8 data bits |
|
| bit 1 | xxxxxx0x | 1 stop bit |
|
|
| xxxxxx1x | 2 stop bits |
|
| bit | xxxx00xx NONE parity | |
|
|
| xxxx01xx ODD parity | |
|
|
| xxxx11xx EVEN parity | |
|
| bit | 0000xxxx | 110 baud rate |
|
|
| 0001xxxx | 150 baud rate |
|
|
| 0010xxxx | 300 baud rate |
|
|
| 0011xxxx | 600 baud rate |
|
|
| 0100xxxx | 1200 baud rate |
|
|
| 0101xxxx | 2400 baud rate |
|
|
| 0110xxxx 4800 baud rate | |
|
|
| 0111xxxx | 9600 baud rate |
|
|
| 1000xxxx 19200 baud rate | |
| Return Values: | None | 1001xxxx 38400 baud rate | |
|
|
|
void TC_485_parameter(long baud,int parity,int stop,int data)
{
unsigned char cc=0; unsigned int i_baud;
i_baud = (int)(baud / 10L); switch (i_baud)
{
case 11 : cc=0x00; break;
case 15 : cc=0x10; break;
case 30 : cc=0x20; break;
case 60 : cc=0x30; break;
case 120 : cc=0x40; break;
case 240 : cc=0x50; break;
case 480 : cc=0x60; break;
case 1920 : cc=0x80; break;
case 3840 : cc=0x90; break;