git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@2407 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
66c5a970fa
commit
af0a2cee78
|
@ -262,12 +262,12 @@ struct PWMDriver {
|
||||||
* @note The calculated value must fit into an unsigned 16 bits integer.
|
* @note The calculated value must fit into an unsigned 16 bits integer.
|
||||||
*
|
*
|
||||||
* @param[in] pwmclk PWM clock frequency in cycles
|
* @param[in] pwmclk PWM clock frequency in cycles
|
||||||
* @param[in] pwmperiod PWM cycle period in microseconds
|
* @param[in] pwmperiod PWM cycle period in nanoseconds
|
||||||
* @return The value to be stored in the @p pc_arr field of the
|
* @return The value to be stored in the @p pc_arr field of the
|
||||||
* @p PWMConfig structure.
|
* @p PWMConfig structure.
|
||||||
*/
|
*/
|
||||||
#define PWM_COMPUTE_ARR(pwmclk, pwmperiod) \
|
#define PWM_COMPUTE_ARR(pwmclk, pwmperiod) \
|
||||||
((uint16_t)(((pwmclk) / (1000000 / (pwmperiod))) - 1))
|
((uint16_t)(((pwmclk) / (1000000000 / (pwmperiod))) - 1))
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Converts from fraction to pulse width.
|
* @brief Converts from fraction to pulse width.
|
||||||
|
|
Loading…
Reference in New Issue