upm/include/fti/upm_joystick.h
Noel Eck c1f9d15f67 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>
2016-09-14 14:07:44 -07:00

55 lines
2.1 KiB
C

/*
* 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_JOYSTICK_H_
#define UPM_JOYSTICK_H_
#include "upm_types.h"
#ifdef __cplusplus
extern "C" {
#endif
/* Joytick function table */
typedef struct _upm_joystick_ft
{
/* Set sensor offset in raw counts */
upm_result_t (*upm_joystick_set_offset_x) (const void* dev, float offset);
/* Set sensor offset in raw counts */
upm_result_t (*upm_joystick_set_offset_y) (const void* dev, float offset);
/* Set sensor scale in raw counts */
upm_result_t (*upm_joystick_set_scale_x) (const void* dev, float scale);
/* Set sensor scale in raw counts */
upm_result_t (*upm_joystick_set_scale_y) (const void* dev, float scale);
/* Read sensor value, return normalized value */
upm_result_t (*upm_joystick_get_value_x) (const void* dev, float* value);
/* Read sensor value, return normalized value */
upm_result_t (*upm_joystick_get_value_y) (const void* dev, float* value);
} upm_joystick_ft;
#ifdef __cplusplus
}
#endif
#endif /* UPM_JOYSTICK_H_ */