Use IR receiver/transmitter via GPIO

Hi,

I have HA installed on my Raspberry Pi 4 (0.108.3). I am quite new with HA, but I understand I could control Raspberry GPIO ports with rpi_gpio integration. Then, would it be possible to directly plug a IR receiver and a IR transmitter to the GPIO ports and control them with HA?
I see a lot of tutorials using lirc, but I understand we cannot install lirc libraries on HA, so it’s of no use.
Thanks.

I think it’s easier to use an external device (wemos d1 mini, for example) for this.

Ok, thanks for the tip.
I’m thinking about another solution, actually. I have a Raspberry, plugged in USB to an Arduino Mega, which is itself plugged to IR receiver+transmitter and RF receiver+transmitter. I would like to use them altogether. I understand I could use MQTT but fom the documentation, I can’t understand how I would need to connect them and if I really need another hardware, such as a ETH ou Wifi board.
Could you please help me sorting this out a little by telling me briefly which hardware I would really need? And actually do I really need some other software or can’t they just connect and communicate via USB?
Thanks