29 if ((pSensorHandle == NULL) || (pBus == NULL))
40 if ((ARM_DRIVER_OK != status) || (whoAmi != reg))
66 if ((pSensorHandle == NULL) || (pRegWriteList == NULL))
80 if (ARM_DRIVER_OK != status)
88 if (ARM_DRIVER_OK != status)
96 if (ARM_DRIVER_OK != status)
111 if ((pSensorHandle == NULL) || (pReadList == NULL) || (pBuffer == NULL))
125 if (ARM_DRIVER_OK != status)
135 if (pSensorHandle == NULL)
ARM_DRIVER_I2C * pCommDrv
int32_t Sensor_I2C_Read(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerreadlist_t *pReadList, uint8_t *pOutBuffer)
Read register data from a sensor.
This structure defines the Write command List.
int32_t Register_I2C_Read(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t length, uint8_t *pOutBuffer)
The interface function to read a sensor register.
int32_t Register_I2C_Write(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, uint8_t offset, uint8_t value, uint8_t mask, bool repeatedStart)
The interface function to write a sensor register.
int32_t MMA845x_I2C_Deinit(mma845x_i2c_sensorhandle_t *pSensorHandle)
The interface function to De Initialize sensor..
int32_t MMA845x_I2C_Configure(mma845x_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
int32_t MMA845x_I2C_Initialize(mma845x_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor.
void MMA845x_I2C_SetIdleTask(mma845x_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
int32_t Sensor_I2C_Write(ARM_DRIVER_I2C *pCommDrv, registerDeviceInfo_t *devInfo, uint16_t slaveAddress, const registerwritelist_t *pRegWriteList)
Write register data to a sensor.
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
#define MMA845x_CTRL_REG1_MODE_ACTIVE
#define MMA845x_CTRL_REG2_RST_ENABLED
registerDeviceInfo_t deviceInfo
#define MMA845x_CTRL_REG2_RST_MASK
This structure defines the Read command List.
#define MMA845x_CTRL_REG1_MODE_STANDBY
This defines the sensor specific information.
#define MMA845x_CTRL_REG1_MODE_MASK
The mma845x_drv.h file describes the MMA845x driver interface and structures.
registeridlefunction_t idleFunction
int32_t MMA845x_I2C_ReadData(mma845x_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.