corrected defines needed when parity is used

When the parity control is enabled, the computed parity is inserted at the MSB position (9th bit if M=1; 8th bit if M=0) and parity is checked on the received data. This excludes 9 bit long words + parity bit.
This commit is contained in:
stevstrong 2015-11-19 11:50:13 +01:00
parent b81d7b7334
commit 17cbf256d1
1 changed files with 9 additions and 6 deletions

View File

@ -83,22 +83,25 @@ struct usart_dev;
*/
// Define config for Serial.begin(baud, config);
// Note. STM32 doesn't support as many different Serial modes as AVR or SAM cores.
// The word legth bit M must be set when using parity bit.
#define SERIAL_8N1 0B00000000
#define SERIAL_8N2 0B00100000
#define SERIAL_9N1 0B00001000
#define SERIAL_9N2 0B00101000
#define SERIAL_8E1 0B00000010
#define SERIAL_8E2 0B00100010
#define SERIAL_8E1 0B00001010
#define SERIAL_8E2 0B00101010
/* not supported:
#define SERIAL_9E1 0B00001010
#define SERIAL_9E2 0B00101010
#define SERIAL_8O1 0B00000011
#define SERIAL_8O2 0B00100011
*/
#define SERIAL_8O1 0B00001011
#define SERIAL_8O2 0B00101011
/* not supported:
#define SERIAL_9O1 0B00001011
#define SERIAL_9O2 0B00101011
*/
/* Roger Clark
* Moved macros from hardwareSerial.cpp