2 Star 0 Fork 0

ChargePile/libtcu.so

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
libca.h 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
#include <stdint.h>
//#include "dbg.h"
#define IO_TIMEOUT 100000 /* ms */
#define CA_IO_READ 0x01
#define CA_IO_WRITE 0x02
#define CA_IO_RESP 0x03
#define CA_CMD_DO 0xd0
#define CA_CMD_DI 0xd1
#define CA_CMD_ESAM 0xea
#define MAX_ESAM_DATA_LEN 512
#define MAX_CHAN_DI 6
#define MAX_CHAN_DO 6
enum {
LNK_ID_DI0,
LNK_ID_DO0 = 64,
LNK_ID_ESAM = 128,
LNK_ID_MAX = 256,
};
typedef struct _ca_io_t {
uint32_t type;
uint32_t cmd;
uint32_t len;
uint8_t ptr[0];
} ca_io_t;
typedef struct _ca_dio_t {
uint32_t ch;
uint32_t val;
} ca_do_t, ca_di_t;
#if 0
typedef struct _ca_esam_t {
uint8_t data[MAX_ESAM_DATA_LEN];
} ca_esam_t;
#else
#define ca_esam_t void
#endif
int ca_set_do(int ch, int val);
int ca_get_do(int ch, int *data);
int ca_get_di(int ch, int *data);
int ca_read_esam(unsigned char *buffer, unsigned int len, unsigned int *rlen, unsigned int timeout);
int ca_write_esam(unsigned char *data, unsigned int len);
int ca_reset_esam(int cmd);
int _io_write(ca_io_t *pio, int len);
int _io_read(ca_io_t *pio, int len, unsigned int timeout);
int _link_get_id(void *arg);
int _link_poll(int fd, unsigned int timeout);
int _link_write(int fd, void *data, int size);
int _link_read(int fd, void *data, int size);
int _link_open(int id);
void _link_close(int fd);
int _link_create(void);
int _parse_id_from_io(void *ptr);
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/IChargePile/libtcu.so.git
git@gitee.com:IChargePile/libtcu.so.git
IChargePile
libtcu.so
libtcu.so
master

搜索帮助