Production Line Tool v5.0
The DA1470x Production Line Tool Software Package
Loading...
Searching...
No Matches
ammeter_api.h
Go to the documentation of this file.
1
16#ifndef _AMMETER_API_H_
17#define _AMMETER_API_H_
18
19/****************************************************************************************/
20/* INCLUDE FILES */
21/****************************************************************************************/
22 // @defgroup instruments
33
34
35
59#ifndef __bool_true_false_are_defined
60#define __bool_true_false_are_defined 1
61#ifndef __cplusplus /* In C++, 'bool', 'true' and 'false' and keywords */
62#define bool char
63#define true 1
64#define false 0
65#else
66#ifdef __GNUC__
67/* GNU C++ supports direct inclusion of stdbool.h to provide C99
68compatibility by defining _Bool */
69#define BOOL bool
70#endif
71#endif
72#endif /* __bool_true_false_are_defined */
73
74#define AMMETER_API_EXPORTS
75#ifdef AMMETER_API_EXPORTS
76#define AMMETER_API __declspec(dllexport)
77#else
78#define AMMETER_API __declspec(dllimport)
79#endif
80
81
82
90#define AMMETER_CALLBACK(A, Y, Z) (A != NULL) ? A(Y, Z) : ((void)0)
91
93#define AMMETER_STR_SIZE 256
110{
111 AMMETER_API_SUCCESS = 0,
112 AMMETER_API_ERROR,
113 AMMETER_API_INVALID_DBG_PARAMS,
114 AMMETER_API_DBG_DLL_ERROR,
115 AMMETER_API_START,
116 AMMETER_API_READ_OK
133#ifdef __cplusplus // If used by C++ code,
134extern "C" { // we need to export the C interface
135#endif
136
153typedef void (*_callback_ammeter)(int status, double val);
154
162AMMETER_API int ammeter_api_dbg_init(_dbg_params *dbg_params_t);
163
169AMMETER_API int ammeter_api_dbg_close(void);
170
179AMMETER_API int ammeter_api_init(const char *iface,
180 _callback_ammeter callback_ammeter);
181
187AMMETER_API int ammeter_api_close(void);
188
196AMMETER_API int ammeter_api_shunt_res(float shunt_res);
197
205AMMETER_API int ammeter_api_range(double range);
206
214AMMETER_API int ammeter_api_resolution(double resolution);
215
223AMMETER_API int ammeter_api_samples(uint32_t samples);
224
232AMMETER_API int ammeter_api_gen_cmd(const char *gen_cmd);
233
239AMMETER_API int ammeter_api_measure(void);
240
243#ifdef __cplusplus
244}
245#endif // @defgroup ammeter_api
247
248#endif //_AMMETER_API_H_
AMMETER_API int ammeter_api_samples(uint32_t samples)
Set the number of samples/measurements that the instrument will take and average.
AMMETER_API int ammeter_api_dbg_close(void)
Current measurement instrument debug session close.
AMMETER_API int ammeter_api_dbg_init(_dbg_params *dbg_params_t)
Current measurement instrument debug session initialize.
AMMETER_API int ammeter_api_gen_cmd(const char *gen_cmd)
Set a SCPI command that will be passed to the instrument. Multiple, column separated commands,...
AMMETER_API int ammeter_api_resolution(double resolution)
Set the resolution that the instrument will operate.
AMMETER_API int ammeter_api_range(double range)
Set the ampere range that the instrument will operate.
void(* _callback_ammeter)(int status, double val)
Current measurement API callback function type definition.
Definition: ammeter_api.h:153
AMMETER_API int ammeter_api_close(void)
Current measurement instrument close function and free allocated resources.
AMMETER_API int ammeter_api_init(const char *iface, _callback_ammeter callback_ammeter)
Current measurement instrument initialize function.
AMMETER_API int ammeter_api_shunt_res(float shunt_res)
Set the shunt resistor value. Only used if voltmeters or NI-DAQs are used to measure current.
AMMETER_API int ammeter_api_measure(void)
Perform a current measurement and return the result.
enum _AMMETER_API_STATUS_CODES AMMETER_API_STATUS_CODES
The Current measurement instrument API return status codes.
_AMMETER_API_STATUS_CODES
The Current measurement instrument API return status codes.
Definition: ammeter_api.h:110
The main settings of the Debug DLL API.
Definition: dbg_dll.h:143