aboutsummaryrefslogtreecommitdiffstats
path: root/os/hal/templates/pwm_lld.c
diff options
context:
space:
mode:
Diffstat (limited to 'os/hal/templates/pwm_lld.c')
-rw-r--r--os/hal/templates/pwm_lld.c41
1 files changed, 39 insertions, 2 deletions
diff --git a/os/hal/templates/pwm_lld.c b/os/hal/templates/pwm_lld.c
index a849bf774..f8744e478 100644
--- a/os/hal/templates/pwm_lld.c
+++ b/os/hal/templates/pwm_lld.c
@@ -39,6 +39,13 @@
/* Driver exported variables. */
/*===========================================================================*/
+/**
+ * @brief PWM1 driver identifier.
+ */
+#if PLATFORM_PWM_USE_PWM1 || defined(__DOXYGEN__)
+PWMDriver PWMD1;
+#endif
+
/*===========================================================================*/
/* Driver local variables. */
/*===========================================================================*/
@@ -62,6 +69,10 @@
*/
void pwm_lld_init(void) {
+#if PLATFORM_PWM_USE_PWM1
+ /* Driver initialization.*/
+ pwmObjectInit(&PWMD1);
+#endif /* PLATFORM_PWM_USE_PWM1 */
}
/**
@@ -74,9 +85,15 @@ void pwm_lld_init(void) {
void pwm_lld_start(PWMDriver *pwmp) {
if (pwmp->state == PWM_STOP) {
- /* Clock activation.*/
+ /* Enables the pehipheral.*/
+#if PLATFORM_PWM_USE_PWM1
+ if (&PWMD1 == pwmp) {
+
+ }
+#endif /* PLATFORM_PWM_USE_PWM1 */
}
- /* Configuration.*/
+ /* Configures the peripheral.*/
+
}
/**
@@ -88,6 +105,16 @@ void pwm_lld_start(PWMDriver *pwmp) {
*/
void pwm_lld_stop(PWMDriver *pwmp) {
+ if (pwmp->state == PWM_READY) {
+ /* Resets the peripheral.*/
+
+ /* Disables the peripheral.*/
+#if PLATFORM_PWM_USE_PWM1
+ if (&PWMD1 == pwmp) {
+
+ }
+#endif /* PLATFORM_PWM_USE_PWM1 */
+ }
}
/**
@@ -108,6 +135,9 @@ void pwm_lld_stop(PWMDriver *pwmp) {
*/
void pwm_lld_change_period(PWMDriver *pwmp, pwmcnt_t period) {
+ (void)pwmp;
+ (void)period;
+
}
/**
@@ -128,6 +158,10 @@ void pwm_lld_enable_channel(PWMDriver *pwmp,
pwmchannel_t channel,
pwmcnt_t width) {
+ (void)pwmp;
+ (void)channel;
+ (void)width;
+
}
/**
@@ -146,6 +180,9 @@ void pwm_lld_enable_channel(PWMDriver *pwmp,
*/
void pwm_lld_disable_channel(PWMDriver *pwmp, pwmchannel_t channel) {
+ (void)pwmp;
+ (void)channel;
+
}
#endif /* HAL_USE_PWM */