62 { 0.000061, 0.0, 8, 0},
63 { 0.000122, 0.0, 16, 0},
64 { 0.000244, 0.0, 32, 0}
102 if ( NULL == pSensorHandle){
125 if (NULL == pDeviceDescriptor) {
133 pCurrentSampleBuffer->
accel[0] = 0;
134 pCurrentSampleBuffer->
accel[1] = 0;
135 pCurrentSampleBuffer->
accel[2] = 0;
170 _time_delay_ticks(1);
210 if ((NULL == pSensorHandle) || (NULL == pSensorSettings)) {
239 if((NULL == pSensorHandle) || (NULL == pSensorSettings) ){
251 if (NULL == pDeviceDescriptor)
261 goto unlockdescriptor;
267 goto unlockdescriptor;
328 if(NULL == pSensorHandle){
339 if (NULL == pDeviceDescriptor)
348 goto unlockdescriptor;
354 goto unlockdescriptor;
359 goto unlockdescriptor;
388 if(NULL == pSensorHandle){
401 if (NULL == pDeviceDescriptor)
409 goto unlockdescriptor;
416 goto unlockdescriptor;
422 goto unlockdescriptor;
471 if(NULL == pSensorHandle){
501 if(NULL == pSensorHandle){
513 if (NULL == pDeviceDescriptor){
531 if (MQX_OK !=_lwsem_wait_ticks(&pDeviceDescriptor->
deviceSemaphore, 0))
533 goto unlockdescriptor;
540 goto unlockdescriptor;
557 *pFifoEntry = *pCurrentSampleBuffer;
565 pCurrentSampleBuffer,
596 void *pConvertedSample,
605 switch (convertToType)
609 pConverter = float_accel3d_converter;
611 pConverter = fixed_accel3d_converter;
617 if (pConverter == NULL)
620 retStat = pConverter(
622 (fxls8471_DataBuffer_t *)pNativeSample,
667 uint8 buffer[1] = {0};
687 _time_delay_ticks(1000/5);
697 uint8 buffer[1] = {0};
746 uint8 buffer[1] = {0x00};
788 _time_delay_ticks(1);
804 #define BYTES_FOR_FULL_READ 7
826 pSensorData[0] = ((
int16)registerData[1])<<8 | registerData[2];
827 pSensorData[1] = ((
int16)registerData[3])<<8 | registerData[4];
828 pSensorData[2] = ((
int16)registerData[5])<<8 | registerData[6];
841 uint8 address, value;
850 for (
uint32 reg=0; reg < pConfigSpecific->regCount; reg++)
852 address = pConfigSpecific->regPairs[reg].regAddr;
853 value = pConfigSpecific->regPairs[reg].regValue;
854 buffer[0] = pConfigSpecific->regPairs[reg].regValue;
896 uint8 maxDataRateIndex =
sizeof fsl_fxls8471_period /
sizeof fsl_fxls8471_period[0];
898 for (dataRate = 0; dataRate < maxDataRateIndex; dataRate++)
900 if (fsl_fxls8471_period[dataRate] == pRequiredSettings->
nSamplePeriod)
isf_status_t dm_channel_start(dm_ChannelDescriptor_t *apChannelDescriptor)
This function starts a channel.
#define FXLS8471_RST_MASK
void * pSensorSpecificSettings
unsigned char uint8
This defines uint8 as unsigned char.
fsl_i2c_master_driver.h defines structures and types for the i2c master driver.
Standard fixed type for three axis accelerometers.
This structure defines important settings.
isf_timestamp_t timestamp
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.
isf_fifo_status_t isf_fifo_unlock(isf_fifo_t *pFifo)
Release the exclusive access lock on a sample buffer.
isf_fifo_status_t isf_fifo_el_increment(isf_fifo_t *pFifo)
Routine increments the insert pointer after direct access.
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_EndData(isf_SensorHandle_t *pSensorHandle)
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Shutdown(isf_SensorHandle_t *pSensorHandle)
isf_sensors.h contains the ISF Generic Sensor definitions and data structures required when a client ...
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...
#define BYTES_FOR_FULL_READ
This function retrieves the raw data from the FXLS8471 sensor.
This structure defines the slave specific spi information.
Define the sensor device descriptor.
isf_dsa_status_t fxls8471_GetData(isf_SensorHandle_t *pSensorHandle, void *pBuffer)
LWSEM_STRUCT deviceSemaphore
uint8 sampleRateIndex
Holds the ODR index into the rate array fsl_fxls8471_period */.
unsigned long uint32
This defines uint32 as unsigned long.
isf_dsa_status_t fxls8471_GetConfig(isf_dsa_SensorSettings_t *pRequiredSettings, DeviceDescriptor_t *pDeviceDes)
This function obtains the configuration register values for a given user configuration of the FXLS847...
spi_master_busConfig_t busConfig
dm_ChannelDescriptor_t cDescriptor
const struct @17 fxls8471AccelConvTable[]
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.
The fxls8471.h contains the FXLS8471 Accelerometer register definitions, access macros, and device access functions.
#define FXLS8471_SET_FIELD(name, val)
The fsl_fxls8471_i2cspi_3D_accel.h file contains the definitions and functions supporting the MMA8652...
The isf_types.h file contains the ISF data type definitions and some of the globally used macros...
void fxls8471_ValidateConfig(int32_t *status, void *pSensorHandle, void *pSettings)
This function validates the configuration for the FXLS8471 sensor.
isf_dsa_status_t fsl_fxls8471_i2cspi_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_acceleration_g_fixed_32s1i16_t accel[3]
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Configure(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
int32 isf_dsa_status_t
This is the Sensor Manager API return type definition.
isf_acceleration_g_float_t accel[3]
void fxls8471_SetMode(int32_t *status, void *pSensorHandle, int32_t Mode)
This function sets the FXLS8471 part to the requested mode.
isf_SensorTypes_t fxls8471_SupportedSensorTypes[]
Supported sensor and data types for FXLS8471.
#define FXLS8471_GET_FIELD(name, val)
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.
The isf_util.h file contains the utility method declarations and macros.
enum isf_dsa_result_enums isf_dsa_result_types_t
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Calibrate(isf_SensorHandle_t *pSensorHandle, void *pCalData)
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.
#define FXLS8471_ACTIVE_MASK
#define FXLS8471_WHOAMI_VALUE
spi_master_slaveInfo_t * pSlaveInfo
isf_dsa_result_types_t resultFormat
isf_dsa_status_t fxls8471_SetConfig(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pConfigSettings)
This function sets the FXLS8471 sensor configuration.
void fxls8471_Reset(int32_t *status, void *pSensorHandle)
This function resets the FXLS8471 sensor resulting in a default configuration for all registers...
isf_SensorDataTypes_t fxls8471_SupportedDataTypes[]
isf_status_t dm_channel_init(dm_ChannelId_t aChannelId, dm_ChannelDescriptor_t *apChannelDescriptor)
This function initializes a channel.
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.
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
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_ValidateSettings(isf_SensorHandle_t *pSensorHandle, isf_dsa_SensorSettings_t *pSensorSettings)
Standard float type for three axis accelerometers.
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 fsl_fxls8471_i2cspi_3D_accel_StartData(isf_SensorHandle_t *pSensorHandle)
int32 isf_status_t
ISF return status type.
This structure defines the dummy DSA data buffer format.
This defines the DSA sensor configuration parameter structure configuring the sensor settings by a su...
uint8 accelFullScaleRange
isf_spi_master_types.h defines the spi protocol adapter structure and types.
isf_comm.h defines the common types for the Communications Service Family of the Intelligent Sensing ...
isf_status_t dm_channel_configure(dm_ChannelDescriptor_t *apChannelDescriptor, dm_ChannelConfig_ptr apChannelConfig)
This function reconfigures an already initialized channel.
isf_dsa_SensorSettings_t sensorSettings
isf_timestamp_t timestamp
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.
void fsl_fxls8471_i2cspi_3D_accel_PeriodicCallback(void *pSensorHandle)
The isf_accelerometer_types.h file contains the ISF data type definitions for use with the ISF generi...
void fxls8471_CheckId(int32_t *status, void *pSensorHandle)
This function validates the FXLS8471 sensor is connected via the I2C bus.
This structure is a declaration of a channel descriptor type.
bm_callback_token_t token
isf_dsa_status_t fsl_fxls8471_i2cspi_3D_accel_Initialize(isf_SensorHandle_t *pSensorHandle)