summaryrefslogtreecommitdiff
path: root/chip/stm32/pwm_chip.h
diff options
context:
space:
mode:
authorBill Richardson <wfrichar@chromium.org>2013-10-28 12:48:26 -0700
committerchrome-internal-fetch <chrome-internal-fetch@google.com>2013-10-28 23:38:16 +0000
commitf20ed63c17fe0af9acee3ce774b73d70545e5ea3 (patch)
treeec8f8f7ab3a3b9beda10b2a6dd7ebf81cae6fd8d /chip/stm32/pwm_chip.h
parent6aaab6ab0b12f7cc71b126dd19ebf8e50b7462e4 (diff)
downloadchrome-ec-f20ed63c17fe0af9acee3ce774b73d70545e5ea3.tar.gz
Rename pwm_data.h to pwm_chip.h
To conform to our mutating naming conventions, let's rename the chip-specific PWM header file to have the string "_chip" in it. BUG=chrome-os-partner:18343 BRANCH=none TEST=build all platforms; pass unit tests Change-Id: I6584be8e54fd24c8638559817e150c707bc0edb5 Signed-off-by: Bill Richardson <wfrichar@chromium.org> Reviewed-on: https://chromium-review.googlesource.com/174884 Reviewed-by: Randall Spangler <rspangler@chromium.org>
Diffstat (limited to 'chip/stm32/pwm_chip.h')
-rw-r--r--chip/stm32/pwm_chip.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/chip/stm32/pwm_chip.h b/chip/stm32/pwm_chip.h
new file mode 100644
index 0000000000..d588dabeaa
--- /dev/null
+++ b/chip/stm32/pwm_chip.h
@@ -0,0 +1,37 @@
+/* Copyright (c) 2013 The Chromium OS Authors. All rights reserved.
+ * Use of this source code is governed by a BSD-style license that can be
+ * found in the LICENSE file.
+ */
+
+/* STM32-specific PWM module for Chrome EC */
+
+#ifndef __CROS_EC_STM32_PWM_H
+#define __CROS_EC_STM32_PWM_H
+
+/* Data structure to define PWM channels. */
+struct pwm_t {
+ /*
+ * Timer powering the PWM channel. Must use STM32_TIM(x) to
+ * initialize
+ */
+ struct {
+ int id;
+ uintptr_t base;
+ } tim;
+ /* Channel ID within the timer */
+ int channel;
+ /* PWM channel flags. See include/pwm.h */
+ uint32_t flags;
+ /* GPIO pin corresponding to the PWM channel */
+ enum gpio_signal pin;
+};
+
+extern const struct pwm_t pwm_channels[];
+
+/* Macro to fill in both timer ID and register base */
+#define STM32_TIM(x) {x, STM32_TIM_BASE(x)}
+
+/* Plain ID mapping for readability */
+#define STM32_TIM_CH(x) (x)
+
+#endif /* __CROS_EC_STM32_PWM_H */