Simulate initialization of a UART peripheral with optional configuration parameters.
You must create a function that:
N' (no parity).1.The function must print the final UART configuration in this order:
baud parity stopBitsIn main():
baud and mode.mode == 0baud (use both defaults).mode == 1parity, call the function with baud and parity (use default stop bits).mode == 2parity and an integer stopBits, call the function with all three arguments.Example 1
Input:
9600 0Output:
9600 N 1
Example 2
Input:
115200 1 EOutput:
115200 E 1
Example 3
Input:
38400 2 O 2Output:
38400 O 2
Constraints:
Input
9600 0
Expected Output
9600 N 1