From 4ff96215eddade6e541f1a97af5364e754ccee7c Mon Sep 17 00:00:00 2001 From: gdisirio Date: Sat, 17 Sep 2011 08:45:43 +0000 Subject: git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@3323 35acf78f-673a-0410-8e92-d51de3d6d3f4 --- os/hal/platforms/STM32/GPIOv2/pal_lld.h | 30 ++++++++++++++++++++++++++++-- 1 file changed, 28 insertions(+), 2 deletions(-) (limited to 'os/hal/platforms/STM32/GPIOv2') 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 @@ -95,6 +95,32 @@ #define PAL_MODE_INPUT_PULLDOWN (PAL_STM32_MODE_INPUT | \ 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. */ @@ -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)) -- cgit v1.2.3