XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
master.c 文件参考

玄武设备栈:I2C:主机 更多...

master.c 的引用(Include)关系图:

浏览源代码.

函数

static xwer_t xwds_i2cm_vop_probe (struct xwds_i2cm *i2cm)
 XWDS VOP:探测I2C主机控制器
 
static xwer_t xwds_i2cm_vop_remove (struct xwds_i2cm *i2cm)
 XWDS VOP:移除I2C主机控制器
 
static xwer_t xwds_i2cm_vop_start (struct xwds_i2cm *i2cm)
 XWDS VOP:启动I2C主机控制器
 
static xwer_t xwds_i2cm_vop_stop (struct xwds_i2cm *i2cm)
 XWDS VOP:停止I2C主机控制器
 
static xwer_t xwds_i2cm_vop_suspend (struct xwds_i2cm *i2cm)
 XWDS VOP:暂停I2C主机控制器
 
static xwer_t xwds_i2cm_vop_resume (struct xwds_i2cm *i2cm)
 XWDS VOP:继续I2C主机控制器
 
void xwds_i2cm_construct (struct xwds_i2cm *i2cm)
 XWDS API:I2C主机控制器的构造函数
 
void xwds_i2cm_destruct (struct xwds_i2cm *i2cm)
 XWDS API:I2C主机控制器对象的析构函数
 
xwer_t xwds_i2cm_grab (struct xwds_i2cm *i2cm)
 XWDS API:增加对象的引用计数
 
xwer_t xwds_i2cm_put (struct xwds_i2cm *i2cm)
 XWDS API:减少对象的引用计数
 
xwer_t xwds_i2cm_xfer (struct xwds_i2cm *i2cm, struct xwds_i2c_msg *msg, xwtm_t to)
 XWDS API:传输I2C消息
 
xwer_t xwds_i2cm_abort (struct xwds_i2cm *i2cm, xwu16_t address, xwu16_t addrmode, xwtm_t to)
 XWDS API:中止I2C总线传输
 

变量

const struct xwds_virtual_operation xwds_i2cm_vop
 

详细描述

玄武设备栈:I2C:主机

作者

在文件 master.c 中定义.

函数说明

◆ xwds_i2cm_vop_probe()

static xwer_t xwds_i2cm_vop_probe ( struct xwds_i2cm i2cm)
static

XWDS VOP:探测I2C主机控制器

参数
[in]i2cmI2C主机控制器对象指针
返回
错误码

<No error

在文件 master.c89 行定义.

90{
91 xwer_t rc;
92
93 XWDS_VALIDATE(i2cm->xwccfg, "nullptr", -EFAULT);
94
96 if (rc < 0) {
97 goto err_xfer_mtx_init;
98 }
100 if (rc < 0) {
101 goto err_abort_mtx_init;
102 }
103 rc = xwds_device_vop_probe(&i2cm->dev);
104 if (rc < 0) {
105 goto err_dev_vop_probe;
106 }
107 return XWOK;
108
109err_dev_vop_probe:
110 xwos_mtx_fini(&i2cm->abort.apimtx);
111err_abort_mtx_init:
112 xwos_mtx_fini(&i2cm->xfer.apimtx);
113err_xfer_mtx_init:
114 return rc;
115}
xwer_t xwds_device_vop_probe(struct xwds_device *dev)
设备基本操作函数:探测设备
Definition device.c:67
#define XWDS_VALIDATE(exp, errstr,...)
Definition standard.h:51
#define EFAULT
Bad address
Definition errno.h:44
#define XWOK
No error
Definition errno.h:182
signed long xwer_t
Definition type.h:554
static xwer_t xwos_mtx_init(struct xwos_mtx *mtx, xwpr_t sprio)
XWOS API:静态方式初始化互斥锁
Definition mtx.h:111
static xwer_t xwos_mtx_fini(struct xwos_mtx *mtx)
XWOS API:销毁静态方式初始化的互斥锁
Definition mtx.h:126
#define XWOS_SKD_PRIORITY_RT_MIN
XWOS API:最小实时优先级
Definition skd.h:89
struct xwds_i2cm::@17 xfer
void * xwccfg
Definition master.h:57
struct xwds_device dev
Definition master.h:54
struct xwds_i2cm::@18 abort
struct xwos_mtx apimtx
Definition master.h:61
函数调用图:

◆ xwds_i2cm_vop_remove()

static xwer_t xwds_i2cm_vop_remove ( struct xwds_i2cm i2cm)
static

XWDS VOP:移除I2C主机控制器

参数
[in]ds设备栈控制块指针
[in]i2cmI2C主机控制器对象指针
返回
错误码

<No error

在文件 master.c124 行定义.

125{
126 xwer_t rc;
127
128 rc = xwds_device_vop_remove(&i2cm->dev);
129 if (rc < 0) {
130 goto err_dev_vop_remove;
131 }
132 xwos_mtx_fini(&i2cm->abort.apimtx);
133 xwos_mtx_fini(&i2cm->xfer.apimtx);
134 return XWOK;
135
136err_dev_vop_remove:
137 return rc;
138}
xwer_t xwds_device_vop_remove(struct xwds_device *dev)
设备基本操作函数:删除设备
Definition device.c:86
函数调用图:

◆ xwds_i2cm_vop_resume()

static xwer_t xwds_i2cm_vop_resume ( struct xwds_i2cm i2cm)
static

XWDS VOP:继续I2C主机控制器

参数
[in]i2cmI2C主机控制器对象指针
返回
错误码

在文件 master.c190 行定义.

191{
192 xwer_t rc;
193
194 rc = xwds_device_vop_resume(&i2cm->dev);
195 return rc;
196}
xwer_t xwds_device_vop_resume(struct xwds_device *dev)
设备基本操作函数:继续设备
Definition device.c:163
函数调用图:

◆ xwds_i2cm_vop_start()

static xwer_t xwds_i2cm_vop_start ( struct xwds_i2cm i2cm)
static

XWDS VOP:启动I2C主机控制器

参数
[in]i2cmI2C主机控制器对象指针
返回
错误码

在文件 master.c146 行定义.

147{
148 xwer_t rc;
149
150 rc = xwds_device_vop_start(&i2cm->dev);
151 return rc;
152}
xwer_t xwds_device_vop_start(struct xwds_device *dev)
设备基本操作函数:启动设备
Definition device.c:105
函数调用图:

◆ xwds_i2cm_vop_stop()

static xwer_t xwds_i2cm_vop_stop ( struct xwds_i2cm i2cm)
static

XWDS VOP:停止I2C主机控制器

参数
[in]i2cmI2C主机控制器对象指针
返回
错误码

在文件 master.c160 行定义.

161{
162 xwer_t rc;
163
164 rc = xwds_device_vop_stop(&i2cm->dev);
165 return rc;
166}
xwer_t xwds_device_vop_stop(struct xwds_device *dev)
设备基本操作函数:停止设备
Definition device.c:124
函数调用图:

◆ xwds_i2cm_vop_suspend()

static xwer_t xwds_i2cm_vop_suspend ( struct xwds_i2cm i2cm)
static

XWDS VOP:暂停I2C主机控制器

参数
[in]i2cmI2C主机控制器对象指针
返回
错误码

在文件 master.c176 行定义.

177{
178 xwer_t rc;
179
180 rc = xwds_device_vop_suspend(&i2cm->dev);
181 return rc;
182}
xwer_t xwds_device_vop_suspend(struct xwds_device *dev)
设备基本操作函数:暂停设备
Definition device.c:144
函数调用图:

变量说明

◆ xwds_i2cm_vop

const struct xwds_virtual_operation xwds_i2cm_vop
初始值:
= {
.probe = (void *)xwds_i2cm_vop_probe,
.remove = (void *)xwds_i2cm_vop_remove,
.start = (void *)xwds_i2cm_vop_start,
.stop = (void *)xwds_i2cm_vop_stop,
.suspend = (void *)xwds_i2cm_vop_suspend,
.resume = (void *)xwds_i2cm_vop_resume,
}
static xwer_t xwds_i2cm_vop_resume(struct xwds_i2cm *i2cm)
XWDS VOP:继续I2C主机控制器
Definition master.c:190
static xwer_t xwds_i2cm_vop_stop(struct xwds_i2cm *i2cm)
XWDS VOP:停止I2C主机控制器
Definition master.c:160
static xwer_t xwds_i2cm_vop_remove(struct xwds_i2cm *i2cm)
XWDS VOP:移除I2C主机控制器
Definition master.c:124
static xwer_t xwds_i2cm_vop_probe(struct xwds_i2cm *i2cm)
XWDS VOP:探测I2C主机控制器
Definition master.c:89
static xwer_t xwds_i2cm_vop_start(struct xwds_i2cm *i2cm)
XWDS VOP:启动I2C主机控制器
Definition master.c:146
static xwer_t xwds_i2cm_vop_suspend(struct xwds_i2cm *i2cm)
XWDS VOP:暂停I2C主机控制器
Definition master.c:176

在文件 master.c45 行定义.