help with Serial.read(baud, config)

Hi guys, I have a question:
Can i use a variable to give a value to config in Serial.begin(baud, config)?
Config is a parameter.
If yes, how?

    configS = ("SERIAL_" +  nBit  + parity + bitStop);
    Serial1.begin(9600, configS); //like this

Can i use a variable to give a value to config in Serial.begin(baud, config)?

Yes.

The definition of the method that takes two arguments is:

    void begin(unsigned long, uint8_t);
    configS = ("SERIAL_" +  nBit  + parity + bitStop);
    Serial1.begin(9600, configS); //like this

No, NOT like that. There are a series of #define statements in HardwareSerial.h that give names to values. But, you can not programmatically construct a name and expect to do anything with it. By the time the preprocessor and compiler are done, names no longer exist.

// Define config for Serial.begin(baud, config);
#define SERIAL_5N1 0x00
#define SERIAL_6N1 0x02
#define SERIAL_7N1 0x04
#define SERIAL_8N1 0x06
#define SERIAL_5N2 0x08
#define SERIAL_6N2 0x0A
#define SERIAL_7N2 0x0C
#define SERIAL_8N2 0x0E
#define SERIAL_5E1 0x20
#define SERIAL_6E1 0x22
#define SERIAL_7E1 0x24
#define SERIAL_8E1 0x26
#define SERIAL_5E2 0x28
#define SERIAL_6E2 0x2A
#define SERIAL_7E2 0x2C
#define SERIAL_8E2 0x2E
#define SERIAL_5O1 0x30
#define SERIAL_6O1 0x32
#define SERIAL_7O1 0x34
#define SERIAL_8O1 0x36
#define SERIAL_5O2 0x38
#define SERIAL_6O2 0x3A
#define SERIAL_7O2 0x3C
#define SERIAL_8O2 0x3E

Thanks a lot guys!

You can break out the various fields:

byte SERIAL_PARITY_NONE = 0x00;
byte SERIAL_PARITY_EVEN = 0x20;
byte SERIAL_PARITY_ODD = 0x30;

byte SERIAL_DATABITS_5 = 0x00;
byte SERIAL_DATABITS_6 = 0x02;
byte SERIAL_DATABITS_7 = 0x04;
byte SERIAL_DATABITS_8 = 0x06;

byte SERIAL_STOPBITS_1 = 0x00;
byte SERIAL_STOPBITS_2 = 0x08;

Then you can OR together the options you want:

byte nBit = SERIAL_DATABITS_7;
byte parity = SERIAL_PARITY_EVEN;
byte bitStop = SERIAL_STOPBITS_2;
byte SerialConfig =  nBit | parity | bitStop;
Serial1.begin(9600, SerialConfig);

If your configuration is in string or character form you just have to use a bunch of 'if' statements to select the numeric value for the text.