17 #include "clock_config.h" 19 #include "fsl_debug_console.h" 22 #include "Driver_I2C.h" 25 #include "issdk_hal.h" 65 PRINTF(
"\r\n ISSDK FXAS21002 sensor driver example demonstration with poll mode\r\n");
69 if (ARM_DRIVER_OK != status)
71 PRINTF(
"\r\n I2C Initialization Failed\r\n");
76 status = I2Cdrv->PowerControl(ARM_POWER_FULL);
77 if (ARM_DRIVER_OK != status)
79 PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
84 status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
85 if (ARM_DRIVER_OK != status)
87 PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
96 PRINTF(
"\r\n Sensor Initialization Failed\r\n");
99 PRINTF(
"\r\n Successfully Initiliazed Sensor\r\n");
108 PRINTF(
"\r\n FXAS21002 Sensor Configuration Failed, Err = %d\r\n", status);
111 PRINTF(
"\r\n Successfully Applied FXAS21002 Sensor Configuration\r\n");
124 if (ARM_DRIVER_OK != status)
126 PRINTF(
"\r\n Read Failed. \r\n");
131 rawData.
gyro[0] = ((int16_t)data[0] << 8) | data[1];
132 rawData.
gyro[1] = ((int16_t)data[2] << 8) | data[3];
133 rawData.
gyro[2] = ((int16_t)data[4] << 8) | data[5];
136 PRINTF(
"\r\n Gyro X = %d Y = %d Z = %d\r\n", rawData.
gyro[0], rawData.
gyro[1], rawData.
gyro[2]);
#define FXAS21002_WHO_AM_I_WHOAMI_PROD_VALUE
This structure defines the Write command List.
#define ASK_USER_TO_RESUME(x)
const registerreadlist_t fxas21002_Output_Values[]
int32_t FXAS21002_I2C_Initialize(fxas21002_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor.
const registerreadlist_t fxas21002_DRDY[]
This structure defines the fxas21002 raw data buffer.
#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 I2C_S_SIGNAL_EVENT
int32_t FXAS21002_I2C_Configure(fxas21002_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor.
This defines the sensor specific information for I2C.
#define BOARD_BootClockRUN
#define FXAS21002_I2C_ADDR
uint8_t data[FXLS8962_DATA_SIZE]
#define FXAS21002_DR_STATUS_ZYXDR_MASK
#define __END_READ_DATA__
The fxas21002_drv.h file describes the fxas21002 driver interface and structures. ...
int32_t FXAS21002_I2C_ReadData(fxas21002_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data.
fxos8700_accelmagdata_t rawData
#define FXAS21002_GYRO_DATA_SIZE
The size of the FXAS21002 gyro data.
#define FXAS21002_CTRL_REG1_DR_MASK
int main(void)
Main function.
This structure defines the Read command List.
const registerwritelist_t fxas21002_Config_Normal[]
#define I2C_S_DEVICE_INDEX
#define FXAS21002_CTRL_REG1_DR_12_5HZ
void BOARD_InitDebugConsole(void)
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features.