Hi,
Thanks for your response.
I have checked the code and configured similarly in my Hexiwear board. But still the same, FXOS8700CQ sensor is not generating interrupt.
const gpio_input_pin_user_config_t Acc_cfg[] = {
{
.pinName = ACC_INT1,
.config.isPullEnable = false,
.config.pullSelect = kPortPullDown,
.config.isPassiveFilterEnabled = false,
.config.isDigitalFilterEnabled = false,
.config.interrupt = kPortIntDisabled
},
{
.pinName = ACC_INT2,
.config.isPullEnable = false,
.config.pullSelect = kPortPullDown,
.config.isPassiveFilterEnabled = false,
.config.isDigitalFilterEnabled = false,
.config.interrupt = kPortIntDisabled
},
{
.pinName = GPIO_PINS_OUT_OF_RANGE,
}
};
//Configured Pin 1 of PORTC as input
GPIO_DRV_Init( Acc_cfg, NULL );
//Sensor configuration
devStatus |= I2C_ReadReg( &(self.protocol), WHO_AM_I_REG, &chip_ID);
if(kFXOS_WHO_AM_I_Device_ID == chip_ID)
{
/** go to standby */
FXOS_GotoStandby();
devStatus |= I2C_ReadReg(&(self.protocol), FXOS_CTRL_REG1, tmp);
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG1, tmp[0] & (uint8_t)~ACTIVE_MASK);
devStatus |= I2C_ReadReg(&(self.protocol), FXOS_CTRL_REG1, tmp);
if ((tmp[0] & ACTIVE_MASK) == ACTIVE_MASK)
{
catch( CATCH_I2C );
}
devStatus |= I2C_WriteReg(&(self.protocol), XYZ_DATA_CFG_REG, FULL_SCALE_2G); // +/-2g range with 0.244mg/LSB
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_M_CTRL_REG1, (0x1F)); // Hybrid mode (accelerometer + magnetometer), max OSR
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_M_CTRL_REG2, 0x20); // M_OUT_X_MSB register 0x33 follows the OUT_Z_LSB register 0x06 (used for burst read)
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG2, 0x02); // High Resolution mode
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG3, 0x00); // Push-pull, active low
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG4, 0x01); // Enable DRDY interrupt
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG5, 0x01); // DRDY interrupt routed to INT1 - PTC1
devStatus |= I2C_WriteReg(&(self.protocol), FXOS_CTRL_REG1, 0x35); // ODR = 3.125Hz, Reduced noise, Active mode
FXOS_SetActive();
if ( STATUS_I2C_SUCCESS != devStatus )
{
catch( CATCH_I2C );
}
}
//Interrupt handler
void PORTC_IRQHandler(void)
{
PORT_HAL_ClearPortIntFlag(PORTC_BASE_PTR);
/** Write your code here ... */
/* Unblock the task by releasing the semaphore. */
portBASE_TYPE taskToWake = pdFALSE;
if (pdTRUE==xSemaphoreGiveFromISR(xReadRawDataSemaphore, &taskToWake))
{
FXOS8700CQ_DataReady = 1;
if (pdTRUE == taskToWake)
{
vPortYieldFromISR();
}
}
}
//Task to read data from sensor
void ReadRawData(task_param_t param)
{
xReadRawDataSemaphore = xSemaphoreCreateBinary();
if( xReadRawDataSemaphore == NULL )
{
configASSERT(0);
}
for(;;)
{
/*Block waiting for the semaphore to become available. */
if( xSemaphoreTake( xReadRawDataSemaphore, LONG_TIME ) == pdTRUE )
{
if(FXOS8700CQ_DataReady)
{
FXOS8700CQ_DataReady = 0;
FXOS_ReadRawData(&AccelMagData[0]);
}
vPortYieldFromISR();
}
}
}
Trying this from few days, but no luck. Request your support.
Thanks,
J. Chandra Sekhar