no-OS
maxim_i2c.h
Go to the documentation of this file.
1 /*******************************************************************************
2  * @file maxim_i2c.h
3  * @brief Header containing types used in the i2c driver.
4  * @author Ciprian Regus (ciprian.regus@analog.com)
5 ********************************************************************************
6  * Copyright 2023(c) Analog Devices, Inc.
7  *
8  * All rights reserved.
9  *
10  * Redistribution and use in source and binary forms, with or without
11  * modification, are permitted provided that the following conditions are met:
12  * - Redistributions of source code must retain the above copyright
13  * notice, this list of conditions and the following disclaimer.
14  * - Redistributions in binary form must reproduce the above copyright
15  * notice, this list of conditions and the following disclaimer in
16  * the documentation and/or other materials provided with the
17  * distribution.
18  * - Neither the name of Analog Devices, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived
20  * from this software without specific prior written permission.
21  * - The use of this software may or may not infringe the patent rights
22  * of one or more patent holders. This license does not release you
23  * from the requirement that you obtain separate licenses from these
24  * patent holders to use this software.
25  * - Use of the software either in source or binary form, must be run
26  * on or directly connected to an Analog Devices Inc. component.
27  *
28  * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES "AS IS" AND ANY EXPRESS OR
29  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, NON-INFRINGEMENT,
30  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
31  * IN NO EVENT SHALL ANALOG DEVICES BE LIABLE FOR ANY DIRECT, INDIRECT,
32  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
33  * LIMITED TO, INTELLECTUAL PROPERTY RIGHTS, PROCUREMENT OF SUBSTITUTE GOODS OR
34  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
35  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
36  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
37  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
38 *******************************************************************************/
39 
40 #ifndef MAXIM_I2C_H_
41 #define MAXIM_I2C_H_
42 
43 #include <stdint.h>
44 #include "i2c_regs.h"
45 #include "max32690.h"
46 #include "no_os_i2c.h"
47 #include "gpio.h"
48 
49 #ifndef MXC_I2C_GET_I2C
50 #define MXC_I2C_GET_I2C(i) ((i) == 0 ? MXC_I2C0 : \
51  (i) == 1 ? MXC_I2C1 : \
52  (i) == 2 ? MXC_I2C2 : 0)
53 #endif
54 
59 struct max_i2c_extra {
61  mxc_i2c_regs_t *handler;
64  uint8_t *prologue_data;
67  uint8_t prologue_size;
68 };
69 
70 struct max_i2c_init_param {
71  mxc_gpio_vssel_t vssel;
72 };
73 
79  MAX_I2C_STD_MODE = 100000,
82  MAX_I2C_HS_MODE = 3400000
83 };
84 
88 extern const struct no_os_i2c_platform_ops max_i2c_ops;
89 
90 #endif /* MAXIM_I2C_H_ */
max_i2c_ops
const struct no_os_i2c_platform_ops max_i2c_ops
MAXIM specific I2C platform ops structure.
Definition: maxim_i2c.c:328
max_i2c_init_param
Definition: maxim_i2c.h:64
max_i2c_extra::handler
mxc_i2c_regs_t * handler
Definition: maxim_i2c.h:55
max_i2c_init_param::vssel
mxc_gpio_vssel_t vssel
Definition: maxim_i2c.h:65
max_i2c_extra
MAXIM specific I2C handler structure.
Definition: maxim_i2c.h:53
MAX_I2C_FAST_MODE
@ MAX_I2C_FAST_MODE
Definition: maxim_i2c.h:74
MAX_I2C_STD_MODE
@ MAX_I2C_STD_MODE
Definition: maxim_i2c.h:73
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:127
max_i2c_speed
max_i2c_speed
MAXIM I2C SCL frequency options.
Definition: maxim_i2c.h:72
no_os_i2c.h
Header file of I2C Interface.
MAX_I2C_FAST_PLUS_MODE
@ MAX_I2C_FAST_PLUS_MODE
Definition: maxim_i2c.h:75
MAX_I2C_HS_MODE
@ MAX_I2C_HS_MODE
Definition: maxim_i2c.h:76
max_i2c_extra::prologue_data
uint8_t * prologue_data
Definition: maxim_i2c.h:58
max_i2c_extra::prologue_size
uint8_t prologue_size
Definition: maxim_i2c.h:61