[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
CC65 ssc library doesn't support "No handshake" serial communication.
- Subject: CC65 ssc library doesn't support "No handshake" serial communication.
- From: bluebird <mildstorm@gmail.com>
- Date: Tue, 16 Apr 2013 08:47:46 -0700 (PDT)
- Complaints-to: groups-abuse@google.com
- Injection-date: Tue, 16 Apr 2013 15:47:47 +0000
- Injection-info: glegroupsg2000goo.googlegroups.com; posting-host=124.53.67.66; posting-account=59zgiAoAAAD1UBiNbwKTnEqZIAtVrM7Y
- Newsgroups: comp.sys.apple2
- User-agent: G2/1.0
I tested cc65 serial communication today.
ser seems to support next 3 handshake protocols.
/* Handshake settings. The latter two may be combined. */
#define SER_HS_NONE 0x00 /* No handshake */
#define SER_HS_HW 0x01 /* Hardware (RTS/CTS) handshake */
#define SER_HS_SW 0x02 /* Software handshake */
Actually, ser_open will crash whenever I use SER_HS_NONE.
My serial cable only use TX/RX/GND. So I don't want to use SER_HS_HW
protocol which use many other signals.
(When I use SER_HS_HW parameter, ser_open works well with my other cable).
-------------------------------------------------------------------------
#define DRIVERNAME "a2e.ssc.ser"
static const struct ser_params Params =
{
SER_BAUD_19200, /* Baudrate */
SER_BITS_8, /* Number of data bits */
SER_STOP_1, /* Number of stop bits */
SER_PAR_NONE, /* Parity setting */
SER_HS_NONE /* Type of handshake to use */
};
static void CheckError (const char* funcName, unsigned char errorNo)
{
if (errorNo != SER_ERR_OK)
{
switch (errorNo)
{
case SER_ERR_INIT_FAILED : /* Initialization failed */
fprintf (stderr, "Error Occurred : %s \n", funcName);
fprintf (stderr, " => %s \n", "SER_ERR_INIT_FAILED");
exit (EXIT_FAILURE);
break;
....
}
}
}
int main (void)
{
unsigned char ret;
unsigned char ch;
CheckError ("ser_load_driver", ser_load_driver (DRIVERNAME));
CheckError ("ser_open", ser_open (&Params)); // <- Crash here!
....
}
Is there any other serial library which support "no handshake"?
Thanks.