44 #include "clock_config.h" 45 #include "fsl_debug_console.h" 48 #include "Driver_I2C.h" 51 #include "issdk_hal.h" 62 #define RAW_ACCEL_DATA_SIZE (6) 105 PRINTF(
"\r\n ISSDK FXOS8700 sensor driver example demonstration with fifo mode\r\n");
109 if (ARM_DRIVER_OK != status)
111 PRINTF(
"\r\n I2C Initialization Failed\r\n");
116 status = I2Cdrv->PowerControl(ARM_POWER_FULL);
117 if (ARM_DRIVER_OK != status)
119 PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
124 status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
125 if (ARM_DRIVER_OK != status)
127 PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
136 PRINTF(
"\r\n Sensor Initialization Failed\r\n");
139 PRINTF(
"\r\n Successfully Initiliazed Sensor\r\n");
148 PRINTF(
"\r\n FXOS8700 Sensor Configuration Failed, Err = %d\r\n", status);
151 PRINTF(
"\r\n Successfully Applied FXOS8700 Sensor Configuration\r\n");
164 if (ARM_DRIVER_OK != status)
166 PRINTF(
"\r\n Read Failed. \r\n");
174 rawData.
accel[0] /= 4;
176 rawData.
accel[1] /= 4;
178 rawData.
accel[2] /= 4;
181 PRINTF(
"\r\n Accel X = %d Y = %d Z = %d\r\n", rawData.
accel[0], rawData.
accel[1], rawData.
accel[2]);
#define __END_WRITE_DATA__
The fxos8700_drv.h file describes the fxos8700 driver interface and structures.
int main(void)
Main function.
This structure defines the fxos8700 raw data buffer.
void FXOS8700_I2C_SetIdleTask(fxos8700_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
#define BOARD_BootClockRUN
#define FXOS8700_CTRL_REG1_DR_SINGLE_12P5_HZ
uint8_t data[FXLS8962_DATA_SIZE]
void BOARD_InitDebugConsole(void)
#define FXOS8700_F_SETUP_F_WMRK_MASK
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
This defines the sensor specific information for I2C.
#define FXOS8700_F_SETUP_F_MODE_FIFO_STOP_OVF
#define __END_READ_DATA__
#define FXOS8700_WHO_AM_I_PROD_VALUE
#define RAW_ACCEL_DATA_SIZE
#define FIFO_SIZE
The watermark value configured for FXAS21002 FIFO Buffer.
#define FXOS8700_F_SETUP_F_MODE_MASK
#define ASK_USER_TO_RESUME(x)
int32_t FXOS8700_I2C_Initialize(fxos8700_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor.
#define FXOS8700_F_SETUP_F_WMRK_SHIFT
int32_t FXOS8700_I2C_ReadData(fxos8700_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
#define I2C_S_DEVICE_INDEX
#define FXOS8700_F_STATUS_F_WMRK_FLAG_MASK
const registerreadlist_t FXOS8700_ACCEL_FIFO_READ[]
int32_t FXOS8700_I2C_Configure(fxos8700_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
#define FXOS8700_CTRL_REG1_DR_MASK
const registerreadlist_t FXOS8700_STATUS_READ[]
fxls8962_acceldataUser_t rawData
This structure defines the Write command List.
This structure defines the Read command List.
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.
#define FXOS8700_I2C_ADDR
#define I2C_S_SIGNAL_EVENT
const registerwritelist_t fxos8700_Config_with_Fifo[]