RT-Thread RTOS
1.2.0
An open source embedded real-time operating system
载入中...
搜索中...
未找到
dev_i2c_dm.h
浏览该文件的文档.
1
/*
2
* Copyright (c) 2006-2022, RT-Thread Development Team
3
*
4
* SPDX-License-Identifier: Apache-2.0
5
*
6
* Change Logs:
7
* Date Author Notes
8
* 2022-11-26 GuEe-GUI first version
9
*/
10
11
#ifndef __DEV_I2C_DM_H__
12
#define __DEV_I2C_DM_H__
13
14
#include <
rthw.h
>
15
#include <
rtthread.h
>
16
#include <drivers/core/bus.h>
17
18
/* I2C Frequency Modes */
19
#define I2C_MAX_STANDARD_MODE_FREQ 100000
20
#define I2C_MAX_FAST_MODE_FREQ 400000
21
#define I2C_MAX_FAST_MODE_PLUS_FREQ 1000000
22
#define I2C_MAX_TURBO_MODE_FREQ 1400000
23
#define I2C_MAX_HIGH_SPEED_MODE_FREQ 3400000
24
#define I2C_MAX_ULTRA_FAST_MODE_FREQ 5000000
25
26
struct
i2c_timings
27
{
28
rt_uint32_t
bus_freq_hz
;
/* the bus frequency in Hz */
29
rt_uint32_t
scl_rise_ns
;
/* time SCL signal takes to rise in ns; t(r) in the I2C specification */
30
rt_uint32_t
scl_fall_ns
;
/* time SCL signal takes to fall in ns; t(f) in the I2C specification */
31
rt_uint32_t
scl_int_delay_ns
;
/* time IP core additionally needs to setup SCL in ns */
32
rt_uint32_t
sda_fall_ns
;
/* time SDA signal takes to fall in ns; t(f) in the I2C specification */
33
rt_uint32_t
sda_hold_ns
;
/* time IP core additionally needs to hold SDA in ns */
34
rt_uint32_t
digital_filter_width_ns
;
/* width in ns of spikes on i2c lines that the IP core digital filter can filter out */
35
rt_uint32_t
analog_filter_cutoff_freq_hz
;
/* threshold frequency for the low pass IP core analog filter */
36
};
37
38
#ifdef RT_USING_OFW
39
rt_err_t
i2c_timings_ofw_parse
(
struct
rt_ofw_node
*dev_np,
struct
i2c_timings
*timings,
40
rt_bool_t
use_defaults);
41
#else
42
rt_inline
rt_err_t
i2c_timings_ofw_parse
(
struct
rt_ofw_node
*dev_np,
struct
i2c_timings
*timings,
43
rt_bool_t
use_defaults)
44
{
45
return
RT_EOK;
46
}
47
#endif
/* RT_USING_OFW */
48
49
void
i2c_bus_scan_clients
(
struct
rt_i2c_bus_device
*bus);
50
51
#endif
/* __DEV_I2C_DM_H__ */
i2c_timings_ofw_parse
rt_inline rt_err_t i2c_timings_ofw_parse(struct rt_ofw_node *dev_np, struct i2c_timings *timings, rt_bool_t use_defaults)
定义
dev_i2c_dm.h:42
i2c_bus_scan_clients
void i2c_bus_scan_clients(struct rt_i2c_bus_device *bus)
rthw.h
rtthread.h
rt_bool_t
int rt_bool_t
定义
rttypes.h:35
rt_err_t
rt_base_t rt_err_t
定义
rttypes.h:84
rt_uint32_t
unsigned int rt_uint32_t
定义
rttypes.h:53
i2c_timings
定义
dev_i2c_dm.h:27
i2c_timings::bus_freq_hz
rt_uint32_t bus_freq_hz
定义
dev_i2c_dm.h:28
i2c_timings::digital_filter_width_ns
rt_uint32_t digital_filter_width_ns
定义
dev_i2c_dm.h:34
i2c_timings::scl_rise_ns
rt_uint32_t scl_rise_ns
定义
dev_i2c_dm.h:29
i2c_timings::scl_int_delay_ns
rt_uint32_t scl_int_delay_ns
定义
dev_i2c_dm.h:31
i2c_timings::sda_fall_ns
rt_uint32_t sda_fall_ns
定义
dev_i2c_dm.h:32
i2c_timings::scl_fall_ns
rt_uint32_t scl_fall_ns
定义
dev_i2c_dm.h:30
i2c_timings::sda_hold_ns
rt_uint32_t sda_hold_ns
定义
dev_i2c_dm.h:33
i2c_timings::analog_filter_cutoff_freq_hz
rt_uint32_t analog_filter_cutoff_freq_hz
定义
dev_i2c_dm.h:35
rt_i2c_bus_device
I2C Bus Device
定义
dev_i2c.h:243
rt_ofw_node
定义
ofw.h:33
components
drivers
include
drivers
dev_i2c_dm.h
制作者
1.13.1