Example #1
0
void LSM9DS0::xmWriteByte(uint8_t subAddress, uint8_t data)
{
	// Whether we're using I2C or SPI, write a byte using the
	// accelerometer-specific I2C address or SPI CS pin.
	if (interfaceMode == MODE_I2C)
		return I2CwriteByte(xmAddress, subAddress, data);
	else if (interfaceMode == MODE_SPI)
		return SPIwriteByte(xmAddress, subAddress, data);
}
Example #2
0
void LSM9DS0::gWriteByte(uint8_t subAddress, uint8_t data)
{
	// Whether we're using I2C or SPI, write a byte using the
	// gyro-specific I2C address or SPI CS pin.
	if (interfaceMode == MODE_I2C)
		I2CwriteByte(gAddress, subAddress, data);
	else if (interfaceMode == MODE_SPI)
		SPIwriteByte(gAddress, subAddress, data);
}
Example #3
0
/* ************************************************************************** */
static void gWriteByte(stLSM9DS0_t * stThis, uint8_t subAddress, uint8_t data)
{
    // Whether we're using I2C or SPI, write a byte using the
    // gyro-specific I2C address or SPI CS pin.
    if (stThis->interfaceMode == MODE_I2C)
        I2CwriteByte(stThis, stThis->gAddress, subAddress, data);
    else if (stThis->interfaceMode == MODE_SPI)
        SPIwriteByte(stThis, stThis->gAddress, subAddress, data);
}
Example #4
0
void xmWriteByte(LSM9DS0_t* lsm_t, uint8_t subAddress, uint8_t data)
{
	// Whether we're using I2C or SPI, write a byte using the
	// accelerometer-specific I2C address or SPI CS pin.
	#if(LSM_I2C_SUPPORT==1)
	if (lsm_t->interfaceMode == MODE_I2C)
		I2CwriteByte(lsm_t->xmAddress, subAddress, data);
	else if (lsm_t->interfaceMode == MODE_SPI)
	#endif
		SPIwriteByte(lsm_t->xmAddress, subAddress, data,'a');
}