Seeed XIAO nRF52840 sense pwm frequency change

How do i change the frequency of pwm signal ?

I basically want to generate a square wave signal of 1vpp , 50% duty cycle and variable frequency.
in AppData\Local\Arduino15\packages\Seeeduino\hardware\nrf52\1.1.1\cores\nRF5
i found a file called hardwarepwm.cpp in which theres code
void HardwarePWM::setClockDiv(uint8_t div)
{
_clock_div = min8(div, PWM_PRESCALER_PRESCALER_DIV_128);
_pwm->PRESCALER = _clock_div;
}

i am unable to understand how to use this.