72 lines
2.3 KiB
C
Executable File
72 lines
2.3 KiB
C
Executable File
/****************************************************************************
|
|
|
|
Copyright(c) 2019 by Aerospace C.Power (Chongqing) Microelectronics. ALL RIGHTS RESERVED.
|
|
|
|
This Information is proprietary to Aerospace C.Power (Chongqing) Microelectronics and MAY NOT
|
|
be copied by any method or incorporated into another program without
|
|
the express written consent of Aerospace C.Power. This Information or any portion
|
|
thereof remains the property of Aerospace C.Power. The Information contained herein
|
|
is believed to be accurate and Aerospace C.Power assumes no responsibility or
|
|
liability for its use in any way and conveys no license or title under
|
|
any patent or copyright and makes no representation or warranty that this
|
|
Information is free from patent or copyright infringement.
|
|
|
|
****************************************************************************/
|
|
|
|
#ifndef IOT_PKT_H
|
|
#define IOT_PKT_H
|
|
|
|
/* export includes */
|
|
#include "iot_pkt_api.h"
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
/* define maximum supported packet pool config */
|
|
#define IOT_PKT_POOL_MAX 9
|
|
|
|
/* pkt pool owner mask */
|
|
#define PKT_OWNER_PLC (0x1 << 0)
|
|
#define PKT_OWNER_IOT (0x1 << 1)
|
|
#define PKT_OWNER_NB (0x1 << 2)
|
|
#define PKT_OWNER_ALL 0xFFFFFFFF
|
|
#define PKT_OWNER_NONE 0x00000000
|
|
|
|
typedef struct _iot_pkt_pool_cnf {
|
|
/* size of each buffer in the pool */
|
|
uint16_t size;
|
|
/* number of buffers in the pool */
|
|
uint16_t count;
|
|
/* which module can use this pool */
|
|
uint32_t owner;
|
|
} iot_pkt_pool_cnf_t;
|
|
|
|
typedef struct _iot_pkt_config {
|
|
/* iot packet pool configuration */
|
|
iot_pkt_pool_cnf_t pool_cfg[IOT_PKT_POOL_MAX];
|
|
} iot_pkt_config_t;
|
|
|
|
/*
|
|
* @brief iot_pkt_init() init iot packet module
|
|
* @param cfg: pointer to iot packet pool configuration
|
|
*/
|
|
void iot_pkt_init(const iot_pkt_config_t *cfg);
|
|
|
|
void mem_dump(uint32_t *word_ptr, uint32_t word_cnt);
|
|
|
|
void mem_dump_byte(uint8_t *byte_ptr, uint32_t byte_cnt);
|
|
|
|
/**
|
|
* @brief iot_pkt_check_end_overwrite() check end point overwrite.
|
|
* @param iot_pkt_t buf: need check buf point.
|
|
* @return 0 - check success, 1 - check fail.
|
|
*/
|
|
uint32_t iot_pkt_check_end_overwrite(iot_pkt_t *buf);
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
#endif /* IOT_PKT_H */
|