Hello Sudhakar,
First of all, you should understand data format in UART module, lets suppose LSB is sent first.
If you select 8-bit data format and enable parity bit, 7 are reserved for data and the one (MSB) is reserved for parity (either odd or even) as shown below:
Internal hardware checks parity bit according to parity mode selected (even or odd) and it sets/clears the flag if there is a parity error on received character, so, if you are using this mode, you should read 8 bits and then mask the 8th bit to discard parity bit (hardware already checks for parity error):
uint8_t received_data, parity, real_data;
UART_HAL_Getchar(base, &received_data);
real_data = received_data & 0x7F;
parity = (received_data & 0x80) >> 7;
When you try to use 8 data bits and add an aditional parity bit, you should enable 9 bit transmission (8 data + 1 parity) and data format is:

In this case, we need to read 9 bits (8 bits are read in UARTx_D register and MSB bit is read in UARTx_C3[R8] flag),so, it is neccesary to read C3 before reading D register. Again, internal hardware checks for parity bit and sets/clears correspoding flag if there is a parity error. For KSDK 1.2.0 drivers, there is a function that allows user to read/write 9 bits:
UART_HAL_Getchar9(base, &data_16_bits);
Current UART driver in KSDK does use 8 bit data format with no parity, so, you should consider masking the MSB bit if parity is enabled.
Attach you can find a basic project using UART_HAL functions that KSDK provides in order to read 8 or 9 bits. I check both versions and it works well (even though i had problems on 8 bit format because Putty does not uses 7 data + 1 parity bit but if you apply this technique when communicating two boards you will see that communication is stablished correctly.)
I hope this can serve as guidance in order to create your own driver.
Note: For Stop bits, it should be no problem when chaning from 1 to 2, due these bits are internally managed.
Best Regards,
Isaac
----------------------------------------------------------------------------------------------------------------------------------------
Note: If this post answers your question, please click the Correct Answer button. Thank you!
----------------------------------------------------------------------------------------------------------------------------------------