diff Small_CPU/Src/i2c.c @ 82:a6f0881074a4 kittz

+i2c analog noise filtering spi more stable
author Dmitry Romanov <kitt@bk.ru>
date Tue, 20 Nov 2018 12:08:19 +0300
parents 5f11787b4f42
children e6abbef57475
line wrap: on
line diff
--- a/Small_CPU/Src/i2c.c	Sat Oct 06 15:02:11 2018 +0200
+++ b/Small_CPU/Src/i2c.c	Tue Nov 20 12:08:19 2018 +0300
@@ -69,7 +69,7 @@
 {
 	I2cHandle.Instance             = I2Cx;
   I2cHandle.Init.AddressingMode  = I2C_ADDRESSINGMODE_7BIT;
-  I2cHandle.Init.ClockSpeed      = 100000;//400000;
+  I2cHandle.Init.ClockSpeed      = 400000;//400000;
   I2cHandle.Init.DualAddressMode = I2C_DUALADDRESS_DISABLED;
   I2cHandle.Init.DutyCycle       = I2C_DUTYCYCLE_16_9;
   I2cHandle.Init.GeneralCallMode = I2C_GENERALCALL_DISABLED;
@@ -79,6 +79,8 @@
 	global.dataSendToSlaveStopEval = 1;
 
 	global.I2C_SystemStatus = HAL_I2C_Init(&I2cHandle);
+	HAL_I2CEx_AnalogFilter_Config(&I2cHandle, I2C_ANALOGFILTER_ENABLED);
+
 
 	global.dataSendToSlaveStopEval = 0;
 	if(global.dataSendToSlavePending)