RAK3172 PWM : udrv_pwm_* functions

Hello,

I have found some udrv_pwm_* functions into the RUI API (v4.2.0). I would like to use a PWM, for a buzzer.

Into the neader file, I could find port definition : typedef enum {
UDRV_PWM_0 = 0x0,
UDRV_PWM_1 = 0x1,
UDRV_PWM_2 = 0x2,
UDRV_PWM_MAX = 0x3,
} udrv_pwm_port;

We can configure the pwm port with the corresponding pin.

void udrv_pwm_init(udrv_pwm_port port, uint32_t freq_hz, uint8_t is_invert, uint32_t pin);

I could not find the working pins of the rak3172, that can be used, by this function.

please, could you told me :

  • if theses functions are working
  • the maximum frequency, we can use
  • pins that can we used for this function (PA0, PA1 ?)

Thank you in advanced for your help and best regards,
Jean-Michel

The STM32WLE datasheet is quite vague on this subject. There is only some general information about PWM in it.

From the datasheet it looks like you can use PWM only on pins that can be used as timer output.

Seems it works only with PA0 and PA1 (TIM2_CH1 and TIM2_CH2) ==> List of PWM-capable pins for RAK3172 via RUI3

Other discussions:
RAK3172 PWM provide only 186kHz maximum frequency
RAK3172 PWM tone function is working only with build-in LEDs