2021-11-11 07:31 AM
hi,
i would like to know if there is an API for configuring, starting and stopping the timers (TIM1, TIM2, etc.) i'm interested in setting up a timer as a PWM device. i've come across documentation that talks about functions that can be used to set up a timer as a PWM device (e.g., pwm_apply_state, pwm_config, pwm_enable, etc.) but i can't find any documentation that describes these functions, the name of the library they are in or the header file to include. no can i find examples on how to use the API. i found examples on adding nodes to a device tree and how to use the sysfs interface. but, i would prefer to use a library if it exists.
thank you,
vincent j. buonassisi
Solved! Go to Solution.
2021-11-23 02:12 PM
hi,
thank you for your response. the post was the most helpful. it seems that there is no library to access the timers. the easiest way w/o having to write my own driver was to use c/c++ file i/o calls. i can use either the higher level calls (e.g., fopen, fprintf, etc.) or the low level ones (.e.g, open, write, etc.)
thanks,
vince
2021-11-12 06:59 AM
Hi,
Please have a look to this wiki page which provide links to SW framework usable with TIMx
https://wiki.st.com/stm32mpu/wiki/TIM_internal_peripheral#Software_frameworks
in particular, I see this API https://wiki.st.com/stm32mpu/wiki/PWM_overview#Example_of_PWM_usage_with_kernel_PWM_API
See also this post: https://community.st.com/s/question/0D53W000014W92lSAC/pwm-kernel-driver-api
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-11-22 08:23 AM
Hi,
Did the answer above helped you ?
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-11-23 02:12 PM
hi,
thank you for your response. the post was the most helpful. it seems that there is no library to access the timers. the easiest way w/o having to write my own driver was to use c/c++ file i/o calls. i can use either the higher level calls (e.g., fopen, fprintf, etc.) or the low level ones (.e.g, open, write, etc.)
thanks,
vince