XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
transceiver.h
浏览该文件的文档.
1
21#ifndef __xwcd_ds_can_transceiver_h__
22#define __xwcd_ds_can_transceiver_h__
23
24#include <xwcd/ds/standard.h>
25#include <xwos/lib/xwbop.h>
26#include <xwcd/ds/device.h>
30
45};
46
73};
74
75struct xwds_cantrcv;
76
80typedef void (*xwds_cantrcv_wkup_isr_f)(struct xwds_cantrcv *, struct xwds_canc *);
81
88 void * chipcfg;
89};
90
91struct xwds_cantrcv;
92
101};
102
107 union {
109#if (defined(XWCDCFG_ds_I2C_PERIPHERAL) && (1 == XWCDCFG_ds_I2C_PERIPHERAL))
111#endif
112#if (defined(XWCDCFG_ds_SPI_PERIPHERAL) && (1 == XWCDCFG_ds_SPI_PERIPHERAL))
114#endif
115 } bc;
117 /* attributes */
118 struct xwds_canc * canc;
119 const struct xwds_cantrcv_cfg * cfg;
122 /* private */
125};
126
131void xwds_cantrcv_construct(struct xwds_cantrcv * cantrcv);
132
137void xwds_cantrcv_destruct(struct xwds_cantrcv * cantrcv);
138
143xwer_t xwds_cantrcv_grab(struct xwds_cantrcv * cantrcv);
144
149xwer_t xwds_cantrcv_put(struct xwds_cantrcv * cantrcv);
150
162xwer_t xwds_cantrcv_set_opmode(struct xwds_cantrcv * cantrcv, xwsq_t opmode);
163
171void xwds_cantrcv_get_opmode(struct xwds_cantrcv * cantrcv, xwsq_t * opmode);
172
184
196
206void xwds_cantrcv_set_wkup_isr(struct xwds_cantrcv * cantrcv,
208
216void xwds_cantrcv_get_wkuprs(struct xwds_cantrcv * cantrcv, xwsq_t * wkuprs);
217
224void xwds_cantrcv_clear_wkuprs(struct xwds_cantrcv * cantrcv);
225
226/******** ******** Callbacks for Driver ******** ********/
236
241#endif /* xwcd/ds/can/transceiver.h */
玄武设备栈:CAN:总线控制器
玄武设备栈:设备基类
void xwds_cantrcv_destruct(struct xwds_cantrcv *cantrcv)
XWDS API:CAN接收器对象的析构函数
Definition transceiver.c:67
xwds_cantrcv_opmode_em
CAN接收器模式枚举
Definition transceiver.h:40
void xwds_cantrcv_set_wkup_isr(struct xwds_cantrcv *cantrcv, xwds_cantrcv_wkup_isr_f isr)
XWDS API:设置唤醒中断的回调函数
xwds_cantrcv_wkuprs_em
CAN接收器唤醒原因枚举
Definition transceiver.h:50
void xwds_cantrcv_drvcb_wakeup_notification(struct xwds_cantrcv *cantrcv)
CAN接收器回调函数:CAN接收器的唤醒通知
void(* xwds_cantrcv_wkup_isr_f)(struct xwds_cantrcv *, struct xwds_canc *)
唤醒中断回调函数
Definition transceiver.h:80
xwer_t xwds_cantrcv_put(struct xwds_cantrcv *cantrcv)
XWDS API:减少对象的引用计数
Definition transceiver.c:79
void xwds_cantrcv_get_wkuprs(struct xwds_cantrcv *cantrcv, xwsq_t *wkuprs)
XWDS API:获取CAN接收器的唤醒原因
xwer_t xwds_cantrcv_enable_wkup(struct xwds_cantrcv *cantrcv)
XWDS API:开启CAN接收器的唤醒
void xwds_cantrcv_construct(struct xwds_cantrcv *cantrcv)
XWDS API:CAN接收器的构造函数
Definition transceiver.c:60
void xwds_cantrcv_clear_wkuprs(struct xwds_cantrcv *cantrcv)
XWDS API:清除CAN接收器的唤醒原因
xwer_t xwds_cantrcv_disable_wkup(struct xwds_cantrcv *cantrcv)
XWDS API:关闭CAN接收器的唤醒
xwer_t xwds_cantrcv_set_opmode(struct xwds_cantrcv *cantrcv, xwsq_t opmode)
XWDS API:设置CAN接收器的运行模式
void xwds_cantrcv_get_opmode(struct xwds_cantrcv *cantrcv, xwsq_t *opmode)
XWDS API:设置CAN接收器的模式
xwer_t xwds_cantrcv_grab(struct xwds_cantrcv *cantrcv)
XWDS API:增加对象的引用计数
Definition transceiver.c:73
@ XWDS_CANTRCV_OPMODE_NORMAL
Definition transceiver.h:41
@ XWDS_CANTRCV_OPMODE_STANDBY
Definition transceiver.h:43
@ XWDS_CANTRCV_OPMODE_NUM
Definition transceiver.h:44
@ XWDS_CANTRCV_OPMODE_SLEEP
Definition transceiver.h:42
@ XWDS_CANTRCV_WKUPRS_RESET
Definition transceiver.h:67
@ XWDS_CANTRCV_WKUPRS_INTERNALLY
Definition transceiver.h:58
@ XWDS_CANTRCV_WKUPRS_BY_PIN
Definition transceiver.h:55
@ XWDS_CANTRCV_WKUPRS_BY_SYSERR
Definition transceiver.h:69
@ XWDS_CANTRCV_WKUPRS_POWER_ON
Definition transceiver.h:64
@ XWDS_CANTRCV_WKUPRS_NOT_SUPPORTED
Definition transceiver.h:61
@ XWDS_CANTRCV_WKUPRS_BY_BUS
Definition transceiver.h:52
@ XWDS_CANTRCV_WKUPRS_NUM
Definition transceiver.h:72
@ XWDS_CANTRCV_WKUPRS_NONE
Definition transceiver.h:51
signed long xwer_t
Definition type.h:554
unsigned long xwsq_t
Definition type.h:445
玄武设备栈:I2C:外设
玄武设备栈:SPI:外设
CAN控制器
Definition controller.h:213
CAN接收器配置
Definition transceiver.h:85
BSP中需要提供的CAN接收器驱动函数表
Definition transceiver.h:96
xwer_t(* disable_wkup)(struct xwds_cantrcv *)
xwer_t(* enable_wkup)(struct xwds_cantrcv *)
Definition transceiver.h:99
xwer_t(* set_opmode)(struct xwds_cantrcv *, xwsq_t)
Definition transceiver.h:98
struct xwds_driver base
Definition transceiver.h:97
CAN接收器
struct xwds_spip spip
struct xwds_canc * canc
union xwds_cantrcv::@16 bc
struct xwds_i2cp i2cp
struct xwds_device dev
const struct xwds_cantrcv_cfg * cfg
xwds_cantrcv_wkup_isr_f wkup_isr
设备(所有设备的基类)
Definition device.h:127
基本驱动函数表(所有设备驱动的基类)
Definition device.h:113
I2C外设
Definition peripheral.h:48
SPI外设控制器
Definition peripheral.h:47
XWOS通用库:位操作
玄武设备栈:顶级头文件