mirror of
https://github.com/eclipse/upm.git
synced 2025-07-02 09:51:14 +03:00
upmc: Updates for building C modules w/base UPM
Test commit for building C UPM modules. * Added C include directory * Added C utilities directory * Rename C++ upm.h -> upm.hpp to make room for C upm.h * Added upm_mixed_module_init function to src/CMakeLists.txt. This function takes filesnames similar to upm_module_init and does a bit of processing before calling upm_module_init. * Added c example directory. Changed c++ example names. * Added dfrph implemention for testing (C++ wraps C). Added mraa to .pc requires for dfrph. Tested against stand-alone project. Added dfrph c example. * Update implemention of pkg-config file generation. * Added two cmake cache variables: BUILDCPP and BUILDFTI * Removed src from swig_add_module calls, added libname to swig_link_libraries calls. Shrinks swig'ed binaries by ~13%. * Added install target in upm/CMakeLists.txt to install C header, directory. Is this where we want this? * C FTI header directory is include/fti Signed-off-by: Noel Eck <noel.eck@intel.com>
This commit is contained in:
122
include/upm_fti.h
Normal file
122
include/upm_fti.h
Normal file
@ -0,0 +1,122 @@
|
||||
/*
|
||||
* Authors:
|
||||
* 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.
|
||||
*/
|
||||
|
||||
#ifndef UPM_FTI_H_
|
||||
#define UPM_FTI_H_
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/**
|
||||
* The UPM Function Table Interface (FTI)
|
||||
*/
|
||||
|
||||
|
||||
/* Sensor categories */
|
||||
typedef enum {
|
||||
UPM_ACCELEROMETER,
|
||||
UPM_ANGLE,
|
||||
UPM_AUDIO,
|
||||
UPM_COMPASS,
|
||||
UPM_CURRENT,
|
||||
UPM_DISPLAY,
|
||||
UPM_DISTANCE,
|
||||
UPM_ELECTRICITY,
|
||||
UPM_FLOW,
|
||||
UPM_FORCE,
|
||||
UPM_GAS,
|
||||
UPM_GYROSCOPE,
|
||||
UPM_HEART_RATE,
|
||||
UPM_HUMIDITY,
|
||||
UPM_IMU,
|
||||
UPM_JOYSTICK,
|
||||
UPM_LED,
|
||||
UPM_LIGHT,
|
||||
UPM_MOISTURE,
|
||||
UPM_NFC,
|
||||
UPM_PH,
|
||||
UPM_POTENTIOMETER,
|
||||
UPM_PRESSURE,
|
||||
UPM_RAW,
|
||||
UPM_SENSOR,
|
||||
UPM_SERVO,
|
||||
UPM_STEPPER,
|
||||
UPM_SWITCH,
|
||||
UPM_TEMPERATURE,
|
||||
UPM_TIME,
|
||||
UPM_VIBRATION,
|
||||
UPM_VIDEO,
|
||||
UPM_VOLTAGE,
|
||||
UPM_WIRELESS,
|
||||
UPM_STREAM
|
||||
} upm_sensor_t;
|
||||
|
||||
/* Supported IO protocols via MRAA */
|
||||
typedef enum {
|
||||
UPM_ANALOG,
|
||||
UPM_GPIO,
|
||||
UPM_PWM,
|
||||
UPM_I2C,
|
||||
UPM_SPI,
|
||||
UPM_UART,
|
||||
UPM_ONEWIRE
|
||||
} upm_protocol_t;
|
||||
|
||||
/* Sensor descriptor */
|
||||
typedef struct _upm_sensor_descriptor {
|
||||
const char* name;
|
||||
const char* description;
|
||||
int protocol_size;
|
||||
const upm_protocol_t* protocol;
|
||||
int category_size;
|
||||
const upm_sensor_t* category;
|
||||
} upm_sensor_descriptor_t;
|
||||
|
||||
/* Function pointer typedef helpers */
|
||||
typedef struct _upm_sensor_ft* (*func_get_upm_sensor_ft)(upm_sensor_t sensor_type);
|
||||
|
||||
#include <fti/upm_acceleration.h>
|
||||
#include <fti/upm_angle.h>
|
||||
#include <fti/upm_audio.h>
|
||||
#include <fti/upm_distance.h>
|
||||
#include <fti/upm_heart_rate.h>
|
||||
#include <fti/upm_ph.h>
|
||||
#include <fti/upm_potentiometer.h>
|
||||
#include <fti/upm_servo.h>
|
||||
#include <fti/upm_sensor.h>
|
||||
#include <fti/upm_switch.h>
|
||||
#include <fti/upm_temperature.h>
|
||||
#include <fti/upm_touch.h>
|
||||
#include <fti/upm_voltage.h>
|
||||
#include <fti/upm_vibration.h>
|
||||
#include <fti/upm_moisture.h>
|
||||
#include <fti/upm_light.h>
|
||||
#include <fti/upm_stream.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif /* UPM_FTI_H_ */
|
Reference in New Issue
Block a user