aboutsummaryrefslogtreecommitdiffstats
path: root/testhal/TIVA/TM4C123x/I2C/main.c
diff options
context:
space:
mode:
authorbarthess <barthess@yandex.ru>2015-03-05 16:00:24 +0300
committerbarthess <barthess@yandex.ru>2015-03-05 16:00:24 +0300
commit6518ddaf222ed4dcd81f7b4a53067e0c653b5f72 (patch)
tree6e7e2cdb5062f04e7cc7b1a8ea199e81f8466275 /testhal/TIVA/TM4C123x/I2C/main.c
parentae1ce0ea2bcad5962831dae78afde8575b9d7675 (diff)
parent817efe19e0a913287726bf47cc75a22566908823 (diff)
downloadChibiOS-Contrib-6518ddaf222ed4dcd81f7b4a53067e0c653b5f72.tar.gz
ChibiOS-Contrib-6518ddaf222ed4dcd81f7b4a53067e0c653b5f72.tar.bz2
ChibiOS-Contrib-6518ddaf222ed4dcd81f7b4a53067e0c653b5f72.zip
Merge branch 'master' of github.com:ChibiOS/ChibiOS-Contrib
Diffstat (limited to 'testhal/TIVA/TM4C123x/I2C/main.c')
-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.
*/