XWOS API  4.0
XWOS C/C++ API参考手册
载入中...
搜索中...
未找到
mif.h
浏览该文件的文档.
1
13#ifndef __xwmd_isc_xwssc_mif_h__
14#define __xwmd_isc_xwssc_mif_h__
15
16#include <xwos/standard.h>
17
23#if (XWMDCFG_isc_xwssc_MEMBLK_SIZE & (XWMDCFG_isc_xwssc_MEMBLK_SIZE - 1))
24# error "XWMDCFG_isc_xwssc_MEMBLK_SIZE must be the power of 2!"
25#endif
26#if ((1 << XWMDCFG_isc_xwssc_MEMBLK_ODR) > 32768U)
27# error "power(2, XWMDCFG_isc_xwssc_MEMBLK_ODR) must be <= 32768!"
28#endif
29#if (XWMDCFG_isc_xwssc_PORT_NUM > 256)
30# error "XWSSC Only supports 256 ports (0 ~ 255)!"
31#endif
32#if (XWMDCFG_isc_xwssc_PRI_NUM > 64)
33# error "XWSSC Only supports 64 priorities!"
34#endif
35
36#define XWSSC_VERSION ("1.0.0")
37#define XWSSC_VERSION_MAJOR 1U
38#define XWSSC_VERSION_MINOR 0U
39#define XWSSC_VERSION_REVISION 0U
41#define XWSSC_PRI_NUM (XWMDCFG_isc_xwssc_PRI_NUM)
42#define XWSSC_INVALID_PRI (0xFFU)
43#define XWSSC_MAX_PRI (XWSSC_PRI_NUM - 1U)
44#define XWSSC_PORT_NUM (XWMDCFG_isc_xwssc_PORT_NUM)
45#define XWSSC_RETRY_PERIOD (XWMDCFG_isc_xwssc_RETRY_PERIOD)
46#define XWSSC_RETRY_NUM (XWMDCFG_isc_xwssc_RETRY_NUM)
47#define XWSSC_MEMBLK_SIZE (XWMDCFG_isc_xwssc_MEMBLK_SIZE)
48#define XWSSC_MEMBLK_ODR (XWMDCFG_isc_xwssc_MEMBLK_ODR)
50#define XWSSC_MEMBLK_NUM (1U << XWSSC_MEMBLK_ODR)
51#define XWSSC_MEMPOOL_SIZE (XWSSC_MEMBLK_SIZE * XWSSC_MEMBLK_NUM)
57// cppcheck-suppress [misra-c2012-20.7]
58#define XWSSC_DEF_MEMPOOL(name) __xwcc_alignl1cache xwu8_t name[XWSSC_MEMPOOL_SIZE]
59
60struct xwssc;
62struct xwssc_carrier;
63
67typedef struct xwssc_carrier * xwssc_txh_t;
68
78};
79
93};
94
95
99typedef void (* xwssc_ntf_f)(struct xwssc * /* xwssc */,
100 xwssc_txh_t /* txh */,
101 xwer_t /* rc */,
102 void * /* arg */);
103
126xwer_t xwssc_start(struct xwssc * xwssc, const char * name,
127 const struct xwssc_hwifal_operation * hwifops, void * hwifcb,
128 xwu8_t * mem, xwsz_t memsize);
129
141
152
181 const xwu8_t data[], xwsz_t * size,
182 xwu8_t pri, xwu8_t port, xwu8_t qos,
183 xwtm_t to);
184
220 const xwu8_t data[], xwsz_t * size,
221 xwu8_t pri, xwu8_t port, xwu8_t qos,
222 xwssc_ntf_f ntfcb, void * cbarg,
223 xwssc_txh_t * txhbuf);
224
241
250
276 xwu8_t rxbuf[], xwsz_t * size, xwu8_t * qos,
277 xwtm_t to);
278
298 xwu8_t rxbuf[], xwsz_t * size, xwu8_t * qos);
299
304#endif /* xwmd/isc/xwssc/mif.h */
xwer_t xwssc_tx(struct xwssc *xwssc, const xwu8_t data[], xwsz_t *size, xwu8_t pri, xwu8_t port, xwu8_t qos, xwtm_t to)
XWSSC API: 将用户数据加入到XWSSC的发送队列中,并在限定的时间内等待发送结果
xwer_t xwssc_start(struct xwssc *xwssc, const char *name, const struct xwssc_hwifal_operation *hwifops, void *hwifcb, xwu8_t *mem, xwsz_t memsize)
XWSSC API: 启动XWSSC
struct xwssc_carrier * xwssc_txh_t
发送句柄
Definition mif.h:67
xwer_t xwssc_abort(struct xwssc *xwssc, xwssc_txh_t txh)
XWSSC API: 中断发送
xwssc_carrier_state_em
发送状态枚举
Definition mif.h:72
xwsq_t xwssc_get_txstate(xwssc_txh_t txh)
XWSSC API: 获取发送状态
xwssc_msg_qos_em
服务质量枚举
Definition mif.h:83
void(* xwssc_ntf_f)(struct xwssc *, xwssc_txh_t, xwer_t, void *)
通知发送结果的回调函数
Definition mif.h:99
xwer_t xwssc_rx(struct xwssc *xwssc, xwu8_t port, xwu8_t rxbuf[], xwsz_t *size, xwu8_t *qos, xwtm_t to)
XWSSC API: 接收消息,若接收队列为空,就限时等待
xwer_t xwssc_try_rx(struct xwssc *xwssc, xwu8_t port, xwu8_t rxbuf[], xwsz_t *size, xwu8_t *qos)
XWSSC API: 尝试接收消息,若接收队列为空,立即返回错误码
bool xwssc_tst_connected(struct xwssc *xwssc)
XWSSC API: 测试XWSSC是否已经连接
xwer_t xwssc_eq(struct xwssc *xwssc, const xwu8_t data[], xwsz_t *size, xwu8_t pri, xwu8_t port, xwu8_t qos, xwssc_ntf_f ntfcb, void *cbarg, xwssc_txh_t *txhbuf)
XWSSC API: 将一条用户数据加入到XWSSC的发送队列中
xwer_t xwssc_stop(struct xwssc *xwssc)
XWSSC API: 停止XWSSC
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
unsigned long xwsq_t
Definition type.h:445
包含待发送帧的发送器
Definition protocol.h:149
硬件接口抽象层操作函数集
Definition hwifal.h:31
XWSSC对象
Definition protocol.h:160
const char * name
Definition protocol.h:163
const struct xwssc_hwifal_operation * hwifops
Definition protocol.h:165
void * hwifcb
Definition protocol.h:166
XWOS的标准头文件
@ XWSSC_CRS_ABORT
Definition mif.h:76
@ XWSSC_CRS_READY
Definition mif.h:74
@ XWSSC_CRS_FINISH
Definition mif.h:77
@ XWSSC_CRS_INPROGRESS
Definition mif.h:75
@ XWSSC_CRS_IDLE
Definition mif.h:73
@ XWSSC_MSG_QOS_MSK
Definition mif.h:91
@ XWSSC_MSG_QOS_NUM
Definition mif.h:88
@ XWSSC_MSG_QOS_0
Definition mif.h:84
@ XWSSC_MSG_QOS_1
Definition mif.h:85
@ XWSSC_MSG_QOS_CHKSUM_MSK
Definition mif.h:89
@ XWSSC_MSG_QOS_RELIABLE_MSK
Definition mif.h:90
@ XWSSC_MSG_QOS_2
Definition mif.h:86
@ XWSSC_MSG_QOS_3
Definition mif.h:87