Hi @Hamza_Hassan,
Hope you are doing well.
One can check the Available mux options of the pin which is configured as a RS232 Transmitter in RM. If the possible pad is GPIO*, then you can configure the same pin as a GPIO for transmitting IR signal.
Please note that once you configure this pin as a GPIO, After that you will not be able to use the same pin as Rs232 Transmitter.
Thanks & Regards,
Ritesh M Patel