From 5e1ba4064104c64d383f083dd233de858a47aae8 Mon Sep 17 00:00:00 2001 From: Karl Palsson Date: Thu, 23 Mar 2017 23:37:25 +0000 Subject: i2c-master: add 400k speed support on v1/v2 --- tests/i2c-master/main-stm32f072-disco.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'tests/i2c-master/main-stm32f072-disco.c') diff --git a/tests/i2c-master/main-stm32f072-disco.c b/tests/i2c-master/main-stm32f072-disco.c index 8818665..b156e3c 100644 --- a/tests/i2c-master/main-stm32f072-disco.c +++ b/tests/i2c-master/main-stm32f072-disco.c @@ -28,7 +28,7 @@ struct hw_detail hw_details = { .trigger_rcc = RCC_GPIOB, .trigger_port = GPIOB, .trigger_pin = GPIO12, - .i2c_clock_megahz = 48, // FIXME + .i2c_clock_megahz = 48, }; @@ -67,6 +67,9 @@ static void i2cm_hw_init(void) gpio_mode_setup(hw_details.port, GPIO_MODE_AF, GPIO_PUPD_NONE, hw_details.pins); gpio_set_output_options(hw_details.port, GPIO_OTYPE_OD, GPIO_OSPEED_HIGH, hw_details.pins); gpio_set_af(hw_details.port, GPIO_AF1, hw_details.pins); + + /* select sysclk as i2c clock! */ + RCC_CFGR3 |= RCC_CFGR3_I2C1SW; } -- cgit