aboutsummaryrefslogtreecommitdiff
path: root/cc3200/mptask.c
diff options
context:
space:
mode:
authordanicampora2015-02-10 13:11:27 +0100
committerdanicampora2015-02-13 17:54:04 +0100
commit99f3f6b5de567c1bdf04259d2c8322681755c732 (patch)
treef80a4d986bf20478283abb9dd45517fbdc4740c3 /cc3200/mptask.c
parent601c814603801ad3af78e37d26c87a4470156738 (diff)
cc3200: Add I2C module. Only master mode is currently supported.
Diffstat (limited to 'cc3200/mptask.c')
-rw-r--r--cc3200/mptask.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/cc3200/mptask.c b/cc3200/mptask.c
index 78eaa76f0..77b45859f 100644
--- a/cc3200/mptask.c
+++ b/cc3200/mptask.c
@@ -41,6 +41,8 @@
#include "runtime.h"
#include "repl.h"
#include "inc/hw_memmap.h"
+#include "inc/hw_types.h"
+#include "pin.h"
#include "pybuart.h"
#include "pybpin.h"
#include "pybrtc.h"
@@ -64,6 +66,8 @@
#include "mpexception.h"
#include "random.h"
#include "pybextint.h"
+#include "pybi2c.h"
+#include "pins.h"
/******************************************************************************
DECLARE PRIVATE CONSTANTS
@@ -142,7 +146,13 @@ soft_reset:
mpexception_init0();
uart_init0();
+ pin_init0();
+ i2c_init0();
+ // configure stdio uart pins with the correct af
+ // param 3 ("mode") is DON'T CARE" for AFs others than GPIO
+ pin_config(&pin_GPIO1, PIN_MODE_3, 0, PIN_TYPE_STD, PIN_STRENGTH_2MA);
+ pin_config(&pin_GPIO2, PIN_MODE_3, 0, PIN_TYPE_STD, PIN_STRENGTH_2MA);
// Instantiate the stdio uart
mp_obj_t args[2] = {
mp_obj_new_int(MICROPY_STDIO_UART),
@@ -151,7 +161,6 @@ soft_reset:
MP_STATE_PORT(pyb_stdio_uart) = pyb_uart_type.make_new((mp_obj_t)&pyb_uart_type, MP_ARRAY_SIZE(args), 0, args);
readline_init0();
- pin_init0();
extint_init0();
mod_network_init();
wlan_init0();