1 %rename("%(strip:[MRAA_])s", %$isenumitem) ""; 2 3 %include stdint.i 4 %include std_string.i 5 %include exception.i 6 7 #ifdef DOXYGEN 8 //and doesn't seem to work correctly in SWIG's preprocessor 9 #ifdef SWIGPYTHON 10 %include common_hpp_doc.i 11 %include gpio_class_doc.i 12 %include i2c_class_doc.i 13 %include pwm_class_doc.i 14 %include aio_class_doc.i 15 %include spi_class_doc.i 16 %include uart_class_doc.i 17 #endif 18 #endif 19 20 %{ 21 #include "common.hpp" 22 #include "types.hpp" 23 #include "gpio.hpp" 24 #include "pwm.hpp" 25 #include "i2c.hpp" 26 #include "spi.hpp" 27 #include "aio.hpp" 28 #include "uart.hpp" 29 %} 30 31 %exception { 32 try { 33 $action catch(const std::invalid_argument & e)34 } catch(const std::invalid_argument& e) { 35 SWIG_exception(SWIG_ValueError, e.what()); 36 } catch(...) { 37 SWIG_exception(SWIG_RuntimeError, "Unknown exception"); 38 } 39 } 40 41 %include "types.hpp" 42 43 %include "common.hpp" 44 45 %ignore Gpio::nop(uv_work_t* req); 46 %ignore Gpio::v8isr(uv_work_t* req); 47 %ignore Gpio::v8isr(uv_work_t* req, int status); 48 %ignore Gpio::uvwork(void *ctx); 49 %ignore Gpio::isr(Edge mode, void (*fptr)(void*), void* args); 50 51 %include "gpio.hpp" 52 53 %include "i2c.hpp" 54 55 %include "pwm.hpp" 56 57 %include "spi.hpp" 58 59 %include "aio.hpp" 60 61 %include "uart.hpp" 62