Disable pull-down on PB4 and PB6 for STM32G4 MCUs

This pull-down caused issues with the latching power-good function in a
board which required PB6 to be configured as an input.
This commit is contained in:
Martin Jäger
2021-03-16 17:51:24 +01:00
parent 3b68bc1bcc
commit 3f11266838
+6
View File
@@ -85,6 +85,7 @@ uint32_t timestamp;
#ifndef UNIT_TEST
#include <zephyr.h>
#include <soc.h>
static inline void timestamp_inc(struct k_timer *timer_id)
{
@@ -104,6 +105,11 @@ void setup()
*/
void *temp = k_malloc(4);
k_free(temp);
#ifdef CONFIG_SOC_SERIES_STM32G4X
// disable 5k pull-down required for USB-C PD on PB4 and PB6 so that they can be used as inputs
PWR->CR3 |= PWR_CR3_UCPD_DBDIS;
#endif
}
#endif