Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc83db2e

Browse files
committed
fix(wire): reset pins to INPUT_ANALOG when deinit
prevent consumption before entering in low power modeSigned-off-by: Frederic Pillon <frederic.pillon@st.com>
1 parent63d3096 commitc83db2e

File tree

1 file changed

+3
-0
lines changed
  • libraries/Wire/src/utility

1 file changed

+3
-0
lines changed

‎libraries/Wire/src/utility/twi.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -804,6 +804,9 @@ void i2c_deinit(i2c_t *obj)
804804
HAL_NVIC_DisableIRQ(obj->irqER);
805805
#endif/* !STM32C0xx && !STM32F0xx && !STM32G0xx && !STM32L0xx */
806806
HAL_I2C_DeInit(&(obj->handle));
807+
/* Reset I2C GPIO pins as INPUT_ANALOG */
808+
pin_function(obj->scl,STM_PIN_DATA(STM_MODE_ANALOG,GPIO_NOPULL,0));
809+
pin_function(obj->sda,STM_PIN_DATA(STM_MODE_ANALOG,GPIO_NOPULL,0));
807810
// Reset I2Cx and disable clock
808811
#if definedI2C1_BASE
809812
if (obj->i2c==I2C1) {

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp