I want to access both of the multiplexed I2C and UART pins in the same program. I am programming in Arduino IDE.Can anyone please tell me how to access same pins for different functionalities?
In order to use two different peripherals on the same pins, you have to initialize I2C and de-intialize UART when using I2C and doing the opposite when using UART.
It’s not possible to initialize two different peripherlas on the same pins, concurrently.
You can't. (Well, you can, but you mustn't).
I2C and UART are electrically incompatible bus systems. UART is a Push-Pull system, whereas I2C is an Open-Drain system. The Push-Pull connections will interfere with the Open-Drain outputs and I2C will not function.
If you want to have both you will need to include extra hardware (and the necessary control pins) to physically isolate the different devices from their respective bus when not in use.