From b826d3a8e39cd3ad723b629206c9b73edefec8fc Mon Sep 17 00:00:00 2001 From: marcoveeneman Date: Wed, 4 Mar 2015 20:42:54 +0100 Subject: [PATCH] Updated Tiva testhal demo for I2C. --- testhal/TIVA/TM4C123x/I2C/main.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/testhal/TIVA/TM4C123x/I2C/main.c b/testhal/TIVA/TM4C123x/I2C/main.c index a48c7f18..5bdfeb28 100644 --- a/testhal/TIVA/TM4C123x/I2C/main.c +++ b/testhal/TIVA/TM4C123x/I2C/main.c @@ -69,11 +69,19 @@ int main(void) halInit(); chSysInit(); + /* Configure RX and TX pins for UART0.*/ + palSetPadMode(GPIOA, GPIOA_UART0_RX, PAL_MODE_INPUT | PAL_MODE_ALTERNATE(1)); + palSetPadMode(GPIOA, GPIOA_UART0_TX, PAL_MODE_INPUT | PAL_MODE_ALTERNATE(1)); + /* * Start the serial driver with the default configuration. */ sdStart(&SD1, NULL); + /* Configure SCK and SCL pins for I2C0.*/ + palSetPadMode(GPIOB, GPIOB_I2C0_SCL, PAL_MODE_OUTPUT_PUSHPULL | PAL_MODE_ALTERNATE(3)); + palSetPadMode(GPIOB, GPIOB_I2C0_SDA, PAL_MODE_OUTPUT_OPENDRAIN | PAL_MODE_ALTERNATE(3)); + /* * Start the i2c driver with the custom configuration. */