16
16
* After that, logger will write last error, and all accumulated errors
17
17
* to Python exeption text
19
void __redirect_logs_to_exeption();
19
void redirect_logs_to_exeption();
22
22
* \brief Wraps for pcilib_open function.
27
27
PyObject* create_pcilib_instance(const char *fpga_device, const char *model);
29
Pcipywrap *new_Pcipywrap(const char* fpga_device, const char* model);
30
Pcipywrap *create_Pcipywrap(PyObject* ctx);
31
void delete_Pcipywrap(Pcipywrap *self);
29
pcipywrap *new_pcipywrap(const char* fpga_device, const char* model);
30
pcipywrap *create_pcipywrap(PyObject* ctx);
31
void delete_pcipywrap(pcipywrap *self);
34
34
* \brief Reads register value. Wrap for pcilib_read_register function.
36
36
* \param[in] bank should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
37
37
* \return register value, can be integer or float type; NULL with exeption text, if failed.
39
PyObject* Pcipywrap_read_register(Pcipywrap *self, const char *regname, const char *bank);
39
PyObject* pcipywrap_read_register(pcipywrap *self, const char *regname, const char *bank);
42
42
* \brief Writes value to register. Wrap for pcilib_write_register function.
45
45
* \param[in] bank should specify the bank name if register with the same name may occur in multiple banks, NULL otherwise
46
46
* \return 1, serialized to PyObject or NULL with exeption text, if failed.
48
PyObject* Pcipywrap_write_register(Pcipywrap *self, PyObject* val, const char *regname, const char *bank);
48
PyObject* pcipywrap_write_register(pcipywrap *self, PyObject* val, const char *regname, const char *bank);
51
51
* \brief Reads propety value. Wrap for pcilib_get_property function.
52
52
* \param[in] prop property name (full name including path)
53
53
* \return property value, can be integer or float type; NULL with exeption text, if failed.
55
PyObject* Pcipywrap_get_property(Pcipywrap *self, const char *prop);
55
PyObject* pcipywrap_get_property(pcipywrap *self, const char *prop);
58
58
* \brief Writes value to property. Wrap for pcilib_set_property function.
60
60
* \param[in] val Property value, that needs to be set. Can be int, float or string.
61
61
* \return 1, serialized to PyObject or NULL with exeption text, if failed.
63
PyObject* Pcipywrap_set_property(Pcipywrap *self, PyObject* val, const char *prop);
64
PyObject* Pcipywrap_get_registers_list(Pcipywrap *self, const char *bank);
65
PyObject* Pcipywrap_get_register_info(Pcipywrap *self, const char* reg,const char *bank);
66
PyObject* Pcipywrap_get_property_list(Pcipywrap *self, const char* branch);
68
PyObject* Pcipywrap_read_dma(Pcipywrap *self, unsigned char dma, size_t size);
70
PyObject* Pcipywrap_lock_global(Pcipywrap *self);
71
void Pcipywrap_unlock_global(Pcipywrap *self);
63
PyObject* pcipywrap_set_property(pcipywrap *self, PyObject* val, const char *prop);
64
PyObject* pcipywrap_get_registers_list(pcipywrap *self, const char *bank);
65
PyObject* pcipywrap_get_register_info(pcipywrap *self, const char* reg,const char *bank);
66
PyObject* pcipywrap_get_property_list(pcipywrap *self, const char* branch);
68
PyObject* pcipywrap_read_dma(pcipywrap *self, unsigned char dma, size_t size);
70
PyObject* pcipywrap_lock_global(pcipywrap *self);
71
void pcipywrap_unlock_global(pcipywrap *self);
74
74
* \brief Wrap for pcilib_lock
75
75
* \param lock_id lock identificator
76
76
* \warning This function should be called only under Python standart threading lock.
77
* Otherwise it will stuck with more than 1 threads. See /xml/test_pywrap/test_prop_mt.py
77
* Otherwise it will stuck with more than 1 threads. See /xml/test/test_prop4.py
79
79
* \return 1, serialized to PyObject or NULL with exeption text, if failed.
81
PyObject* Pcipywrap_lock(Pcipywrap *self, const char *lock_id);
81
PyObject* pcipywrap_lock(pcipywrap *self, const char *lock_id);
83
PyObject* Pcipywrap_try_lock(Pcipywrap *self, const char *lock_id);
84
PyObject* Pcipywrap_unlock(Pcipywrap *self, const char *lock_id);
83
PyObject* pcipywrap_try_lock(pcipywrap *self, const char *lock_id);
84
PyObject* pcipywrap_unlock(pcipywrap *self, const char *lock_id);
86
86
#endif /* PCIPYWRAP_H */