mbed library with additional peripherals for ST F401 board
Fork of mbed-src by
This mbed LIB has additional peripherals for ST F401 board
- UART2 : PA_3 rx, PA_2 tx
- UART3 : PC_7 rx, PC_6 tx
- I2C2 : PB_3 SDA, PB_10 SCL
- I2C3 : PB_4 SDA, PA_8 SCL
Diff: targets/hal/TARGET_Freescale/TARGET_KL25Z/i2c_api.c
- Revision:
- 72:248c61396e08
- Parent:
- 19:398f4c622e1b
--- a/targets/hal/TARGET_Freescale/TARGET_KL25Z/i2c_api.c Thu Jan 09 09:00:05 2014 +0000 +++ b/targets/hal/TARGET_Freescale/TARGET_KL25Z/i2c_api.c Mon Jan 13 10:45:05 2014 +0000 @@ -18,6 +18,7 @@ #include "cmsis.h" #include "pinmap.h" #include "error.h" +#include "clk_freqs.h" static const PinMap PinMap_I2C_SDA[] = { {PTE25, I2C_0, 5}, @@ -206,7 +207,7 @@ uint32_t ref = 0; uint8_t i, j; // bus clk - uint32_t PCLK = 24000000u; + uint32_t PCLK = bus_frequency(); uint32_t pulse = PCLK / (hz * 2); // we look for the values that minimize the error