From 9a9ffd5594a5d27bbecf6160de2c33d44870f5bd Mon Sep 17 00:00:00 2001 From: Vasilii Chernov Date: Wed, 17 Feb 2016 17:20:25 +0100 Subject: Refactor pcipywrap to object --- pywrap/pcipywrap.i | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) (limited to 'pywrap/pcipywrap.i') 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; -- cgit v1.2.3