OpenEL  3.0.0
openEL_sensor.c
Go to the documentation of this file.
1 
12 /*
13 
14 Copyright (c) 2017,2018 Japan Embedded Systems Technology Association(JASA)
15 All rights reserved.
16 
17 Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
18 
19  Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
20  Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
21  Neither the name of the Association nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
22 
23 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
24 */
25 
26 #define OPENEL_SW_SURFACE_FRIEND (1)
27 #include "openEL.h"
28 #include <stdio.h>
29 
31  printf("HalTorqueSensorGetValue()\n");
32  int32_t this;
33  this = halComponent->halComponent_core.handle;
34  printf("this=%x\n", this);
35 #if 1 == EL_SW_FAST
36  uint32_t physicalPortID = elPortTbl[this].physicalPortID;
37 #else
38  uint32_t physicalPortID;
39  if ( 0 == (physicalPortID = elGetPhyicalPortID(this,ELSENSOR_PROPERTY)) ) {
40  return HAL_ERROR;
41  }
42 #endif
43  return elPortTbl[this].fncTbl.pSensor->pFncGetValue(&halComponent, &list);
44 }
45 
46 enum ReturnCode HalTorqueSensorGetTimedValue(HALCOMPONENT_T *halComponent, halfloat *list, int32_t *timer) {
47  printf("HalTorqueSensorGetTimedValue()\n");
48  int32_t this;
49  this = halComponent->halComponent_core.handle;
50  printf("this=%x\n", this);
51 #if 1 == EL_SW_FAST
52  uint32_t physicalPortID = elPortTbl[this].physicalPortID;
53 #else
54  uint32_t physicalPortID;
55  if ( 0 == (physicalPortID = elGetPhyicalPortID(this,ELSENSOR_PROPERTY)) ) {
56  return HAL_ERROR;
57  }
58 #endif
59  return elPortTbl[this].fncTbl.pSensor->pFncGetTimedValue(&halComponent, &list, &timer);
60 }
61 
62 /*
63 ELInt32 elGetAnalog(ELUInt32 portID,ELUInt32 ch,ELUInt32 *pOutAnalogValue) {
64 #if 1 == EL_SW_FAST
65  ELUint32 physicalPortID = elPortTbl[portID].physicalPortID;
66 #else
67  ELUInt32 physicalPortID;
68  if ( 0 == (physicalPortID = elGetPhyicalPortID(portID,ELSENSOR_PROPERTY)) ) {
69  return EL_ERR_INIT;
70  }
71 #endif
72  return elPortTbl[portID].fncTbl.pSensor->pFncGetAnalog(physicalPortID,ch,pOutAnalogValue);
73 }
74 */
struct elSensorFncTblSt * pSensor
Definition: openEL.h:30
struct elPort_st elPortTbl[EL_PORT_ID_MAX]
Definition: openEL.c:44
#define ELSENSOR_PROPERTY
Definition: openEL_sensor.h:29
OpenEL Common Header File 3.0.0.
enum ReturnCode HalTorqueSensorGetTimedValue(HALCOMPONENT_T *halComponent, halfloat *list, int32_t *timer)
Definition: openEL_sensor.c:46
HALCOMPONENT_CORE_T halComponent_core
Definition: openEL.h:163
EL_CMN_FNC_TBL_T fncTbl
Definition: openEL.h:226
ReturnCode
Definition: openEL.h:44
enum ReturnCode(* pFncGetValue)(HALCOMPONENT_T **halComponent, halfloat **list)
Definition: openEL_sensor.h:51
uint32_t physicalPortID
Definition: openEL.h:225
float32_t halfloat
Definition: openEL.h:53
enum ReturnCode(* pFncGetTimedValue)(HALCOMPONENT_T **halComponent, halfloat **list, int32_t **timer)
Definition: openEL_sensor.h:52
int32_t elGetPhyicalPortID(uint32_t portID, uint32_t PropertyID)
Definition: openEL.c:196
enum ReturnCode HalTorqueSensorGetValue(HALCOMPONENT_T *halComponent, halfloat *list)
Definition: openEL_sensor.c:30