/*
* FPGA Interface C API 21.3 source file.
*
* Copyright (c) 2021,
* National Instruments Corporation.
* All rights reserved.
*/
#include "NiFpga.h"
/*
* Platform specific includes.
*/
#if NiFpga_Windows
#include <windows.h>
#elif NiFpga_Linux || NiFpga_MacOsX
#include <stdlib.h>
#include <stdio.h>
#include <dlfcn.h>
#else
#error
#endif
/*
* Platform specific defines.
*/
#if NiFpga_Windows
#define NiFpga_CCall __cdecl
#define NiFpga_StdCall __stdcall
#else
#define NiFpga_CCall
#define NiFpga_StdCall
#endif
/*
* Global library handle, or NULL if the library isn't loaded.
*/
#if NiFpga_Windows
static HMODULE NiFpga_library = NULL;
#elif NiFpga_VxWorks
static MODULE_ID NiFpga_library = NULL;
#elif NiFpga_Linux || NiFpga_MacOsX
static void* NiFpga_library = NULL;
#else
#error
#endif
/*
* CVI Resource Tracking functions.
*/
#if NiFpga_Cvi && NiFpga_Windows
#define NiFpga_CviResourceTracking 1
static char* const NiFpga_cviResourceType = "FPGA Interface C API";
typedef void* (NiFpga_CCall *NiFpga_AcquireCviResource)(void* resource,
char* type,
char* description,
...);
static NiFpga_AcquireCviResource NiFpga_acquireCviResource = NULL;
typedef void* (NiFpga_StdCall *NiFpga_ReleaseCviResource)(void* resource);
static NiFpga_ReleaseCviResource NiFpga_releaseCviResource = NULL;
#endif
/*
* Session management functions.
*/
static NiFpga_Status (NiFpga_CCall *NiFpga_open)(
const char* path,
const char* signature,
const char* resource,
uint32_t attribute,
NiFpga_Session* session) = NULL;
NiFpga_Status NiFpga_Open(const char* path,
const char* signature,
const char* resource,
uint32_t attribute,
NiFpga_Session* session)
{
const NiFpga_Status result = NiFpga_open
? NiFpga_open(path,
signature,
resource,
attribute,
session)
: NiFpga_Status_ResourceNotInitialized;
#if NiFpga_CviResourceTracking
if (NiFpga_acquireCviResource
&& NiFpga_IsNotError(result))
NiFpga_acquireCviResource((void*)*session,
NiFpga_cviResourceType,
"NiFpga_Session %#08x",
*session);
#endif
return result;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_close)(
NiFpga_Session session,
uint32_t attribute) = NULL;
NiFpga_Status NiFpga_Close(NiFpga_Session session,
uint32_t attribute)
{
if (!NiFpga_close)
return NiFpga_Status_ResourceNotInitialized;
#if NiFpga_CviResourceTracking
if (NiFpga_releaseCviResource)
NiFpga_releaseCviResource((void*)session);
#endif
return NiFpga_close(session, attribute);
}
/*
* FPGA state functions.
*/
static NiFpga_Status (NiFpga_CCall *NiFpga_run)(
NiFpga_Session session,
uint32_t attribute) = NULL;
NiFpga_Status NiFpga_Run(NiFpga_Session session,
uint32_t attribute)
{
return NiFpga_run
? NiFpga_run(session, attribute)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_abort)(
NiFpga_Session session) = NULL;
NiFpga_Status NiFpga_Abort(NiFpga_Session session)
{
return NiFpga_abort
? NiFpga_abort(session)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_reset)(
NiFpga_Session session) = NULL;
NiFpga_Status NiFpga_Reset(NiFpga_Session session)
{
return NiFpga_reset
? NiFpga_reset(session)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_download)(
NiFpga_Session session) = NULL;
NiFpga_Status NiFpga_Download(NiFpga_Session session)
{
return NiFpga_download
? NiFpga_download(session)
: NiFpga_Status_ResourceNotInitialized;
}
/*
* Functions to read from scalar indicators and controls.
*/
static NiFpga_Status (NiFpga_CCall *NiFpga_readBool)(
NiFpga_Session session,
uint32_t indicator,
NiFpga_Bool* value) = NULL;
NiFpga_Status NiFpga_ReadBool(NiFpga_Session session,
uint32_t indicator,
NiFpga_Bool* value)
{
return NiFpga_readBool
? NiFpga_readBool(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_readI8)(
NiFpga_Session session,
uint32_t indicator,
int8_t* value) = NULL;
NiFpga_Status NiFpga_ReadI8(NiFpga_Session session,
uint32_t indicator,
int8_t* value)
{
return NiFpga_readI8
? NiFpga_readI8(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_readU8)(
NiFpga_Session session,
uint32_t indicator,
uint8_t* value) = NULL;
NiFpga_Status NiFpga_ReadU8(NiFpga_Session session,
uint32_t indicator,
uint8_t* value)
{
return NiFpga_readU8
? NiFpga_readU8(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_readI16)(
NiFpga_Session session,
uint32_t indicator,
int16_t* value) = NULL;
NiFpga_Status NiFpga_ReadI16(NiFpga_Session session,
uint32_t indicator,
int16_t* value)
{
return NiFpga_readI16
? NiFpga_readI16(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_readU16)(
NiFpga_Session session,
uint32_t indicator,
uint16_t* value) = NULL;
NiFpga_Status NiFpga_ReadU16(NiFpga_Session session,
uint32_t indicator,
uint16_t* value)
{
return NiFpga_readU16
? NiFpga_readU16(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
static NiFpga_Status (NiFpga_CCall *NiFpga_readI32)(
NiFpga_Session session,
uint32_t indicator,
int32_t* value) = NULL;
NiFpga_Status NiFpga_ReadI32(NiFpga_Session session,
uint32_t indicator,
int32_t* value)
{
return NiFpga_readI32
? NiFpga_readI32(session, indicator, value)
: NiFpga_Status_ResourceNotInitialized;
}
stat
没有合适的资源?快使用搜索试试~ 我知道了~
关于asio,boost,第三方库
共2000个文件
hpp:1268个
h:689个
md:21个
需积分: 5 0 下载量 59 浏览量
2024-04-26
17:12:22
上传
评论
收藏 244.2MB ZIP 举报
温馨提示
关于asio,boost,第三方库
资源推荐
资源详情
资源评论
收起资源包目录
关于asio,boost,第三方库 (2000个子文件)
NiFpga.c 133KB
NiFpga.c 126KB
NiFpga.c 112KB
NiFpga_5785_RX_s.c 5KB
NiFpga_5785_RX_d.c 5KB
NiFpga_5785_TX.c 4KB
NiFpga_5764_RX_s.c 3KB
jsoncpp.cpp 152KB
convolution-impl.cpp 13KB
audiofile-impl.cpp 2KB
fft-impl-f64.cpp 1KB
dft-impl-f64.cpp 1KB
dft-impl-f32.cpp 1KB
fft-impl-f32.cpp 1KB
dsp-impl.cpp 990B
src.cpp 744B
lapacke.h 1.02MB
nppi_statistics_functions.h 921KB
nppi_arithmetic_and_logical_operations.h 862KB
nppi_filtering_functions.h 800KB
cuda.h 646KB
nppi_color_conversion.h 591KB
descriptor.pb.h 541KB
dr_flac.h 467KB
cuda_runtime_api.h 429KB
nvml.h 398KB
math_functions.h 340KB
nppi_geometry_transforms.h 331KB
nppi_data_exchange_and_initialization.h 328KB
curand_precalc.h 327KB
cusparse.h 309KB
curand_mtgp32dc_p_11213.h 282KB
npps_statistics_functions.h 279KB
npps_arithmetic_and_logical_operations.h 249KB
cublas_api.h 217KB
nppi_threshold_and_compare_operations.h 214KB
dr_wav.h 202KB
curand_mrg32k3a.h 169KB
dr_mp3.h 166KB
NiFpga.h 163KB
NiFpga.h 144KB
zstd.h 140KB
nppi_morphological_operations.h 130KB
cuda_bf16.h 125KB
device_functions.h 120KB
NiFpga.h 120KB
cuda_fp16.h 119KB
ivi.h 117KB
ivi.h 117KB
ivi.h 116KB
cusolverDn.h 109KB
driver_types.h 105KB
repeated_field.h 102KB
descriptor.h 97KB
type.pb.h 96KB
cuda_runtime.h 89KB
wire_format_lite.h 84KB
GeneralBlockPanelKernel.h 82KB
cl.h 81KB
cvitdms.h 81KB
niRFSA.h 81KB
niRFSA.h 81KB
plugin.pb.h 81KB
extension_set.h 79KB
niRFSG.h 70KB
niRFSG.h 70KB
coded_stream.h 70KB
json.h 68KB
niSync.h 67KB
cuda_occupancy.h 63KB
message.h 63KB
Eigen_Colamd.h 63KB
CoreEvaluators.h 62KB
IviRFSigGen.h 62KB
IviRFSigGen.h 62KB
mma.h 62KB
visa.h 61KB
visa.h 61KB
visa.h 61KB
Transform.h 61KB
nisyscfg.h 60KB
wrappers.pb.h 59KB
api.pb.h 56KB
cublasLt.h 55KB
cl_icd.h 54KB
npps_conversion_functions.h 54KB
SparseMatrix.h 53KB
math.h 52KB
ProductEvaluators.h 51KB
PacketMath.h 51KB
BDCSVD.h 50KB
sm_20_intrinsics.h 49KB
curand_kernel.h 49KB
map.h 48KB
niRFSAErrors.h 47KB
niRFSAErrors.h 47KB
message_differencer.h 46KB
PlainObjectBase.h 45KB
curand.h 44KB
struct.pb.h 43KB
共 2000 条
- 1
- 2
- 3
- 4
- 5
- 6
- 20
资源评论
阳光开朗男孩
- 粉丝: 316
- 资源: 151
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功