1 /*
2  *  Change Logs:
3  *  Date            Author          Notes
4  *  2021-04-20      liuhy          the first version
5  *
6  * Copyright (C) 2021 Shanghai Eastsoft Microelectronics Co., Ltd. All rights reserved.
7  *
8  * SPDX-License-Identifier: Apache-2.0
9  *
10  * Licensed under the Apache License, Version 2.0 (the License); you may
11  * not use this file except in compliance with the License.
12  * You may obtain a copy of the License at
13  *
14  * www.apache.org/licenses/LICENSE-2.0
15  *
16  * Unless required by applicable law or agreed to in writing, software
17  * distributed under the License is distributed on an AS IS BASIS, WITHOUT
18  * WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
19  * See the License for the specific language governing permissions and
20  * limitations under the License.
21  *
22  */
23 
24 #ifndef __ES_CONF_INFO_I2C_H__
25 #define __ES_CONF_INFO_I2C_H__
26 
27 #include "es_conf_info_map.h"
28 #include <ald_i2c.h>
29 #include <ald_gpio.h>
30 #include <rtdbg.h>
31 
32 #define ES_C_I2C_STRETCH                 ALD_I2C_NOSTRETCH_DISABLE
33 #define ES_C_I2C_NO_STRETCH              ALD_I2C_NOSTRETCH_ENABLE
34 
35 #define ES_C_I2C_GENERALCALL             ALD_I2C_GENERALCALL_ENABLE
36 #define ES_C_I2C_NO_GENERALCALL          ALD_I2C_GENERALCALL_DISABLE
37 
38 
39 #define ES_C_I2C_ADDR_7_MODE                ALD_I2C_ADDR_7BIT
40 #define ES_C_I2C_ADDR_10_MODE                ALD_I2C_ADDR_10BIT
41 
42 
43 /* I2C 配置 */
44 
45 
46 
47 /* codes_main */
48 
49 
50 
51 
52 
53 #ifndef  ES_DEVICE_NAME_I2C0
54 #define  ES_DEVICE_NAME_I2C0     "i2c0"
55 #endif
56 
57 #ifndef  ES_DEVICE_NAME_I2C1
58 #define  ES_DEVICE_NAME_I2C1     "i2c1"
59 #endif
60 
61 #ifndef  ES_I2C0_CLK_SPEED
62 #define ES_I2C0_CLK_SPEED                100000
63 #endif
64 #ifndef  ES_I2C0_OWN_ADDR1
65 #define ES_I2C0_OWN_ADDR1                0x20
66 #endif
67 #ifndef  ES_I2C0_GENERAL_CALL
68 #define ES_I2C0_GENERAL_CALL             ES_C_I2C_NO_GENERALCALL
69 #endif
70 #ifndef  ES_I2C0_STRETCH
71 #define ES_I2C0_STRETCH               ES_C_I2C_STRETCH
72 #endif
73 #ifndef ES_I2C0_ADDR_MODE
74 #define ES_I2C0_ADDR_MODE                ES_C_I2C_ADDR_7_MODE
75 #endif
76 
77 #ifndef  ES_I2C1_CLK_SPEED
78 #define ES_I2C1_CLK_SPEED                100000
79 #endif
80 #ifndef  ES_I2C1_OWN_ADDR1
81 #define ES_I2C1_OWN_ADDR1                0x20
82 #endif
83 #ifndef  ES_I2C1_GENERAL_CALL
84 #define ES_I2C1_GENERAL_CALL             ES_C_I2C_NO_GENERALCALL
85 #endif
86 #ifndef  ES_I2C1_STRETCH
87 #define ES_I2C1_STRETCH               ES_C_I2C_STRETCH
88 #endif
89 #ifndef ES_I2C1_ADDR_MODE
90 #define ES_I2C1_ADDR_MODE                ES_C_I2C_ADDR_7_MODE
91 #endif
92 
93 
94 
95 #endif
96