示例#1
0
uint8_t LSM330D::gReadByte(uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// gyro-specific I2C address or SPI CS pin.
	if (interfaceMode == MODE_I2C)
		return I2CreadByte(gAddress, subAddress);
	
}
示例#2
0
uint8_t LSM330D::xmReadByte(uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// accelerometer-specific I2C address or SPI CS pin.
	if (interfaceMode == MODE_I2C)
		return I2CreadByte(xmAddress, subAddress);
	
}
uint8_t xgReadByte(uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// gyro-specific I2C address or SPI CS pin.
	if (settings.device.commInterface == IMU_MODE_I2C)
		return I2CreadByte(_xgAddress, subAddress);
	/*else if (settings.device.commInterface == IMU_MODE_SPI)
		return SPIreadByte(_xgAddress, subAddress);*/
}
示例#4
0
uint8_t mReadByte(uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// accelerometer-specific I2C address or SPI CS pin.
	if (settings.device.commInterface == IMU_MODE_I2C)
		return I2CreadByte(_mAddress, subAddress);
	else if (settings.device.commInterface == IMU_MODE_SPI)
		return SPIreadByte(_mAddress, subAddress);
}
示例#5
0
/* ************************************************************************** */
static uint8_t xmReadByte(stLSM9DS0_t * stThis, uint8_t subAddress)
{
    // Whether we're using I2C or SPI, read a byte using the
    // accelerometer-specific I2C address or SPI CS pin.
    if (stThis->interfaceMode == MODE_I2C)
        return I2CreadByte(stThis, stThis->xmAddress, subAddress);
    else if (stThis->interfaceMode == MODE_SPI)
        return SPIreadByte(stThis, stThis->xmAddress, subAddress);
}
示例#6
0
uint8_t gReadByte(LSM9DS0_t* lsm_t, uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// gyro-specific I2C address or SPI CS pin.

	// if (lsm_t->interfaceMode == MODE_I2C)
		return I2CreadByte(lsm_t->gAddress, subAddress);
	//else //if (lsm_t->interfaceMode == MODE_SPI)
		//return SPIreadByte(lsm_t->gAddress, subAddress,'g');
}
示例#7
0
uint8_t xmReadByte(LSM9DS0_t* lsm_t, uint8_t subAddress)
{
	// Whether we're using I2C or SPI, read a byte using the
	// accelerometer-specific I2C address or SPI CS pin.
	#if(LSM_I2C_SUPPORT==1)
	if (lsm_t->interfaceMode == MODE_I2C)
		return I2CreadByte(lsm_t->xmAddress, subAddress);
	else if (lsm_t->interfaceMode == MODE_SPI)
	#endif
		return SPIreadByte(lsm_t->xmAddress, subAddress,'a');
}
示例#8
0
void ITG3701::begin(Gscale m_gscale, Godr m_godr, Gbw m_gbw)
{
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_PWR_MGMT_1, 0x00);  // Clear sleep mode bit (6), enable all sensors
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_PWR_MGMT_1, 0x01);  // Auto select clock source to be PLL gyroscope reference if ready else
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_CONFIG, 0x03);
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_SMPLRT_DIV, 0x04);
  uint8_t c = I2CreadByte(ITG3701_ADDRESS, ITG3701_GYRO_CONFIG);
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_GYRO_CONFIG, c & ~0x02); // Clear Fchoice bits [1:0]
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_GYRO_CONFIG, c & ~0x18); // Clear AFS bits [4:3]
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_GYRO_CONFIG, c | m_gscale << 3); // Set full scale range for the gyro
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_INT_PIN_CFG, 0x20);
  I2CwriteByte(ITG3701_ADDRESS, ITG3701_INT_ENABLE, 0x01);  // Enable data ready (bit 0) interrupt
  Wire.begin();
}
示例#9
0
int PulseOximeter::getPartID(void){
  return I2CreadByte(MAX30100_I2C_ADDRESS, MAX30100_REG_PART_ID);
}