summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjiezhi320 <[email protected]>2018-07-23 23:09:09 +0800
committerjiezhi320 <[email protected]>2018-07-23 23:09:09 +0800
commita137c06a93ce433c2c4a52148a19c80a7c0d1fcb (patch)
tree1151d7134827f7cd6971b38cb7e13a82f4aa84d4
parent69ec7c3aff718e1f97a1de1f86d471c6ed813fa7 (diff)
Add GPIO Out_OD mode config
Add GPIO Out_OD mode config In stm32f10x bsp
-rwxr-xr-xbsp/stm32f10x/drivers/gpio.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/bsp/stm32f10x/drivers/gpio.c b/bsp/stm32f10x/drivers/gpio.c
index e0778f35d5..5dc10faf32 100755
--- a/bsp/stm32f10x/drivers/gpio.c
+++ b/bsp/stm32f10x/drivers/gpio.c
@@ -11,6 +11,7 @@
* Date Author Notes
* 2015-03-24 Bright the first version
* 2016-05-23 [email protected] Add 48 pins IC define
+ * 2018-07-23 jiezhi320 Add GPIO Out_OD mode config
*/
#include <rthw.h>
@@ -542,6 +543,11 @@ void stm32_pin_mode(rt_device_t dev, rt_base_t pin, rt_base_t mode)
/* output setting */
GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_PP;
}
+ else if (mode == PIN_MODE_OUTPUT_OD)
+ {
+ /* output setting: od. */
+ GPIO_InitStructure.GPIO_Mode = GPIO_Mode_Out_OD;
+ }
else if (mode == PIN_MODE_INPUT)
{
/* input setting: not pull. */