Power supply for an external LCD module with the ability to turn it off

Hello, all! I need to power an external LCD display (5v DC, max current consumption is 300 mA). I want power to be supplied to the LCD when the BPI-R4 is powered on, and for it to be turned off when a “poweroff” command is issued from the Linux shell. Where can I get such controlled power? Possibly from the GPIO 26-pin header (pin 2,4)?

And one more question: I could not find any information on the maximum current the 5V GPIO (CON2, GPIO 26-pin header) can provide on pins 2 and 4?

Thank you in advance.

Usually you can use any buck converter with an enable pin.

But be careful, you may want to check the voltage on that enable pin, as it might have a pull-up resistor to high 5V. This is too high for your GPIO pin, if using a GPIO output pin for control.

So then use an opto-coupler or an i2c voltage converter module.