Arduino uno r4 wifi direct register access method

I am new to embedded systems, just bought myself a Arduino UNO R4 WIFI board running the Renesas RA4M1 Arm Cortex MC. I was trying to get the inbuilt LED to blink , using all the available schematics and recommended codes, but I can't get it to work using the direct register approach. I can get it to work using the pinMode etc. commands on the Arduino IDE, but not using the direct register approach.

I would like any advice in this regard.

For Uno R4 WiFi:

void setup() {
   R_PORT1->PDR |= bit(2);
}

void loop() {
   R_PORT1->PODR |= bit(2);
   delay(250);
   R_PORT1->PODR &= ~bit(2);
   delay(250);
}

Thanks for the reply.

I tested it and it worked perfectly. I spent a lot of time and tried so many things, but didn't work so far. I had tested this program and it didn't work earlier, but I thought that the inbuilt LED is bit 3. Thanks for clearing this and I owe you very much.