从散列读结果中读取数据 - DmaScatterRead
函数简介
从散列读结果中读取指定地址的数据。(高级版功能,普通版无法使用)
接口名称
DmaScatterRead
DLL调用
int32_t OLA_CALL_TYPE DmaScatterRead(int64_t instance, int64_t scatterHandle, int64_t address, int64_t buffer, int32_t size);
参数说明
| 参数名 | 类型 | 说明 |
|---|---|---|
| instance | 长整数型 | OLAPlug对象的指针,由 CreateCOLAPlugInterFace 接口生成。 |
| scatterHandle | 长整数型 | 散列句柄,由 DmaScatterCreate 返回 |
| address | 长整数型 | 要读取的地址,必须是之前通过 DmaScatterPrepare 准备过的地址 |
| buffer | 长整数型 | 输出缓冲区地址,可为 NULL |
| size | 整数型 | 读取大小,必须与 DmaScatterPrepare 中指定的大小一致 |
示例
DmaScatterPrepare(instance, scatterHandle, 0x400000, 4);
DmaScatterExecute(instance, scatterHandle);
int32_t bytesRead = DmaScatterRead(instance, scatterHandle, 0x400000, NULL, 4);
printf("读取字节数: %d\n", bytesRead);
返回值
整数型:成功返回实际读取的字节数,失败返回 0。
