RT-Thread RTOS 1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dev_i2c_bit_ops.h
浏览该文件的文档.
1/*
2 * Copyright (c) 2006-2023, RT-Thread Development Team
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 *
6 * Change Logs:
7 * Date Author Notes
8 * 2012-04-25 weety first version
9 */
10
11#ifndef __DEV_I2C_BIT_OPS_H__
12#define __DEV_I2C_BIT_OPS_H__
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19{
20 void *data; /* private data for lowlevel routines */
21 void (*set_sda)(void *data, rt_int32_t state);
22 void (*set_scl)(void *data, rt_int32_t state);
25
26 void (*udelay)(rt_uint32_t us);
27
28 rt_uint32_t delay_us; /* scl and sda line delay */
29 rt_uint32_t timeout; /* in tick */
30
31 void (*pin_init)(void);
33};
34
36 const char *bus_name);
37
38#ifdef __cplusplus
39}
40#endif
41
42#endif
rt_err_t rt_i2c_bit_add_bus(struct rt_i2c_bus_device *bus, const char *bus_name)
int rt_bool_t
rt_base_t rt_err_t
unsigned int rt_uint32_t
signed int rt_int32_t
void(* udelay)(rt_uint32_t us)
void(* set_sda)(void *data, rt_int32_t state)
rt_int32_t(* get_sda)(void *data)
void(* set_scl)(void *data, rt_int32_t state)
rt_int32_t(* get_scl)(void *data)
I2C Bus Device