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  * Redistribution and use in source and binary forms, with or without
9  * modification, are permitted provided that the following conditions are met:
10  *
11  * 1. Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * 2. Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * 3. Neither the name of Analog Devices, Inc. nor the names of its
19  * contributors may be used to endorse or promote products derived from this
20  * software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY ANALOG DEVICES, INC. “AS IS” AND ANY EXPRESS OR
23  * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
24  * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
25  * EVENT SHALL ANALOG DEVICES, INC. BE LIABLE FOR ANY DIRECT, INDIRECT,
26  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
28  * OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
29  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
30  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
31  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32 *******************************************************************************/
33 
34 #ifndef MAXIM_I2C_H_
35 #define MAXIM_I2C_H_
36 
37 #include <stdint.h>
38 #include "i2c_regs.h"
39 #include "max32690.h"
40 #include "no_os_i2c.h"
41 #include "gpio.h"
42 
43 #ifndef MXC_I2C_GET_I2C
44 #define MXC_I2C_GET_I2C(i) ((i) == 0 ? MXC_I2C0 : \
45  (i) == 1 ? MXC_I2C1 : \
46  (i) == 2 ? MXC_I2C2 : 0)
47 #endif
48 
53 struct max_i2c_extra {
55  mxc_i2c_regs_t *handler;
58  uint8_t *prologue_data;
61  uint8_t prologue_size;
62 };
63 
64 struct max_i2c_init_param {
65  mxc_gpio_vssel_t vssel;
66 };
67 
73  MAX_I2C_STD_MODE = 100000,
76  MAX_I2C_HS_MODE = 3400000
77 };
78 
82 extern const struct no_os_i2c_platform_ops max_i2c_ops;
83 
84 #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:322
max_i2c_init_param
Definition: maxim_i2c.h:58
max_i2c_extra::handler
mxc_i2c_regs_t * handler
Definition: maxim_i2c.h:49
max_i2c_init_param::vssel
mxc_gpio_vssel_t vssel
Definition: maxim_i2c.h:59
max_i2c_extra
MAXIM specific I2C handler structure.
Definition: maxim_i2c.h:47
MAX_I2C_FAST_MODE
@ MAX_I2C_FAST_MODE
Definition: maxim_i2c.h:68
MAX_I2C_STD_MODE
@ MAX_I2C_STD_MODE
Definition: maxim_i2c.h:67
no_os_i2c_platform_ops
Structure holding I2C function pointers that point to the platform specific function.
Definition: no_os_i2c.h:121
max_i2c_speed
max_i2c_speed
MAXIM I2C SCL frequency options.
Definition: maxim_i2c.h:66
no_os_i2c.h
Header file of I2C Interface.
MAX_I2C_FAST_PLUS_MODE
@ MAX_I2C_FAST_PLUS_MODE
Definition: maxim_i2c.h:69
MAX_I2C_HS_MODE
@ MAX_I2C_HS_MODE
Definition: maxim_i2c.h:70
max_i2c_extra::prologue_data
uint8_t * prologue_data
Definition: maxim_i2c.h:52
max_i2c_extra::prologue_size
uint8_t prologue_size
Definition: maxim_i2c.h:55