XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
master.h
浏览该文件的文档.
1
21#ifndef __xwcd_ds_i2c_master_h__
22#define __xwcd_ds_i2c_master_h__
23
24#include <xwcd/ds/standard.h>
25#include <xwos/osal/lock/mtx.h>
26#include <xwcd/ds/device.h>
27#include <xwcd/ds/i2c/common.h>
28
35struct xwds_i2cm;
36
42 xwer_t (* xfer)(struct xwds_i2cm * /*i2cm*/,
43 struct xwds_i2c_msg * /*msg*/,
44 xwtm_t /*to*/);
45 xwer_t (* abort)(struct xwds_i2cm * /*i2cm*/,
46 xwu16_t /*address*/, xwu16_t /*addrmode*/,
47 xwtm_t /*to*/);
48};
49
53struct xwds_i2cm {
56 /* attributes */
57 void * xwccfg;
59 /* private */
60 struct {
61 struct xwos_mtx apimtx;
62 } xfer;
63 struct {
64 struct xwos_mtx apimtx;
66};
67
72void xwds_i2cm_construct(struct xwds_i2cm * i2cm);
73
78void xwds_i2cm_destruct(struct xwds_i2cm * i2cm);
79
84xwer_t xwds_i2cm_grab(struct xwds_i2cm * i2cm);
85
90xwer_t xwds_i2cm_put(struct xwds_i2cm * i2cm);
91
128xwer_t xwds_i2cm_xfer(struct xwds_i2cm * i2cm,
129 struct xwds_i2c_msg * msg,
130 xwtm_t to);
131
155xwer_t xwds_i2cm_abort(struct xwds_i2cm * i2cm,
156 xwu16_t address, xwu16_t addrmode,
157 xwtm_t to);
158
163#endif /* xwcd/ds/i2c/master.h */
玄武设备栈:设备基类
void xwds_i2cm_construct(struct xwds_i2cm *i2cm)
XWDS API:I2C主机控制器的构造函数
Definition master.c:58
xwer_t xwds_i2cm_xfer(struct xwds_i2cm *i2cm, struct xwds_i2c_msg *msg, xwtm_t to)
XWDS API:传输I2C消息
Definition master.c:201
xwer_t xwds_i2cm_put(struct xwds_i2cm *i2cm)
XWDS API:减少对象的引用计数
Definition master.c:77
void xwds_i2cm_destruct(struct xwds_i2cm *i2cm)
XWDS API:I2C主机控制器对象的析构函数
Definition master.c:65
xwer_t xwds_i2cm_abort(struct xwds_i2cm *i2cm, xwu16_t address, xwu16_t addrmode, xwtm_t to)
XWDS API:中止I2C总线传输
Definition master.c:240
xwer_t xwds_i2cm_grab(struct xwds_i2cm *i2cm)
XWDS API:增加对象的引用计数
Definition master.c:71
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
uint16_t xwu16_t
Definition type.h:230
操作系统抽象层:互斥锁
设备(所有设备的基类)
Definition device.h:127
基本驱动函数表(所有设备驱动的基类)
Definition device.h:113
I2C消息
Definition common.h:62
BSP中需要提供的I2C主机驱动函数表
Definition master.h:40
xwer_t(* xfer)(struct xwds_i2cm *, struct xwds_i2c_msg *, xwtm_t)
Definition master.h:42
xwer_t(* abort)(struct xwds_i2cm *, xwu16_t, xwu16_t, xwtm_t)
Definition master.h:45
struct xwds_driver base
Definition master.h:41
I2C主机
Definition master.h:53
struct xwds_i2cm::@17 xfer
void * xwccfg
Definition master.h:57
struct xwds_device dev
Definition master.h:54
struct xwds_i2cm::@18 abort
XWOS API:互斥锁
Definition mtx.h:82
玄武设备栈:I2C:协议通用的定义
玄武设备栈:顶级头文件