Serial Configuration

22 Jun 2009

I want to configure the serial port for 115k baud 8N1. The user manual suggested the format is

void format( int  bits,
  int  parity,
  int  stop )

Set the transmission format used by the Serial port
Variables

bits The number of bits in a word (5-8; default = 8)
parity The type of parity used (None, Odd, Even, Forced1, Forced0; default = None)
stop The number of stop bits (1 or 2; default = 1)

if i type in

Serial UART0(13, 14);        
UART0.baud(115000);
UART0.format(8,None,1);

the word None is not identified. I presume this should be a number and there should be table of the different options available cross referencing this to  a number. What is the number for no parity ?

Best Regards

David Giles

 

22 Jun 2009

Hi David,

I want to configure the serial port for 115k baud 8N1

:

if i type in

Serial UART0(13, 14);        
UART0.baud(115000);
UART0.format(8,None,1);

the word None is not identified

Ah, sorry about that. It is an enumeration defined within the Serail class. So if you do:

Serial UART0(13, 14);        
UART0.baud(115000);
UART0.format(8, Serial::None, 1);

you should be fine. We'll file a documationation bug.

Simon