19 #include "clock_config.h"    21 #include "fsl_debug_console.h"    26 #include "Driver_I2C.h"    31 #include "issdk_hal.h"    32 #include "gpio_driver.h"    38 #define MMA865x_ACCEL_DATA_SIZE (6)    108     PRINTF(
"\r\n ISSDK MMA865x sensor driver example for Interrupt Mode.\r\n");
   118     if (ARM_DRIVER_OK != status)
   120         PRINTF(
"\r\n I2C Initialization Failed\r\n");
   125     status = I2Cdrv->PowerControl(ARM_POWER_FULL);
   126     if (ARM_DRIVER_OK != status)
   128         PRINTF(
"\r\n I2C Power Mode setting Failed\r\n");
   133     status = I2Cdrv->Control(ARM_I2C_BUS_SPEED, ARM_I2C_BUS_SPEED_FAST);
   134     if (ARM_DRIVER_OK != status)
   136         PRINTF(
"\r\n I2C Control Mode setting Failed\r\n");
   145         PRINTF(
"\r\n Sensor Initialization Failed\r\n");
   148     PRINTF(
"\r\n Successfully Initiliazed Sensor\r\n");
   157         PRINTF(
"\r\n MMA865x Sensor Configuration Failed, Err = %d \r\n", status);
   160     PRINTF(
"\r\n Successfully Applied MMA865x Sensor Configuration\r\n");
   178         if (ARM_DRIVER_OK != status)
   180             PRINTF(
"\r\n Read Failed. \r\n");
   185         rawData.
accel[0] = ((int16_t)data[0] << 8) | data[1];
   186         rawData.
accel[0] /= 16;
   187         rawData.
accel[1] = ((int16_t)data[2] << 8) | data[3];
   188         rawData.
accel[1] /= 16;
   189         rawData.
accel[2] = ((int16_t)data[4] << 8) | data[5];
   190         rawData.
accel[2] /= 16;
   193         PRINTF(
"\r\n Accel X = %d  Y = %d  Z = %d \r\n", rawData.
accel[0], rawData.
accel[1], rawData.
accel[2]);
 #define MMA865x_CTRL_REG1_DR_6_25HZ
 
#define MMA865x_CTRL_REG1_DR_MASK
 
#define MMA865x_CTRL_REG5_INT_CFG_DRDY_MASK
 
This structure defines the Write command List. 
 
This defines the sensor specific information. 
 
#define ASK_USER_TO_RESUME(x)
 
#define MMA865x_XYZ_DATA_CFG_FS_MASK
 
status_t SMC_SetPowerModeVlpr(void *arg)
Configures the system to VLPR power mode. API name used from Kinetis family to maintain compatibility...
 
#define MMA865x_CTRL_REG5_INT_CFG_DRDY_INT1
 
Access structure of the GPIO Driver. 
 
#define __END_WRITE_DATA__
 
#define MMA865x_CTRL_REG3_IPOL_MASK
 
typedef int32_t(DATA_FORMAT_Append_t))(void *pData
The interface function to append the data on the formated stream. 
 
int32_t MMA865x_I2C_ReadData(mma865x_i2c_sensorhandle_t *pSensorHandle, const registerreadlist_t *pReadList, uint8_t *pBuffer)
The interface function to read the sensor data. 
 
#define MMA865x_CTRL_REG3_IPOL_ACTIVE_HIGH
 
#define I2C_S_SIGNAL_EVENT
 
#define MMA865x_CTRL_REG2_MODS_MASK
 
#define BOARD_BootClockRUN
 
const registerreadlist_t cMma865xOutputValues[]
 
void(* registeridlefunction_t)(void *userParam)
This is the register idle function type. 
 
volatile bool gMma865xDataReady
 
GENERIC_DRIVER_GPIO Driver_GPIO_KSDK
 
int main(void)
This is the The main function implementation. 
 
uint8_t data[FXLS8962_DATA_SIZE]
 
int32_t MMA865x_I2C_Configure(mma865x_i2c_sensorhandle_t *pSensorHandle, const registerwritelist_t *pRegWriteList)
The interface function to configure he sensor. 
 
#define __END_READ_DATA__
 
void mma865x_int_data_ready_callback(void *pUserData)
This is the Sensor Data Ready ISR implementation. 
 
The mma865x_drv.h file describes the MMA865x driver interface and structures. 
 
#define MMA865x_CTRL_REG4_INT_EN_DRDY_EN
 
fxos8700_accelmagdata_t rawData
 
void(* toggle_pin)(pinID_t aPinId)
 
#define MMA865x_CTRL_REG2_MODS_HR
 
status_t SMC_SetPowerModeWait(void *arg)
Configures the system to WAIT power mode. API name used from Kinetis family to maintain compatibility...
 
#define MMA865x_XYZ_DATA_CFG_FS_2G
 
void(* pin_init)(pinID_t aPinId, gpio_direction_t dir, void *apPinConfig, gpio_isr_handler_t aIsrHandler, void *apUserData)
 
This structure defines the Read command List. 
 
This structure defines the mma865x raw data buffer. 
 
gpioHandleKSDK_t GREEN_LED
 
#define I2C_S_DEVICE_INDEX
 
void MMA865x_I2C_SetIdleTask(mma865x_i2c_sensorhandle_t *pSensorHandle, registeridlefunction_t idleTask, void *userParam)
: The interface function to set the I2C Idle Task. 
 
void BOARD_InitDebugConsole(void)
 
#define MMA8652_WHOAMI_VALUE
 
#define MMA865x_ACCEL_DATA_SIZE
 
#define MMA865x_CTRL_REG4_INT_EN_DRDY_MASK
 
int32_t MMA865x_I2C_Initialize(mma865x_i2c_sensorhandle_t *pSensorHandle, ARM_DRIVER_I2C *pBus, uint8_t index, uint16_t sAddress, uint8_t whoAmi)
The interface function to initialize the sensor. 
 
void BOARD_InitPins(void)
Configures pin routing and optionally pin electrical features. 
 
const registerwritelist_t cMma865xConfigInterrupt[]