Add I2C_ActualBaudRate

This commit is contained in:
László Monda
2018-01-14 17:55:13 +01:00
parent 7142722eed
commit 217f0b3bdb
2 changed files with 6 additions and 0 deletions

View File

@@ -149,6 +149,10 @@ static i2c_isr_t s_i2cSlaveIsr;
/* SGF @brief Extern counter to ensure that I2C is always alive */
volatile uint32_t I2C_Watchdog;
/* The actual baud rate set by the last invocation of I2C_MasterSetBaudRate() */
volatile uint32_t I2C_ActualBaudRate;
/*******************************************************************************
* Codes
******************************************************************************/
@@ -573,6 +577,7 @@ void I2C_MasterSetBaudRate(I2C_Type *base, uint32_t baudRate_Bps, uint32_t srcCl
bestMult = mult;
bestIcr = i;
bestError = absError;
I2C_ActualBaudRate = computedRate;
/* If the error is 0, then we can stop searching because we won't find a better match. */
if (absError == 0)

View File

@@ -33,6 +33,7 @@
#include "fsl_common.h"
extern volatile uint32_t I2C_Watchdog;
extern volatile uint32_t I2C_ActualBaudRate;
/*!
* @addtogroup i2c_driver