P CHANNEL MOSFET gate directly GPIO
You can drive an mosfet directly from the GPIO things. But you need to make sure it will work:


The Vgs (V gate-source) threshold is when the mosfet turns on. The GPIO voltage should be able to get above this. Generally a mosfet that does this is called a logic level mosfet.
The gate capacitance should not exceed the drive capabilities of the GPIO.
This is easily solved by simply adding a resistor of ~100 ohm.
The switch-on time meets your requirements. This might be slower than with a gate driver, and can cause extras losses in the mosfet when switching high currents.


This is for an N-channel. That is easy.
There are extra difficulties with a P-channel. Since the voltage to turn the P-channel off should not exceed the maximum level of the GPIO. This will typically be a maximum of 5V on five volt tolerant IO.
Meaning switching a p-fet directly on GPIO is not possible when switching more than 5V.

In case of your NDP6020P, the Vgs(th) graph looks like this:


When Vgs is &lt; 1 Volt, the fet is not conducting. The pullup to Vcc will do this.
When Vgs is > 2 Volt, the fet is conducting. Shorting gate to ground will do this.
The absolute gate voltage may not exceed the maximum GPIO voltage.

Typical circuit, including MCU internals:







simulate this circuit &ndash; Schematic created using CircuitLab

As you see. The 5V, or switched load voltage, may never exceed Vcc/Vdd of the MCU!