2021-09-13 04:12 AM
Hi all,
I wish to perform PWM for certain leds connected to STM32MP1 pins.
I wish to do it from the user space application.
I got it working via sysfs interface , but I am more interested in controlling it via a user space application based on some logic. How can I do this ?
Is there API documentation for it?
TIA
Solved! Go to Solution.
2021-09-15 05:10 AM
Hi,
I'm not SW expert, but for me the pwm_device content is retrieved (mostly from DT I guess) by some available pwm kernel functions.
See https://www.kernel.org/doc/html/latest/driver-api/miscellaneous.html#c.pwm_get
This is not related to ST drivers, but supported by kernel, I think the example for Rockchip you pointed is probably working on STM32MP1 without much issues.
Regards.
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2021-09-13 04:45 AM
Hi,
Did you already found this wiki https://wiki.st.com/stm32mpu/wiki/PWM_overview#Example_of_PWM_usage_with_kernel_PWM_API ?
Regards.
2021-09-14 02:50 AM
Hi @PatrickF ,
Thanks for the response.
I did went through it but it just mentions data for device tree configuration. There is no help around how can I use the driver in custom application.
Can you please help me get more details around this ? I really appreciate the help.
2021-09-15 12:02 AM
Hi,
Have you seen this 'C' example links on that wiki page ?
Several in-kernel drivers use kernel PWM API. Below a few examples:
API is documented here : https://www.kernel.org/doc/html/latest/driver-api/pwm.html
Regards.
2021-09-15 04:39 AM
Hi @PatrickF : Thanks for the response. I can see how the API is used in the pwm-beeper.c but my concern is again at the ground level as to what data is passed into the struct pwm_device which is used in beeper.
I am looking for an example which somewhat guides to use STM32MP1 PWM like this. Also there isn't much documentation as to how to populate that structure with correct value though API interface seems clean.
2021-09-15 05:10 AM
Hi,
I'm not SW expert, but for me the pwm_device content is retrieved (mostly from DT I guess) by some available pwm kernel functions.
See https://www.kernel.org/doc/html/latest/driver-api/miscellaneous.html#c.pwm_get
This is not related to ST drivers, but supported by kernel, I think the example for Rockchip you pointed is probably working on STM32MP1 without much issues.
Regards.
In order to give better visibility on the answered topics, please click on 'Select as Best' on the reply which solved your issue or answered your question. See also 'Best Answers'
2021-09-16 04:35 AM
Hi @PatrickF : Thank you so much for response will take a look.