libopencm3
A free/libre/open-source firmware library for various ARM Cortex-M3 microcontrollers.
f4/i2c.h
Go to the documentation of this file.
1/** @defgroup i2c_defines I2C Defines
2
3@brief <b>Defined Constants and Types for the STM32F4xx I2C </b>
4
5@ingroup STM32F4xx_defines
6
7@version 1.0.0
8
9@date 12 October 2012
10
11LGPL License Terms @ref lgpl_license
12 */
13
14/*
15 * This file is part of the libopencm3 project.
16 *
17 * This library is free software: you can redistribute it and/or modify
18 * it under the terms of the GNU Lesser General Public License as published by
19 * the Free Software Foundation, either version 3 of the License, or
20 * (at your option) any later version.
21 *
22 * This library is distributed in the hope that it will be useful,
23 * but WITHOUT ANY WARRANTY; without even the implied warranty of
24 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
25 * GNU Lesser General Public License for more details.
26 *
27 * You should have received a copy of the GNU Lesser General Public License
28 * along with this library. If not, see <http://www.gnu.org/licenses/>.
29 */
30
31#ifndef LIBOPENCM3_I2C_H
32#define LIBOPENCM3_I2C_H
33
36
37/**
38@addtogroup i2c_defines
39@{*/
40
41/** FLTR register (I2Cx_FLTR) (noise filter) */
42#define I2C_FLTR(i2c_base) MMIO32((i2c_base) + 0x24)
43#define I2C1_FLTR I2C_FLTR(I2C1)
44#define I2C2_FLTR I2C_FLTR(I2C2)
45#define I2C3_FLTR I2C_FLTR(I2C3)
46
47/**
48 * Bits [3:0] DNF - Digital noise filter
49 * These bits configure a digital noise filter on SDA and SCL pins.
50 * Value sets minimum pulse width needed to trigger i2c operations.
51 * 0 disables, 1 - 15 set minimum width to 'n' * TPCLK1
52 */
53#define I2C_FLTR_DNF_MASK 0xF
54#define I2C_FLTR_DNF_SHIFT 0
55
56/**
57 * Bit 4 - Analog Noise filter disable
58 * Turns off the built in analog noise filter.
59 */
60#define I2C_FLTR_ANOFF (1<<4)
61
62/**@}*/
63
64#endif
65