Skip to content

Commit 98b8568

Browse files
committed
cc3200: Assign GPIO10 and GPIO11 to the GPIO peripheral on start-up.
1 parent ea43fa1 commit 98b8568

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

cc3200/mods/pybpin.c

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
#include "gpio.h"
4646
#include "interrupt.h"
4747
#include "pybpin.h"
48+
#include "pins.h"
4849
#include "pybsleep.h"
4950
#include "mpcallback.h"
5051
#include "mpexception.h"
@@ -154,6 +155,11 @@ STATIC pybpin_wake_pin_t pybpin_wake_pin[PYBPIN_NUM_WAKE_PINS] =
154155
DEFINE PUBLIC FUNCTIONS
155156
******************************************************************************/
156157
void pin_init0(void) {
158+
// assign GPIO10 and GPIO11 to the GPIO peripheral (the default is I2C), so that the I2C bus can
159+
// be assigned safely to any other pins (as recomended by the SDK release notes). Make them
160+
// inputs with pull-downs enabled to ensure they are not floating during LDPS and hibernate.
161+
pin_config ((pin_obj_t *)&pin_GPIO10, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA);
162+
pin_config ((pin_obj_t *)&pin_GPIO11, PIN_MODE_0, GPIO_DIR_MODE_IN, PIN_TYPE_STD_PD, PIN_STRENGTH_2MA);
157163
}
158164

159165
// C API used to convert a user-supplied pin name into an ordinal pin number.

0 commit comments

Comments
 (0)