/alps/pcitool

To get this branch, use:
bzr branch http://suren.me/webbzr/alps/pcitool

« back to all changes in this revision

Viewing changes to pywrap/pcipywrap.h

  • Committer: Suren A. Chilingaryan
  • Date: 2016-03-02 22:36:19 UTC
  • mfrom: (346.1.35 pcitool)
  • Revision ID: csa@suren.me-20160302223619-r1zd62x6kwbyd321
Further improvements of Python scripting and web-interface API for register manipulations by Vasiliy Chernov

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
typedef struct {
9
9
    void* ctx;
10
10
    int shared;
11
 
} Pcipywrap;
 
11
} pcipywrap;
12
12
 
13
13
/*!
14
14
 * \brief Redirect pcilib standart log stream to exeption text.
16
16
 * After that, logger will write last error, and all accumulated errors
17
17
 * to Python exeption text
18
18
 */
19
 
void __redirect_logs_to_exeption();
 
19
void redirect_logs_to_exeption();
20
20
 
21
21
/*!
22
22
 * \brief Wraps for pcilib_open function.
26
26
 */
27
27
PyObject* create_pcilib_instance(const char *fpga_device, const char *model);
28
28
 
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);
32
32
 
33
33
/*!
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.
38
38
 */
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);
40
40
 
41
41
/*!
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.
47
47
 */
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);
49
49
 
50
50
/*!
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.
54
54
 */
55
 
PyObject* Pcipywrap_get_property(Pcipywrap *self, const char *prop);
 
55
PyObject* pcipywrap_get_property(pcipywrap *self, const char *prop);
56
56
 
57
57
/*!
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.
62
62
 */
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);
67
 
 
68
 
PyObject* Pcipywrap_read_dma(Pcipywrap *self, unsigned char dma, size_t size);
69
 
 
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);
 
67
 
 
68
PyObject* pcipywrap_read_dma(pcipywrap *self, unsigned char dma, size_t size);
 
69
 
 
70
PyObject* pcipywrap_lock_global(pcipywrap *self);
 
71
void pcipywrap_unlock_global(pcipywrap *self);
72
72
 
73
73
/*!
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
78
78
 * for example.
79
79
 * \return 1, serialized to PyObject or NULL with exeption text, if failed.
80
80
 */
81
 
PyObject* Pcipywrap_lock(Pcipywrap *self, const char *lock_id);
 
81
PyObject* pcipywrap_lock(pcipywrap *self, const char *lock_id);
82
82
 
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);
85
85
 
86
86
#endif /* PCIPYWRAP_H */