STM32F4: I2C Noise Filter Register

This commit is contained in:
Chuck McManis 2020-04-12 21:25:08 -07:00 committed by Karl Palsson
parent 503cebab87
commit 3ee9710f35
1 changed files with 25 additions and 1 deletions

View File

@ -31,9 +31,33 @@ LGPL License Terms @ref lgpl_license
#ifndef LIBOPENCM3_I2C_H
#define LIBOPENCM3_I2C_H
#include <libopencm3/stm32/memorymap.h>
#include <libopencm3/stm32/common/i2c_common_v1.h>
/**@{*/
/**
@addtogroup i2c_defines
@{*/
/** FLTR register (I2Cx_FLTR) (noise filter) */
#define I2C_FLTR(i2c_base) MMIO32((i2c_base) + 0x24)
#define I2C1_FLTR I2C_FLTR(I2C1)
#define I2C2_FLTR I2C_FLTR(I2C2)
#define I2C3_FLTR I2C_FLTR(I2C3)
/**
* Bits [3:0] DNF - Digital noise filter
* These bits configure a digital noise filter on SDA and SCL pins.
* Value sets minimum pulse width needed to trigger i2c operations.
* 0 disables, 1 - 15 set minimum width to 'n' * TPCLK1
*/
#define I2C_FLTR_DNF_MASK 0xF
#define I2C_FLTR_DNF_SHIFT 0
/**
* Bit 4 - Analog Noise filter disable
* Turns off the built in analog noise filter.
*/
#define I2C_FLTR_ANOFF (1<<4)
/**@}*/