Fast swich on-off

hi How do I make a quick on-off digital port?

digitalwrite(1,HIGT); digitalwrite(1,LOW); 140 kHz

I need 5 MHz

thank you

void setup() {
}

void loop() {
  digitalWriteFast(2, HIGH);
  digitalWriteFast(2, LOW);
}

inline void digitalWriteFast(int pin, boolean val) {
  if (val) g_APinDescription[pin].pPort -> PIO_SODR = g_APinDescription[pin].ulPin;
  else    g_APinDescription[pin].pPort -> PIO_CODR = g_APinDescription[pin].ulPin;
}

Big thank you very much :)