AN93
Rev. 1.4
279
BOOL bSuccess;
hCom = CreateFile(pcCommPort, GENERIC_READ | GENERIC_WRITE, 0,
NULL, OPEN_EXISTING, 0, NULL);
if (hCom == INVALID_HANDLE_VALUE)
{ // Handle the error.
printf ("CreateFile failed with error %d.\n", GetLastError());
exit(1);
}
// Build on the current configuration, and skip setting the size
// of the input and output buffers with SetupComm.
bSuccess = GetCommState(hCom, &dcb);
if (!bSuccess)
{
// Handle the error.
printf ("GetCommState failed with error %d.\n", GetLastError());
exit(1);
}
// Fill in DCB: 57,600 bps, 8 data bits, no parity, and 1 stop bit.
dcb.fBinary = TRUE; // Binary mode; no EOF check
dcb.fOutxCtsFlow = FALSE; // No CTS output flow control
dcb.fOutxDsrFlow = FALSE; // No DSR output flow control
dcb.fDtrControl = DTR_CONTROL_ENABLE; // DTR flow control type
dcb.fDsrSensitivity = FALSE; // DSR sensitivity
dcb.fTXContinueOnXoff= TRUE; // XOFF continues Tx
dcb.fOutX = FALSE; // No XON/XOFF out flow control
dcb.fInX = FALSE; // No XON/XOFF in flow control
dcb.fErrorChar = FALSE; // Disable error replacement
dcb.fNull = FALSE; // Disable null stripping
dcb.fRtsControl = RTS_CONTROL_ENABLE; // assert RTS
dcb.fAbortOnError = FALSE; // Do not abort rds/wr on error
dcb.BaudRate = CBR_115200; // set the baud rate
dcb.ByteSize = 8; // data size, xmit, and rcv
dcb.Parity = NOPARITY; // no parity bit
dcb.StopBits = ONESTOPBIT; // one stop bit
bSuccess = SetCommState(hCom, &dcb);
if (!bSuccess)
{ // Handle the error.
printf ("SetCommState failed with error %d.\n", GetLastError());
exit(1);
}
printf ("Serial port %s successfully initialized.\n", pcCommPort);
return;
}
// -------------------------------------------------------------------------------
char *SendAndWaitFor(char *cpCommand, char *cpInBuffRd,
Содержание Si2404
Страница 2: ...AN93 2 Rev 1 4 ...
Страница 27: ...AN93 Rev 1 4 27 Figure 7 Parallel Interface Read Timing Figure 8 Parallel Interface Write Timing ...
Страница 200: ...AN93 200 Rev 1 4 Figure 31 TAM Handset and Speakerphone Voice Paths ...
Страница 201: ...AN93 Rev 1 4 201 Figure 32 Si3000 Codec Gain and Signal Selection Options ...
Страница 290: ...AN93 290 Rev 1 4 Figure 57 256 Band Spectral Display Figure 58 2048 Band Spectral Display ...
Страница 305: ...AN93 Rev 1 4 305 Figure 76 Parallel or SPI Port Interrupt Service Flowchart ...