61 { 0.000061, 0.0, 8, 0},
62 { 0.000122, 0.0, 16, 0},
63 { 0.000244, 0.0, 32, 0}
77 void mma865x_SetMode(int32_t *status,
void* pSensorHandle, int32_t Mode);
102 if ( NULL == pSensorHandle){
119 if (NULL == pDeviceDescriptor) {
127 pCurrentSampleBuffer->
accel[0] = 0;
128 pCurrentSampleBuffer->
accel[1] = 0;
129 pCurrentSampleBuffer->
accel[2] = 0;
154 _time_delay_ticks(1);
194 if ((NULL == pSensorHandle) || (NULL == pSensorSettings)) {
223 if((NULL == pSensorHandle) || (NULL == pSensorSettings) ){
235 if (NULL == pDeviceDescriptor)
245 goto unlockdescriptor;
251 goto unlockdescriptor;
312 if(NULL == pSensorHandle){
323 if (NULL == pDeviceDescriptor)
332 goto unlockdescriptor;
338 goto unlockdescriptor;
343 goto unlockdescriptor;
372 if(NULL == pSensorHandle){
385 if (NULL == pDeviceDescriptor)
393 goto unlockdescriptor;
400 goto unlockdescriptor;
406 goto unlockdescriptor;
455 if(NULL == pSensorHandle){
485 if(NULL == pSensorHandle){
497 if (NULL == pDeviceDescriptor){
515 if (MQX_OK !=_lwsem_wait_ticks(&pDeviceDescriptor->
deviceSemaphore, 0))
517 goto unlockdescriptor;
524 goto unlockdescriptor;
541 *pFifoEntry = *pCurrentSampleBuffer;
549 pCurrentSampleBuffer,
580 void *pConvertedSample,
589 switch (convertToType)
593 pConverter = float_accel3d_converter;
595 pConverter = fixed_accel3d_converter;
601 if (pConverter == NULL)
604 retStat = pConverter(
606 (mma865x_DataBuffer_t *)pNativeSample,
651 uint8 buffer[1] = {0};
671 _time_delay_ticks(1000/5);
681 uint8 buffer[1] = {0};
730 uint8 buffer[1] = {0x00};
772 _time_delay_ticks(1);
788 #define BYTES_FOR_FULL_READ 7
810 pSensorData[0] = ((
int16)registerData[1])<<8 | registerData[2];
811 pSensorData[1] = ((
int16)registerData[3])<<8 | registerData[4];
812 pSensorData[2] = ((
int16)registerData[5])<<8 | registerData[6];
833 for (
uint32 reg=0; reg < pConfigSpecific->regCount; reg++)
835 buffer[0] = pConfigSpecific->regPairs[reg].regValue;
877 uint8 maxDataRateIndex =
sizeof fsl_mma865x_period /
sizeof fsl_mma865x_period[0];
879 for (dataRate = 0; dataRate < maxDataRateIndex; dataRate++)
881 if (fsl_mma865x_period[dataRate] == pRequiredSettings->
nSamplePeriod)
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)
isf_status_t dm_channel_start(dm_ChannelDescriptor_t *apChannelDescriptor)
This function starts a channel.
void * pSensorSpecificSettings
This structure defines the dummy DSA data buffer format.
unsigned char uint8
This defines uint8 as unsigned char.
fsl_i2c_master_driver.h defines structures and types for the i2c master driver.
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
void mma865x_SetMode(int32_t *status, void *pSensorHandle, int32_t Mode)
This function sets the MMA865x part to the requested mode.
Standard fixed type for three axis accelerometers.
uint8 accelFullScaleRange
The fsl_mma865x_i2c_3D_accel.h file contains the definitions and functions supporting the MMA865x Sen...
isf_timestamp_t timestamp
void mma865x_Reset(int32_t *status, void *pSensorHandle)
This function resets the MMA865x sensor resulting in a default configuration for all registers...
uint32 isf_time_util_get_usec(void)
This API returns the time in microseconds.
isf_status_t dm_device_open(dm_ChannelDescriptor_t *apChannelDescriptor, void *apDevice, dm_DeviceDescriptor_t *apDeviceDescriptor)
This function creates a device handle for a device at a specified channel address.
isf_dsa_ControlData_t controlData
isf_fifo_status_t isf_fifo_lock(isf_fifo_t *pFifo)
Lock a sample buffer for exclusive access.
comm_State_t dm_channel_get_state(dm_ChannelDescriptor_t *apChannelDescriptor)
This function returns the channel state.
#define MMA865x_WHOAMI_VALUE_8653
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
isf_fifo_status_t isf_fifo_el_increment(isf_fifo_t *pFifo)
Routine increments the insert pointer after direct access.
isf_sensors.h contains the ISF Generic Sensor definitions and data structures required when a client ...
Information necessary to communicate with an I2C slave device.
API definitions, types, and macros for the Intelligent Sensing Framework (ISF) Bus Manager (BM)...
dm_DeviceDescriptor_t deviceHandle
This defines the DSA sensor device handle structure used to invoke the adapter access functions...
The mma865x.h contains the MMA865x Accelerometer register definitions, access macros, and device access functions.
uint8 sampleRateIndex
Holds the ODR index into the rate array fsl_mma865x_period */.
Define the sensor device descriptor.
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
LWSEM_STRUCT deviceSemaphore
unsigned long uint32
This defines uint32 as unsigned long.
isf_dsa_status_t mma865x_GetConfig(isf_dsa_SensorSettings_t *pRequiredSettings, DeviceDescriptor_t *pDeviceDes)
This function obtains the configuration register values for a given user configuration of the MMA865x...
isf_SensorDataTypes_t mma865x_SupportedDataTypes[]
dm_ChannelDescriptor_t cDescriptor
isf_status_t dm_device_write(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apWriteBuffer, uint32 aBuffsize, uint32 aNbyteWrite)
This function writes to a device.
isf_status_t bm_unregister_callback(bm_callback_token_t aToken)
This API unregisters one or more callbacks.
#define MMA865x_GET_FIELD(name, val)
#define BYTES_FOR_FULL_READ
This function retrieves the raw data from the MMA865x sensor.
void mma865x_ValidateConfig(int32_t *status, void *pSensorHandle, void *pSettings)
This function validates the configuration for the MMA865x sensor.
#define MMA865x_SET_FIELD(name, val)
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
isf_acceleration_g_fixed_32s1i16_t accel[3]
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
isf_SensorTypes_t mma865x_SupportedSensorTypes[]
Supported sensor and data types for MMA865x.
isf_acceleration_g_float_t accel[3]
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Convert(volatile isf_SensorHandle_t *pSensorHandle, isf_SensorDataTypes_t convertToType, isf_dsa_result_types_t resultType, void *pNativeSample, void *pConvertedSample, int32 *numBytes)
This function coverts the raw sample data to the desired output type.
isf_status_t dm_channel_acquire_lock(dm_ChannelDescriptor_t *apChannelDescriptor, isf_duration_t aTimeout)
This function locks the channel for exclusive access.
The isf_sensor_types.h contains the enumerated list of sensor types used by ISF.
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
The isf_util.h file contains the utility method declarations and macros.
enum isf_dsa_result_enums isf_dsa_result_types_t
bm_callback_token_t bm_register_periodic_callback(isf_duration_t aPeriod, bm_callback_t *pCallback, void *pCbData)
This API schedules a callback at the specified period.
void mma865x_CheckId(int32_t *status, void *pSensorHandle)
This function validates the MMA865x sensor is connected via the I2C bus.
void fsl_mma865x_i2c_3D_accel_PeriodicCallback(void *pSensorHandle)
isf_dsa_result_types_t resultFormat
isf_status_t dm_channel_init(dm_ChannelId_t aChannelId, dm_ChannelDescriptor_t *apChannelDescriptor)
This function initializes a channel.
isf_dsa_status_t mma865x_GetData(isf_SensorHandle_t *pSensorHandle, void *pBuffer)
isf_status_t bm_stop(bm_callback_token_t aTokens)
This API stops one or more callback(s) by setting them to the inactive state.
const isf_SensorConfig_t * pSensorStaticConfig
isf_status_t bm_start(boolean aSync, bm_callback_token_t aTokens)
This API sets one or more callback(s) to the active state.
uint32 isf_duration_t
ISF time duration in microseconds.
long int32
This defines int32 as long.
isf_SensorDataTypes_t resultType
Main ISF header file. Contains code common to all ISF components.
#define MMA865x_ACTIVE_MASK
LWEVENT_STRUCT * pEventGroup
short int16
This defines int16 as short.
The isf_sm_api.h contains the collection of APIs for the Sensor Manager as well as related defines an...
isf_dsa_AdapterStatus_t adapterStatus
sys_channelId_t channelId
Standard float type for three axis accelerometers.
#define MMA865x_WHOAMI_VALUE_8652
isf_fifo_t * pSampleBufferInfo
isf_status_t dm_device_read(dm_DeviceDescriptor_t *apDeviceDescriptor, int32 aOffset, uint8 *apReadBuffer, uint32 aBuffsize, uint32 aNbyteRead)
This function reads from a device.
unsigned short uint16
This defines uint16 as unsigned short.
#define BM_ERROR
This value specifies a general Bus Manager error. If an error occurs in registering a callback...
isf_dsa_status_t mma865x_SetConfig(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pConfigSettings)
This function sets the MMA865x sensor configuration.
int32 isf_status_t
ISF return status type.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing ...
isf_dsa_SensorSettings_t sensorSettings
isf_timestamp_t timestamp
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
isf_dsa_status_t fsl_mma865x_i2c_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
This structure defines important settings.
void * isf_fifo_el_get_insert_pointer(isf_fifo_t *pFifo)
Routine returns the insert pointer for direct access.
isf_status_t dm_channel_release_lock(dm_ChannelDescriptor_t *apChannelDescriptor)
This function releases exclusive channel access.
This structure defines a handle for the device.
const struct @21 mma865xAccelConvTable[]
The isf_accelerometer_types.h file contains the ISF data type definitions for use with the ISF generi...
This structure is a declaration of a channel descriptor type.
bm_callback_token_t token