17 #include "clock_config.h" 19 #include "fsl_debug_console.h" 22 #include "Driver_I2C.h" 25 #include "issdk_hal.h" 32 #define FXLS8962_DATA_SIZE 6 75 PRINTF(
"\r\n ISSDK FXLS896x sensor driver example demonstration with poll mode\r\n");
79 if (ARM_DRIVER_OK != status)
81 PRINTF(
"\r\n I2C Initialization Failed\r\n");
86 status = I2Cdrv->PowerControl(ARM_POWER_FULL);
87 if (ARM_DRIVER_OK != status)
89 PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
94 status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
95 if (ARM_DRIVER_OK != status)
97 PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
104 if (ARM_DRIVER_OK != status)
106 PRINTF(
"\r\n Sensor Initialization Failed\r\n");
111 PRINTF(
"\r\n Successfully Initialized Gemini with WHO_AM_I = 0x%X\r\n", whoami);
115 PRINTF(
"\r\n Successfully Initialized Timandra with WHO_AM_I = 0x%X\r\n", whoami);
119 PRINTF(
"\r\n Successfully Initialized Newstein with WHO_AM_I = 0x%X\r\n", whoami);
123 PRINTF(
"\r\n Bad WHO_AM_I = 0x%X\r\n", whoami);
131 if (ARM_DRIVER_OK != status)
133 PRINTF(
"\r\n FXLS896x Sensor Configuration Failed, Err = %d\r\n", status);
136 PRINTF(
"\r\n Successfully Applied FXLS896x Sensor Configuration\r\n");
149 if (ARM_DRIVER_OK != status)
151 PRINTF(
"\r\n Read Failed. \r\n");
156 rawData.
accel[0] = ((int16_t)data[1] << 8) | data[0];
157 rawData.
accel[1] = ((int16_t)data[3] << 8) | data[2];
158 rawData.
accel[2] = ((int16_t)data[5] << 8) | data[4];
161 PRINTF(
"\r\nX=%5d Y=%5d Z=%5d\r\n", rawData.
accel[0], rawData.
accel[1], rawData.
accel[2]);
This structure defines the fxls8962 raw data buffer.
This structure defines the Write command List.
#define ASK_USER_TO_RESUME(x)
#define FXLS8962_SENS_CONFIG1_FSR_2G
const registerreadlist_t cFxls8962DRDYEvent[]
Address of DATA Ready Status Register.
status_t SMC_SetPowerModeVlpr(void *arg)
Configures the system to VLPR power mode. API name used from Kinetis family to maintain compatibility...
The fxls8962_drv.h file describes the FXLS8962AF driver interface and structures. ...
int32_t FXLS8962_I2C_Initialize(fxls8962_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 __END_WRITE_DATA__
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream.
#define FXLS8962_INT_STATUS_SRC_DRDY_MASK
#define FXLS8962_DATA_SIZE
#define FXLS8962_SENS_CONFIG3_WAKE_ODR_MASK
This defines the sensor specific information for I2C.
#define FXLS8967_WHOAMI_VALUE
#define I2C_S_SIGNAL_EVENT
#define BOARD_BootClockRUN
fxls8962_i2c_sensorhandle_t fxls8962Driver
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type.
uint8_t data[FXLS8962_DATA_SIZE]
#define __END_READ_DATA__
int main(void)
Main function.
int32_t FXLS8962_I2C_ReadData(fxls8962_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
#define FXLS8962_SENS_CONFIG3_WAKE_ODR_6_25HZ
fxos8700_accelmagdata_t rawData
const registerwritelist_t cFxls8962ConfigNormal[]
Register settings for Normal (non buffered) mode.
const registerreadlist_t cFxls8962OutputNormal[]
Address of Raw Accel Data in Normal Mode.
void BOARD_SystickEnable(void)
Function to enable systicks framework.
int32_t FXLS8962_I2C_Configure(fxls8962_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
This structure defines the Read command List.
#define FXLS8962_SENS_CONFIG1_FSR_MASK
#define FXLS8974_WHOAMI_VALUE
#define I2C_S_DEVICE_INDEX
void FXLS8962_I2C_SetIdleTask(fxls8962_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task.
#define FXLS8962_I2C_ADDR
void BOARD_InitDebugConsole(void)
#define FXLS8962_WHOAMI_VALUE
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.
#define FXLS8964_WHOAMI_VALUE