java: changed some C types to C++ types

Signed-off-by: Andrei Vasiliu <andrei.vasiliu@intel.com>
Signed-off-by: Mihai Tudor Panu <mihai.tudor.panu@intel.com>

Conflicts:
	src/mma7455/mma7455.cxx
	src/mma7455/mma7455.h
	src/sm130/sm130.cxx
	src/sm130/sm130.h
This commit is contained in:
Andrei Vasiliu
2015-09-02 14:56:13 +03:00
committed by Mihai Tudor Panu
parent b8835958e2
commit ab730038fd
46 changed files with 731 additions and 996 deletions

View File

@@ -24,7 +24,7 @@
#pragma once
#include <string>
#include <mraa/i2c.h>
#include <mraa/i2c.hpp>
#define ADDR 0x1D // device address
@@ -164,7 +164,7 @@ typedef union {
*
* @brief API for the MMA7455 Accelerometer
*
* This module defines the MMA7455 interface for libmma7455
* This file defines the MMA7455 interface for libmma7455
*
* @image html mma7455.jpg
* @snippet mma7455.cxx Interesting
@@ -179,15 +179,8 @@ class MMA7455 {
*/
MMA7455 (int bus=0, int devAddr=0x1D);
/**
* MMA7455 object destructor; basically, it closes the I2C connection.
*/
~MMA7455 ();
/**
* Returns the name of the component
*
* @return Name of the component
*/
std::string name()
{
@@ -196,10 +189,8 @@ class MMA7455 {
/**
* Calibrates the sensor
*
* @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise
*/
mraa_result_t calibrate ();
mraa::Result calibrate ();
/**
* Reads X-axis, Y-axis, and Z-axis acceleration data
@@ -207,10 +198,8 @@ class MMA7455 {
* @param ptrX X-axis
* @param ptrY Y-axis
* @param ptrZ Z-axis
*
* @return 0 (MRAA_SUCCESS) if successful; non-zero otherwise
*/
mraa_result_t readData (short * ptrX, short * ptrY, short * ptrZ);
mraa::Result readData (short * ptrX, short * ptrY, short * ptrZ);
#ifdef SWIGJAVA
/**
@@ -220,29 +209,31 @@ class MMA7455 {
*/
short *readData ();
#endif
/**
* Internal function for reading I2C data
*
* @param reg Register address
* @param buf Register data buffer
* @param size Buffer size
*/
int i2cReadReg (unsigned char reg, unsigned char * buf, unsigned char size);
/**
* Internal function for writing I2C data
*
*
* @param reg Register address
* @param buf Register data buffer
* @param size Buffer size
*/
mraa_result_t i2cWriteReg (unsigned char reg, unsigned char * buf, unsigned char size);
int ic2ReadReg (unsigned char reg, unsigned char * buf, unsigned char size);
/**
*
*
* @param reg Register address
* @param buf Register data buffer
* @param size Buffer size
*/
mraa::Result ic2WriteReg (unsigned char reg, unsigned char * buf, unsigned char size);
private:
std::string m_name;
int m_controlAddr;
int m_bus;
mraa_i2c_context m_i2ControlCtx;
mraa::I2c m_i2ControlCtx;
};
}