[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

CC65 ssc library doesn't support "No handshake" serial communication.



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.