pwm: add calls for getting PWM max and min period
Resolves #176 Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
This commit is contained in:
@@ -186,6 +186,20 @@ mraa_result_t mraa_pwm_config_ms(mraa_pwm_context dev, int period, float duty);
|
||||
*/
|
||||
mraa_result_t mraa_pwm_config_percent(mraa_pwm_context dev, int period, float duty);
|
||||
|
||||
/**
|
||||
* Get the maximum pwm period in us
|
||||
*
|
||||
* @return max pwm in us
|
||||
*/
|
||||
int mraa_pwm_get_max_period();
|
||||
|
||||
/**
|
||||
* Get the minimum pwm period in us
|
||||
*
|
||||
* @return min pwm in us
|
||||
*/
|
||||
int mraa_pwm_get_min_period();
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
@@ -204,6 +204,26 @@ class Pwm
|
||||
{
|
||||
return mraa_pwm_config_percent(m_pwm, period, duty);
|
||||
}
|
||||
/**
|
||||
* Get the maximum pwm period in us
|
||||
*
|
||||
* @return max pwm in us
|
||||
*/
|
||||
int
|
||||
max_period()
|
||||
{
|
||||
return mraa_pwm_get_max_period();
|
||||
}
|
||||
/**
|
||||
* Get the minimum pwm period in us
|
||||
*
|
||||
* @return min pwm in us
|
||||
*/
|
||||
int
|
||||
min_period()
|
||||
{
|
||||
return mraa_pwm_get_min_period();
|
||||
}
|
||||
|
||||
private:
|
||||
mraa_pwm_context m_pwm;
|
||||
|
||||
Reference in New Issue
Block a user