diff options
author | Vasilii Chernov <vchernov@inr.ru> | 2016-02-17 17:20:25 +0100 |
---|---|---|
committer | Vasilii Chernov <vchernov@inr.ru> | 2016-02-17 17:20:25 +0100 |
commit | 9a9ffd5594a5d27bbecf6160de2c33d44870f5bd (patch) | |
tree | 1fbe5bd017cdc2e81fd7a6a45669d64276438289 /pywrap/pcipywrap.i | |
parent | 3269dce32883e14b45cc490a0cc0037b4c808a68 (diff) | |
download | pcitool-9a9ffd5594a5d27bbecf6160de2c33d44870f5bd.tar.gz pcitool-9a9ffd5594a5d27bbecf6160de2c33d44870f5bd.tar.bz2 pcitool-9a9ffd5594a5d27bbecf6160de2c33d44870f5bd.tar.xz pcitool-9a9ffd5594a5d27bbecf6160de2c33d44870f5bd.zip |
Refactor pcipywrap to object
Diffstat (limited to 'pywrap/pcipywrap.i')
-rw-r--r-- | pywrap/pcipywrap.i | 32 |
1 files changed, 17 insertions, 15 deletions
diff --git a/pywrap/pcipywrap.i b/pywrap/pcipywrap.i index 952e145..88a746f 100644 --- a/pywrap/pcipywrap.i +++ b/pywrap/pcipywrap.i @@ -6,18 +6,20 @@ extern void __redirect_logs_to_exeption(); -extern PyObject* create_pcilib_instance(const char *fpga_device, const char *model = NULL); -extern PyObject* set_pcilib(PyObject* addr); -extern void close_curr_pcilib_instance(); -extern PyObject* get_curr_pcilib_instance(); - -extern PyObject* read_register(const char *regname, const char *bank = NULL); -extern PyObject* write_register(PyObject* val, const char *regname, const char *bank = NULL); - -extern PyObject* get_property(const char *prop); -extern PyObject* set_property(PyObject* val, const char *prop); - -extern PyObject* get_registers_list(const char *bank = NULL); -extern PyObject* get_register_info(const char* reg,const char *bank = NULL); - -extern PyObject* get_property_list(const char* branch = NULL); +typedef struct { + %extend { + Pcipywrap(const char* fpga_device = NULL, const char* model = NULL); + Pcipywrap(PyObject* ctx){return create_Pcipywrap(ctx);} + ~Pcipywrap(); + + PyObject* read_register(const char *regname = NULL, const char *bank = NULL); + PyObject* write_register(PyObject* val, const char *regname, const char *bank = NULL); + + PyObject* get_property(const char *prop); + PyObject* set_property(PyObject* val, const char *prop); + + PyObject* get_registers_list(const char *bank = NULL); + PyObject* get_register_info(const char* reg,const char *bank = NULL); + PyObject* get_property_list(const char* branch = NULL); + } +} Pcipywrap; |