projects
/
bertos.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Switch to new disk write interface:the disk should now supply the write buffer.
[bertos.git]
/
bertos
/
drv
/
pwm.h
diff --git
a/bertos/drv/pwm.h
b/bertos/drv/pwm.h
index 03d98453499af5f23a6fb4643a414acfefebc1b9..f2c651b10df6f1946dd2ee9a146f3dda7ef396d6 100644
(file)
--- a/
bertos/drv/pwm.h
+++ b/
bertos/drv/pwm.h
@@
-35,19
+35,52
@@
*
* \version $Id$
* \author Francesco Sacchi <batt@develer.com>
*
* \version $Id$
* \author Francesco Sacchi <batt@develer.com>
+ * \author Daniele Basile <asterix@develer.com>
*/
#ifndef DRV_PWM_H
#define DRV_PWM_H
*/
#ifndef DRV_PWM_H
#define DRV_PWM_H
-#include <pwm_map.h>
+#include "hw/pwm_map.h"
+
+#include <cpu/attr.h>
+
+#include CPU_HEADER(pwm)
+
#include <cfg/compiler.h>
#include <cfg/compiler.h>
+#define PWM_MAX_DUTY ((pwm_duty_t)0xFFFF)
+#define PWM_MAX_PERIOD 0xFFFF
+#define PWM_MAX_PERIOD_LOG2 16
+
+/**
+ * PWM type define.
+ */
typedef uint16_t pwm_duty_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_setDuty(PwmDev dev, pwm_duty_t duty);
+void pwm_setFrequency(PwmDev dev, pwm_freq_t freq);
+void pwm_enable(PwmDev dev, bool state);
void pwm_init(void);
void pwm_init(void);
-#define PWM_MAX_DUTY 100
+/**
+ * Test function prototypes.
+ *
+ * See pwm_test.c for implemntation of these functions.
+ */
+int pwm_testRun(void);
+int pwm_testSetUp(void);
+int pwm_testTearDown(void);
#endif /* DRV_PWM_H */
#endif /* DRV_PWM_H */