Skip to content

Commit 7ab6adc

Browse files
Add INPUT_ANALOG to disconnect GPIO internally; fix qspi/uart/i2s/spi/sai to disconnect GPIO on *_disable()
1 parent 3af19ae commit 7ab6adc

15 files changed

+86
-11
lines changed

cores/stm32l4/Arduino.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,7 @@ extern "C"{
5151
#define OUTPUT (0x1)
5252
#define INPUT_PULLUP (0x2)
5353
#define INPUT_PULLDOWN (0x3)
54+
#define INPUT_ANALOG (0x4)
5455

5556
#define PI 3.1415926535897932384626433832795
5657
#define HALF_PI 1.5707963267948966192313216916398

cores/stm32l4/stm32l4_wiring_digital.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,11 @@ void pinMode( uint32_t ulPin, uint32_t ulMode )
5959
stm32l4_gpio_pin_configure(g_APinDescription[ulPin].pin, (GPIO_PUPD_PULLDOWN | GPIO_OSPEED_MEDIUM | GPIO_OTYPE_PUSHPULL | GPIO_MODE_INPUT));
6060
break ;
6161

62+
case INPUT_ANALOG:
63+
// Set pin to analog mode
64+
stm32l4_gpio_pin_configure(g_APinDescription[ulPin].pin, (GPIO_PUPD_NONE | GPIO_MODE_ANALOG));
65+
break ;
66+
6267
case OUTPUT:
6368
// Set pin to output mode
6469
stm32l4_gpio_pin_configure(g_APinDescription[ulPin].pin, (GPIO_PUPD_NONE | GPIO_OSPEED_MEDIUM | GPIO_OTYPE_PUSHPULL | GPIO_MODE_OUTPUT));
48 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.
48 Bytes
Binary file not shown.
1.04 KB
Binary file not shown.
1.11 KB
Binary file not shown.
1.11 KB
Binary file not shown.
1.12 KB
Binary file not shown.

0 commit comments

Comments
 (0)