Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/thirdpin/libopencm3.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarl Palsson <karlp@tweak.net.au>2017-10-27 00:54:30 +0300
committerKarl Palsson <karlp@etactica.com>2018-01-08 14:16:24 +0300
commited90df85f089d260fc598cb200b5d36678045ec0 (patch)
treed82f4723485615cd8f0a5f8c15b6bf64f0c9c638 /include/libopencm3/stm32/common/i2c_common_v2.h
parent965d28ecbec5df5b77f7a93222e0eb8d79c4c79c (diff)
stm32:i2c-v2: Clarify digital filter setting
Drop redundant field definitions, fix truncation of argument bug and add documentation. Fixes: https://github.com/libopencm3/libopencm3/issues/831
Diffstat (limited to 'include/libopencm3/stm32/common/i2c_common_v2.h')
-rw-r--r--include/libopencm3/stm32/common/i2c_common_v2.h21
1 files changed, 3 insertions, 18 deletions
diff --git a/include/libopencm3/stm32/common/i2c_common_v2.h b/include/libopencm3/stm32/common/i2c_common_v2.h
index 1a9df080..5a6e1950 100644
--- a/include/libopencm3/stm32/common/i2c_common_v2.h
+++ b/include/libopencm3/stm32/common/i2c_common_v2.h
@@ -137,24 +137,9 @@ specific memorymap.h header before including this header file.*/
/* ANFOFF: Analog noise filter OFF */
#define I2C_CR1_ANFOFF (1 << 12)
-/* DNF[3:0]: Digital noise filter */
-#define I2C_CR1_DNF_DISABLED (0x0 << 8)
-#define I2C_CR1_DNF_UP_1_TI2CCLK (0x1 << 8)
-#define I2C_CR1_DNF_UP_2_TI2CCLK (0x2 << 8)
-#define I2C_CR1_DNF_UP_3_TI2CCLK (0x3 << 8)
-#define I2C_CR1_DNF_UP_4_TI2CCLK (0x4 << 8)
-#define I2C_CR1_DNF_UP_5_TI2CCLK (0x5 << 8)
-#define I2C_CR1_DNF_UP_6_TI2CCLK (0x6 << 8)
-#define I2C_CR1_DNF_UP_7_TI2CCLK (0x7 << 8)
-#define I2C_CR1_DNF_UP_8_TI2CCLK (0x8 << 8)
-#define I2C_CR1_DNF_UP_9_TI2CCLK (0x9 << 8)
-#define I2C_CR1_DNF_UP_10_TI2CCLK (0xA << 8)
-#define I2C_CR1_DNF_UP_11_TI2CCLK (0xB << 8)
-#define I2C_CR1_DNF_UP_12_TI2CCLK (0xC << 8)
-#define I2C_CR1_DNF_UP_13_TI2CCLK (0xD << 8)
-#define I2C_CR1_DNF_UP_14_TI2CCLK (0xE << 8)
-#define I2C_CR1_DNF_UP_15_TI2CCLK (0xF << 8)
-#define I2C_CR1_DNF_MASK (0xF << 8)
+/** DNF[3:0]: Digital noise filter. */
+#define I2C_CR1_DNF_MASK 0xF
+#define I2C_CR1_DNF_SHIFT 8
/* ERRIE: Error interrupts enable */
#define I2C_CR1_ERRIE (1 << 7)