md: move defines/register defs into separate header for SWIG

Signed-off-by: Jon Trulson <jtrulson@ics.com>
This commit is contained in:
Jon Trulson 2017-03-16 18:14:16 -06:00 committed by Jon Trulson
parent f9b5d7c52c
commit 8779700d82
6 changed files with 47 additions and 12 deletions

View File

@ -1,6 +1,6 @@
upm_mixed_module_init (NAME uln200xa upm_mixed_module_init (NAME uln200xa
DESCRIPTION "Darlington Stepper Driver" DESCRIPTION "Darlington Stepper Driver"
C_HDR uln200xa.h C_HDR uln200xa.h uln200xa_defs.h
C_SRC uln200xa.c C_SRC uln200xa.c
CPP_HDR uln200xa.hpp CPP_HDR uln200xa.hpp
CPP_SRC uln200xa.cxx CPP_SRC uln200xa.cxx

View File

@ -1,7 +1,7 @@
%module javaupm_uln200xa %module javaupm_uln200xa
%include "../upm.i" %include "../upm.i"
%include "uln200xa.h" %include "uln200xa_defs.h"
%include "uln200xa.hpp" %include "uln200xa.hpp"
%{ %{
#include "uln200xa.hpp" #include "uln200xa.hpp"

View File

@ -1,7 +1,7 @@
%module jsupm_uln200xa %module jsupm_uln200xa
%include "../upm.i" %include "../upm.i"
%include "uln200xa.h" %include "uln200xa_defs.h"
%include "uln200xa.hpp" %include "uln200xa.hpp"
%{ %{
#include "uln200xa.hpp" #include "uln200xa.hpp"

View File

@ -5,7 +5,7 @@
%feature("autodoc", "3"); %feature("autodoc", "3");
%include "uln200xa.h" %include "uln200xa_defs.h"
%include "uln200xa.hpp" %include "uln200xa.hpp"
%{ %{
#include "uln200xa.hpp" #include "uln200xa.hpp"

View File

@ -29,6 +29,8 @@
#include <mraa/gpio.h> #include <mraa/gpio.h>
#include "uln200xa_defs.h"
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
@ -58,14 +60,6 @@ extern "C" {
} *uln200xa_context; } *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 * ULN200XA constructor
* *

View File

@ -0,0 +1,41 @@
/*
* Author: Jon Trulson <jtrulson@ics.com>
* 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