1 - Set your port pin to GPIO mode, just as if you wanted to use it as normal output.
2 - Get the #defines from the include file I've attached.
3 - Use the code below
pin_number is in range 0...15.
value is one of the empirical values from one of my previous posts.
I never tried to fully understand how the PWM values work.
uint32 pinaddr = GPIO_PIN_ADDR(GPIO_ID_PIN(pin_number));
GPIO_REG_WRITE(pinaddr, GPIO_REG_READ(pinaddr) | 1);
GPIO_REG_WRITE(GPIO_SIGMA_DELTA, pwm_value);
I've also attached my full relay driver source file. That's most likely not gonna compile outside of my project, but could have some use as an example anyway.