diff --git a/src/uln200xa/CMakeLists.txt b/src/uln200xa/CMakeLists.txt index 196e7ab4..4d7cd75c 100644 --- a/src/uln200xa/CMakeLists.txt +++ b/src/uln200xa/CMakeLists.txt @@ -1,6 +1,6 @@ upm_mixed_module_init (NAME uln200xa DESCRIPTION "Darlington Stepper Driver" - C_HDR uln200xa.h + C_HDR uln200xa.h uln200xa_defs.h C_SRC uln200xa.c CPP_HDR uln200xa.hpp CPP_SRC uln200xa.cxx diff --git a/src/uln200xa/javaupm_uln200xa.i b/src/uln200xa/javaupm_uln200xa.i index 8e4004c3..e41873e4 100644 --- a/src/uln200xa/javaupm_uln200xa.i +++ b/src/uln200xa/javaupm_uln200xa.i @@ -1,7 +1,7 @@ %module javaupm_uln200xa %include "../upm.i" -%include "uln200xa.h" +%include "uln200xa_defs.h" %include "uln200xa.hpp" %{ #include "uln200xa.hpp" diff --git a/src/uln200xa/jsupm_uln200xa.i b/src/uln200xa/jsupm_uln200xa.i index 31945ee7..cb3d6c2a 100644 --- a/src/uln200xa/jsupm_uln200xa.i +++ b/src/uln200xa/jsupm_uln200xa.i @@ -1,7 +1,7 @@ %module jsupm_uln200xa %include "../upm.i" -%include "uln200xa.h" +%include "uln200xa_defs.h" %include "uln200xa.hpp" %{ #include "uln200xa.hpp" diff --git a/src/uln200xa/pyupm_uln200xa.i b/src/uln200xa/pyupm_uln200xa.i index b420550f..50ae6ac2 100644 --- a/src/uln200xa/pyupm_uln200xa.i +++ b/src/uln200xa/pyupm_uln200xa.i @@ -5,7 +5,7 @@ %feature("autodoc", "3"); -%include "uln200xa.h" +%include "uln200xa_defs.h" %include "uln200xa.hpp" %{ #include "uln200xa.hpp" diff --git a/src/uln200xa/uln200xa.h b/src/uln200xa/uln200xa.h index a5192699..c0385fec 100644 --- a/src/uln200xa/uln200xa.h +++ b/src/uln200xa/uln200xa.h @@ -29,6 +29,8 @@ #include +#include "uln200xa_defs.h" + #ifdef __cplusplus extern "C" { #endif @@ -58,14 +60,6 @@ extern "C" { } *uln200xa_context; - /** - * Enum to specify the direction of a motor - */ - typedef enum { - ULN200XA_DIR_CW = 0x01, - ULN200XA_DIR_CCW = 0x02 - } ULN200XA_DIRECTION_T; - /** * ULN200XA constructor * diff --git a/src/uln200xa/uln200xa_defs.h b/src/uln200xa/uln200xa_defs.h new file mode 100644 index 00000000..4e9e210b --- /dev/null +++ b/src/uln200xa/uln200xa_defs.h @@ -0,0 +1,41 @@ +/* + * Author: Jon Trulson + * Copyright (c) 2016 Intel Corporation. + * + * Permission is hereby granted, free of charge, to any person obtaining + * a copy of this software and associated documentation files (the + * "Software"), to deal in the Software without restriction, including + * without limitation the rights to use, copy, modify, merge, publish, + * distribute, sublicense, and/or sell copies of the Software, and to + * permit persons to whom the Software is furnished to do so, subject to + * the following conditions: + * + * The above copyright notice and this permission notice shall be + * included in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, + * EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND + * NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE + * LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION + * OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION + * WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + */ +#pragma once + + +#ifdef __cplusplus +extern "C" { +#endif + + /** + * Enum to specify the direction of a motor + */ + typedef enum { + ULN200XA_DIR_CW = 0x01, + ULN200XA_DIR_CCW = 0x02 + } ULN200XA_DIRECTION_T; + +#ifdef __cplusplus +} +#endif