13#ifndef __xwmd_isc_xwssc_mif_h__
14#define __xwmd_isc_xwssc_mif_h__
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!"
26#if ((1 << XWMDCFG_isc_xwssc_MEMBLK_ODR) > 32768U)
27# error "power(2, XWMDCFG_isc_xwssc_MEMBLK_ODR) must be <= 32768!"
29#if (XWMDCFG_isc_xwssc_PORT_NUM > 256)
30# error "XWSSC Only supports 256 ports (0 ~ 255)!"
32#if (XWMDCFG_isc_xwssc_PRI_NUM > 64)
33# error "XWSSC Only supports 64 priorities!"
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)
58#define XWSSC_DEF_MEMPOOL(name) __xwcc_alignl1cache xwu8_t name[XWSSC_MEMPOOL_SIZE]
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
发送句柄
xwer_t xwssc_abort(struct xwssc *xwssc, xwssc_txh_t txh)
XWSSC API: 中断发送
xwssc_carrier_state_em
发送状态枚举
xwsq_t xwssc_get_txstate(xwssc_txh_t txh)
XWSSC API: 获取发送状态
void(* xwssc_ntf_f)(struct xwssc *, xwssc_txh_t, xwer_t, void *)
通知发送结果的回调函数
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系统时间 (有符号)
const struct xwssc_hwifal_operation * hwifops
@ XWSSC_MSG_QOS_CHKSUM_MSK
@ XWSSC_MSG_QOS_RELIABLE_MSK