projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
USB: coding style fixes (structure naming)
[bertos.git]
/
bertos
/
drv
/
pwm.h
diff --git
a/bertos/drv/pwm.h
b/bertos/drv/pwm.h
index f60986eb374b6a44d0d2c44d1d53f6a4e7db1f42..60ae6e922e4bfee52c7d7e6304f0acb9c39262b6 100644
(file)
--- a/
bertos/drv/pwm.h
+++ b/
bertos/drv/pwm.h
@@
-29,30
+29,52
@@
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
* -->
*
* Copyright 2005 Develer S.r.l. (http://www.develer.com/)
* -->
*
- * \version $Id$
*
*
- * \brief P
WM driver (interface)
+ * \brief P
ulse Width Modulation (PWM) driver.
*
*
- * \version $Id$
* \author Francesco Sacchi <batt@develer.com>
* \author Daniele Basile <asterix@develer.com>
* \author Francesco Sacchi <batt@develer.com>
* \author Daniele Basile <asterix@develer.com>
+ *
+ * $WIZ$ module_name = "pwm"
+ * $WIZ$ module_configuration = "bertos/cfg/cfg_pwm.h"
+ * $WIZ$ module_hw = "bertos/hw/pwm_map.h"
+ * $WIZ$ module_supports = "not avr and not cm3"
*/
#ifndef DRV_PWM_H
#define DRV_PWM_H
#include "hw/pwm_map.h"
*/
#ifndef DRV_PWM_H
#define DRV_PWM_H
#include "hw/pwm_map.h"
+
+#include <cpu/attr.h>
+
+#include CPU_HEADER(pwm)
+
#include <cfg/compiler.h>
#define PWM_MAX_DUTY ((pwm_duty_t)0xFFFF)
#include <cfg/compiler.h>
#define PWM_MAX_DUTY ((pwm_duty_t)0xFFFF)
-#define PWM_MAX_PERIOD 0xFFFF
-#define PWM_MAX_PERIOD_LOG2 16
+#define PWM_MAX_PERIOD
0xFFFF
+#define PWM_MAX_PERIOD_LOG2
16
+/**
+ * PWM type define.
+ */
typedef uint16_t pwm_duty_t;
typedef uint32_t pwm_freq_t;
typedef uint16_t pwm_duty_t;
typedef uint32_t pwm_freq_t;
+
+
+/**
+ * Set PWM polarity of pwm \p dev.
+ */
+INLINE void pwm_setPolarity(PwmDev dev, bool pol)
+{
+ pwm_hw_setPolarity(dev, pol);
+}
+
void pwm_setDuty(PwmDev dev, pwm_duty_t duty);
void pwm_setFrequency(PwmDev dev, pwm_freq_t freq);
void pwm_setDuty(PwmDev dev, pwm_duty_t duty);
void pwm_setFrequency(PwmDev dev, pwm_freq_t freq);
+void pwm_setPolarity(PwmDev dev, bool pol);
void pwm_enable(PwmDev dev, bool state);
void pwm_init(void);
void pwm_enable(PwmDev dev, bool state);
void pwm_init(void);
@@
-61,8
+83,10
@@
void pwm_init(void);
*
* See pwm_test.c for implemntation of these functions.
*/
*
* See pwm_test.c for implemntation of these functions.
*/
-
int
pwm_testRun(void);
+
void
pwm_testRun(void);
int pwm_testSetup(void);
int pwm_testSetup(void);
+/* For backward compatibility */
+#define pwm_testSetUp() pwm_testSetup()
int pwm_testTearDown(void);
#endif /* DRV_PWM_H */
int pwm_testTearDown(void);
#endif /* DRV_PWM_H */