XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
controller.h
浏览该文件的文档.
1
21#ifndef __xwcd_ds_lin_controller_h__
22#define __xwcd_ds_lin_controller_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
35#define XWDS_LIN_DIAG_MSTREQ_MSG 0x3C
36#define XWDS_LIN_DIAG_SLCREP_MSG 0x3D
37#define XWDS_LIN_DEFAULT_DATA_SIZE 8
38
46};
47
54};
55
63};
64
71};
72
78 union {
79 struct {
83 } bit;
86 void * xwccfg;
87};
88
89struct xwds_linc;
90
96 xwer_t (* msttx)(struct xwds_linc *, xwu8_t, struct xwds_lin_msg *,
97 xwtm_t /*to*/);
98 xwer_t (* slvtx)(struct xwds_linc *, struct xwds_lin_msg *,
99 xwtm_t /*to*/);
100 xwer_t (* rx)(struct xwds_linc *, struct xwds_lin_msg *,
101 xwtm_t /*to*/);
102};
103
107struct xwds_linc {
110 /* attributes */
111 const struct xwds_lin_cfg * cfg;
115 xwu8_t ,
116 xwu8_t *);
121 /* private */
123};
124
129void xwds_linc_construct(struct xwds_linc * linc);
130
135void xwds_linc_destruct(struct xwds_linc * linc);
136
141xwer_t xwds_linc_grab(struct xwds_linc * linc);
142
147xwer_t xwds_linc_put(struct xwds_linc * linc);
148
164xwer_t xwds_linc_msttx(struct xwds_linc * linc,
165 xwu8_t id, struct xwds_lin_msg * msg,
166 xwtm_t to);
167
182xwer_t xwds_linc_slvtx(struct xwds_linc * linc,
183 struct xwds_lin_msg * msg,
184 xwtm_t to);
185
200xwer_t xwds_linc_rx(struct xwds_linc * linc,
201 struct xwds_lin_msg * msgbuf,
202 xwtm_t to);
203
217 xwu8_t protected_id,
218 xwu8_t * ret);
219
224#endif /* xwcd/ds/lin/controller.h */
玄武设备栈:设备基类
void xwds_linc_destruct(struct xwds_linc *linc)
XWDS API:LIN控制器对象的析构函数
Definition controller.c:65
xwer_t xwds_linc_get_msg_size(struct xwds_linc *linc, xwu8_t protected_id, xwu8_t *ret)
XWDS API:通过LIN保护ID查询消息大小
Definition controller.c:301
void xwds_linc_construct(struct xwds_linc *linc)
XWDS API:LIN控制器的构造函数
Definition controller.c:58
xwer_t xwds_linc_grab(struct xwds_linc *linc)
XWDS API:增加对象的引用计数
Definition controller.c:71
xwds_lin_chksum_type_em
LIN协议类型
Definition controller.h:51
xwer_t xwds_linc_rx(struct xwds_linc *linc, struct xwds_lin_msg *msgbuf, xwtm_t to)
XWDS API:接收一条LIN消息
Definition controller.c:268
xwer_t xwds_linc_slvtx(struct xwds_linc *linc, struct xwds_lin_msg *msg, xwtm_t to)
XWDS API:从机节点发送一条LIN消息
Definition controller.c:228
xwds_lin_mode_em
LIN接口模式枚举
Definition controller.h:42
#define XWDS_LIN_DEFAULT_DATA_SIZE
Definition controller.h:37
xwer_t xwds_linc_put(struct xwds_linc *linc)
XWDS API:减少对象的引用计数
Definition controller.c:77
xwer_t xwds_linc_msttx(struct xwds_linc *linc, xwu8_t id, struct xwds_lin_msg *msg, xwtm_t to)
XWDS API:主机节点发送一条LIN消息
Definition controller.c:188
@ XWDS_LIN_CHKSUM_ENHANCED
Definition controller.h:53
@ XWDS_LIN_CHKSUM_CLASSIC
Definition controller.h:52
@ XWDS_LIN_MODE_CLOSE
Definition controller.h:43
@ XWDS_LIN_MODE_TX
Definition controller.h:44
@ XWDS_LIN_MODE_RX
Definition controller.h:45
xws64_t xwtm_t
XWOS系统时间 (有符号)
Definition type.h:742
signed long xwer_t
Definition type.h:554
unsigned long xwsz_t
Definition type.h:339
uint8_t xwu8_t
Definition type.h:194
uint32_t xwu32_t
Definition type.h:266
#define XWBOP_BIT(n)
Definition xwbop.h:27
操作系统抽象层:互斥锁
设备(所有设备的基类)
Definition device.h:127
基本驱动函数表(所有设备驱动的基类)
Definition device.h:113
LIN控制器配置
Definition controller.h:76
xwu32_t chksum
Definition controller.h:81
struct xwds_lin_cfg::@21::@22 bit
union xwds_lin_cfg::@21 attr
xwu32_t reserved
Definition controller.h:82
xwu32_t baudrate
Definition controller.h:77
xwu32_t mode
Definition controller.h:80
void * xwccfg
Definition controller.h:86
xwu32_t u32
Definition controller.h:84
LIN消息信息
Definition controller.h:68
LIN消息结构体
Definition controller.h:59
xwu8_t size
Definition controller.h:62
xwu8_t data[8]
Definition controller.h:61
LIN控制器驱动函数表
Definition controller.h:94
xwer_t(* msttx)(struct xwds_linc *, xwu8_t, struct xwds_lin_msg *, xwtm_t)
Definition controller.h:96
struct xwds_driver base
Definition controller.h:95
xwer_t(* rx)(struct xwds_linc *, struct xwds_lin_msg *, xwtm_t)
Definition controller.h:100
xwer_t(* slvtx)(struct xwds_linc *, struct xwds_lin_msg *, xwtm_t)
Definition controller.h:98
LIN控制器
Definition controller.h:107
xwsz_t msgitable_itemnum
Definition controller.h:113
const struct xwds_lin_cfg * cfg
Definition controller.h:111
struct xwds_device dev
Definition controller.h:108
struct xwos_mtx txlock
Definition controller.h:122
xwer_t(* get_msg_size)(struct xwds_linc *, xwu8_t, xwu8_t *)
Definition controller.h:114
const struct xwds_lin_msg_info * msgitable
Definition controller.h:112
XWOS API:互斥锁
Definition mtx.h:82
XWOS通用库:位操作
玄武设备栈:顶级头文件