diff options
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32/GPIOv2/pal_lld.h | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/os/hal/platforms/STM32/GPIOv2/pal_lld.h b/os/hal/platforms/STM32/GPIOv2/pal_lld.h index 0f9f22441..aa8dc2d73 100644 --- a/os/hal/platforms/STM32/GPIOv2/pal_lld.h +++ b/os/hal/platforms/STM32/GPIOv2/pal_lld.h @@ -96,6 +96,32 @@ PAL_STM32_PUDR_PULLDOWN)
/**
+ * @brief Alternate input high-Z pad.
+ *
+ * @param[in] n alternate function selector
+ */
+#define PAL_MODE_ALT_INPUT(n) (PAL_STM32_MODE_INPUT | \
+ PAL_STM32_ALTERNATE(n))
+
+/**
+ * @brief Alternate input pad with weak pull up resistor.
+ *
+ * @param[in] n alternate function selector
+ */
+#define PAL_MODE_ALT_INPUT_PULLUP(n) (PAL_STM32_MODE_INPUT | \
+ PAL_STM32_PUDR_PULLUP | \
+ PAL_STM32_ALTERNATE(n))
+
+/**
+ * @brief Alternate input pad with weak pull down resistor.
+ *
+ * @param[in] n alternate function selector
+ */
+#define PAL_MODE_ALT_INPUT_PULLDOWN(n) (PAL_STM32_MODE_INPUT | \
+ PAL_STM32_PUDR_PULLDOWN | \
+ PAL_STM32_ALTERNATE(n))
+
+/**
* @brief Analog input mode.
*/
#define PAL_MODE_INPUT_ANALOG PAL_STM32_MODE_ANALOG
@@ -117,7 +143,7 @@ *
* @param[in] n alternate function selector
*/
-#define PAL_MODE_ALTERNATE_PUSHPULL(n) (PAL_STM32_MODE_ALTERNATE | \
+#define PAL_MODE_ALT_OUTPUT_PUSHPULL(n) (PAL_STM32_MODE_ALTERNATE | \
PAL_STM32_OTYPE_PUSHPULL | \
PAL_STM32_ALTERNATE(n))
@@ -126,7 +152,7 @@ *
* @param[in] n alternate function selector
*/
-#define PAL_MODE_ALTERNATE_OPENDRAIN(n) (PAL_STM32_MODE_ALTERNATE | \
+#define PAL_MODE_ALT_OUTPUT_OPENDRAIN(n) (PAL_STM32_MODE_ALTERNATE | \
PAL_STM32_OTYPE_OPENDRAIN | \
PAL_STM32_ALTERNATE(n))
|