XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
master.h
浏览该文件的文档.
1
21#ifndef __xwcd_ds_spi_master_h__
22#define __xwcd_ds_spi_master_h__
23
24#include <xwcd/ds/standard.h>
25#include <xwos/lib/xwbop.h>
26#include <xwos/osal/lock/mtx.h>
27#include <xwcd/ds/device.h>
28
40struct xwds_spim;
41
47 xwer_t (* xfer)(struct xwds_spim * /*spim*/, xwid_t /*cfgid*/,
48 const xwu8_t[] /*txd*/, xwu8_t * /*rxb*/,
49 xwsz_t * /*size*/, xwtm_t /*to*/);
50 xwer_t (* abort)(struct xwds_spim * /*spim*/,
51 xwtm_t /*to*/);
52};
53
57struct xwds_spim {
60 /* attributes */
61 void * buscfg;
64 /* private */
65 struct {
66 struct xwos_mtx apimtx;
67 } xfer;
68};
69
74void xwds_spim_construct(struct xwds_spim * spim);
75
80void xwds_spim_destruct(struct xwds_spim * spim);
81
86xwer_t xwds_spim_grab(struct xwds_spim * spim);
87
92xwer_t xwds_spim_put(struct xwds_spim * spim);
93
121xwer_t xwds_spim_xfer(struct xwds_spim * spim, xwid_t cfgid,
122 const xwu8_t txd[], xwu8_t * rxb, xwsz_t * size,
123 xwtm_t to);
124
142xwer_t xwds_spim_abort(struct xwds_spim * spim, xwtm_t to);
143
148#endif /* xwcd/ds/spi/master.h */
玄武设备栈:设备基类
xwer_t xwds_spim_put(struct xwds_spim *spim)
XWDS API:减少对象的引用计数
Definition master.c:81
void xwds_spim_construct(struct xwds_spim *spim)
XWDS API:SPI主机模式控制器对象的构造函数
Definition master.c:59
xwer_t xwds_spim_grab(struct xwds_spim *spim)
XWDS API:增加对象的引用计数
Definition master.c:75
void xwds_spim_destruct(struct xwds_spim *spim)
XWDS API:SPI主机模式控制器对象的析构函数
Definition master.c:66
xwer_t xwds_spim_abort(struct xwds_spim *spim, xwtm_t to)
XWDS API:中止SPI总线传输
Definition master.c:241
xwer_t xwds_spim_xfer(struct xwds_spim *spim, xwid_t cfgid, const xwu8_t txd[], xwu8_t *rxb, xwsz_t *size, xwtm_t to)
XWDS API:启动SPI总线传输
Definition master.c:195
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwid_t
Definition type.h:481
unsigned long xwsz_t
Definition type.h:339
uint8_t xwu8_t
Definition type.h:194
操作系统抽象层:互斥锁
设备(所有设备的基类)
Definition device.h:127
基本驱动函数表(所有设备驱动的基类)
Definition device.h:113
BSP中需要提供的SPI主机模式控制器驱动函数表
Definition master.h:45
xwer_t(* abort)(struct xwds_spim *, xwtm_t)
Definition master.h:50
xwer_t(* xfer)(struct xwds_spim *, xwid_t, const xwu8_t[], xwu8_t *, xwsz_t *, xwtm_t)
Definition master.h:47
struct xwds_driver base
Definition master.h:46
SPI主机模式控制器
Definition master.h:57
struct xwds_device dev
Definition master.h:58
xwsz_t buscfg_num
Definition master.h:62
void * buscfg
Definition master.h:61
struct xwds_spim::@25 xfer
XWOS API:互斥锁
Definition mtx.h:82
XWOS通用库:位操作
玄武设备栈:顶级头文件