aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/TIVA
diff options
context:
space:
mode:
authormarcoveeneman <marco-veeneman@hotmail.com>2015-03-04 20:42:54 +0100
committermarcoveeneman <marco-veeneman@hotmail.com>2015-03-04 20:42:54 +0100
commitb826d3a8e39cd3ad723b629206c9b73edefec8fc (patch)
treea60f37f97214f96a4415d808a22ac622a05659e0 /testhal/TIVA
parent42add52912afc3f835fa66af279eda91b3d4bbc4 (diff)
downloadChibiOS-Contrib-b826d3a8e39cd3ad723b629206c9b73edefec8fc.tar.gz
ChibiOS-Contrib-b826d3a8e39cd3ad723b629206c9b73edefec8fc.tar.bz2
ChibiOS-Contrib-b826d3a8e39cd3ad723b629206c9b73edefec8fc.zip
Updated Tiva testhal demo for I2C.
Diffstat (limited to 'testhal/TIVA')
-rw-r--r--testhal/TIVA/TM4C123x/I2C/main.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/testhal/TIVA/TM4C123x/I2C/main.c b/testhal/TIVA/TM4C123x/I2C/main.c
index a48c7f1..5bdfeb2 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.
*/