bma456.c
/*!
 *	@brief This API disables the features of the sensor.
 */
@brief This API disables the features of the sensor.
@brief This API disables the features of the sensor .
static uint16_t feature_disable(uint8_t feature, uint8_t len, uint8_t *feature_config, struct bma4_dev *dev)
{
	uint8_t index = 0;
	uint16_t rslt;
	if ((feature & BMA456_STEP_CNTR) > 0) {
		index = BMA456_STEP_CNTR_OFFSET + 1;
		feature_config[index] = feature_config[index] & (~BMA456_STEP_CNTR_EN_MSK);
	}
	if ((feature & BMA456_ACTIVITY) > 0) {
		index = BMA456_STEP_CNTR_OFFSET + 1;
		feature_config[index] = feature_config[index] & (~BMA456_ACTIVITY_EN_MSK);
	}
	if ((feature & BMA456_WAKEUP) > 0) {
		index = BMA456_WAKEUP_OFFSET;
		feature_config[index] = feature_config[index] & (~BMA456_WAKEUP_EN_MSK);
	}
	if ((feature & BMA456_WRIST_TILT) > 0) {
		index = BMA456_WRIST_TILT_OFFSET;
		feature_config[index] = feature_config[index] & (~BMA456_WRIST_TILT_EN_MSK);
	}
	if ((feature & BMA456_ANY_MOTION) > 0 || (feature & BMA456_NO_MOTION) > 0) {
		index = 1;
		if ((feature & BMA456_ANY_MOTION) > 0) {
			feature_config[index] = feature_config[index] | BMA456_ANY_NO_MOTION_SEL_MSK;
		} else {
			feature_config[index] = feature_config[index] & (~BMA456_ANY_NO_MOTION_SEL_MSK);
		}
		index = 3;
		feature_config[index] = feature_config[index] & (~BMA456_ANY_NO_MOTION_AXIS_EN_MSK);
	}
	rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
	return rslt;
}
static uint16_t feature_disable ( uint8_t feature , uint8_t len , uint8_t * feature_config , struct bma4_dev * dev ) { uint8_t index = 0 ; uint16_t rslt ; if ( ( feature & BMA456_STEP_CNTR ) > 0 ) { index = BMA456_STEP_CNTR_OFFSET + 1 ; feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_STEP_CNTR_EN_MSK ) ; } if ( ( feature & BMA456_ACTIVITY ) > 0 ) { index = BMA456_STEP_CNTR_OFFSET + 1 ; feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_ACTIVITY_EN_MSK ) ; } if ( ( feature & BMA456_WAKEUP ) > 0 ) { index = BMA456_WAKEUP_OFFSET ; feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_WAKEUP_EN_MSK ) ; } if ( ( feature & BMA456_WRIST_TILT ) > 0 ) { index = BMA456_WRIST_TILT_OFFSET ; feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_WRIST_TILT_EN_MSK ) ; } if ( ( feature & BMA456_ANY_MOTION ) > 0 || ( feature & BMA456_NO_MOTION ) > 0 ) { index = 1 ; if ( ( feature & BMA456_ANY_MOTION ) > 0 ) { feature_config [ index ] = feature_config [ index ] | BMA456_ANY_NO_MOTION_SEL_MSK ; } else { feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_ANY_NO_MOTION_SEL_MSK ) ; } index = 3 ; feature_config [ index ] = feature_config [ index ] & ( ~ BMA456_ANY_NO_MOTION_AXIS_EN_MSK ) ; } rslt = bma4_write_regs ( BMA4_FEATURE_CONFIG_ADDR , feature_config , len , dev ) ; return rslt ; }
@brief This API disables the features of the sensor.
@brief This API disables the features of the sensor .
/* Disable step counter */ /* Step counter enable bit pos. is 1 byte ahead of the
		base address */ /* Disable activity */ /* Activity enable bit pos. is 1 byte ahead of the
		base address */ /* Disable wakeup */ /* Wakeup enable bit pos. is the base address(0x38) of wakeup*/ /* Disable tilt */ /* Tilt enable bit pos. is the base address(0x3A) of tilt */ /* Disable anymotion/nomotion */ /* Any/Nomotion enable bit pos. is 1 bytes ahead of the
		any/nomotion base address(0x00) */ /* Disable anymotion */ /* Disable nomotion */ /* Any/Nomotion axis enable bit pos. is 3 byte ahead of the
		any/nomotion base address(0x00) */ /* Write the configured settings in the sensor */