Resolves #176
Signed-off-by: Thomas Ingleby <thomas.c.ingleby@intel.com>
*/
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
{
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;
}
return MRAA_SUCCESS;
}
+
+int
+mraa_pwm_get_max_period()
+{
+ if (plat == NULL) {
+ return -1;
+ }
+ return plat->pwm_max_period;
+}
+
+int
+mraa_pwm_get_min_period()
+{
+ if (plat == NULL) {
+ return -1;
+ }
+ return plat->pwm_min_period;
+}