@@ -214,6 +214,7 @@ bool TwoWire::cfg_pins(int max_index) {
214
214
uint16_t cfg_scl = getPinCfg (cfg, PIN_CFG_REQ_SCL,require_sci);
215
215
cfg = g_pin_cfg[sda_pin].list ;
216
216
uint16_t cfg_sda = getPinCfg (cfg, PIN_CFG_REQ_SDA,require_sci);
217
+
217
218
/* verify configuration are good */
218
219
if (cfg_scl == 0 || cfg_sda == 0 ) {
219
220
return false ;
@@ -237,8 +238,8 @@ bool TwoWire::cfg_pins(int max_index) {
237
238
ioport_sda = USE_SCI_EVEN_CFG (cfg_sda) ? IOPORT_PERIPHERAL_SCI0_2_4_6_8 : IOPORT_PERIPHERAL_SCI1_3_5_7_9;
238
239
ioport_scl = USE_SCI_EVEN_CFG (cfg_scl) ? IOPORT_PERIPHERAL_SCI0_2_4_6_8 : IOPORT_PERIPHERAL_SCI1_3_5_7_9;
239
240
240
- R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[sda_pin].pin , (uint32_t ) (IOPORT_CFG_NMOS_ENABLE | IOPORT_CFG_PERIPHERAL_PIN | ioport_sda));
241
- R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[scl_pin].pin , (uint32_t ) (IOPORT_CFG_NMOS_ENABLE | IOPORT_CFG_PERIPHERAL_PIN | ioport_scl));
241
+ R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[sda_pin].pin , (uint32_t ) (IOPORT_CFG_PULLUP_ENABLE | IOPORT_CFG_PERIPHERAL_PIN | ioport_sda));
242
+ R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[scl_pin].pin , (uint32_t ) (IOPORT_CFG_PULLUP_ENABLE | IOPORT_CFG_PERIPHERAL_PIN | ioport_scl));
242
243
243
244
}
244
245
else {
@@ -249,8 +250,8 @@ bool TwoWire::cfg_pins(int max_index) {
249
250
ioport_sda = IOPORT_PERIPHERAL_IIC;
250
251
ioport_scl = IOPORT_PERIPHERAL_IIC;
251
252
252
- R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[sda_pin].pin , (uint32_t ) (IOPORT_CFG_DRIVE_MID | IOPORT_CFG_PERIPHERAL_PIN | ioport_sda));
253
- R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[scl_pin].pin , (uint32_t ) (IOPORT_CFG_DRIVE_MID | IOPORT_CFG_PERIPHERAL_PIN | ioport_scl));
253
+ R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[sda_pin].pin , (uint32_t ) (IOPORT_CFG_PULLUP_ENABLE | IOPORT_CFG_DRIVE_MID | IOPORT_CFG_PERIPHERAL_PIN | ioport_sda));
254
+ R_IOPORT_PinCfg (&g_ioport_ctrl, g_pin_cfg[scl_pin].pin , (uint32_t ) (IOPORT_CFG_PULLUP_ENABLE | IOPORT_CFG_DRIVE_MID | IOPORT_CFG_PERIPHERAL_PIN | ioport_scl));
254
255
}
255
256
256
257
return true ;
0 commit comments