bma456.c
/*!
 *	@brief This API enables/disables the features of the sensor.
 */
@brief This API enables/disables the features of the sensor.
@brief This API enables / disables the features of the sensor .
uint16_t bma456_feature_enable(uint8_t feature, uint8_t enable, struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	uint16_t rslt = BMA4_OK;
	uint8_t len;
	if (dev != NULL) {
		if (dev->chip_id == BMA456_CHIP_ID) {
			update_len(&len, feature, enable);
			rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, len, dev);
			if (rslt == BMA4_OK) {
				if (enable == TRUE) {
					rslt |= feature_enable(feature, len, feature_config, dev);
				} else {
					rslt |= feature_disable(feature, len, feature_config, dev);
				}
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_feature_enable ( uint8_t feature , uint8_t enable , struct bma4_dev * dev ) { uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 } ; uint16_t rslt = BMA4_OK ; uint8_t len ; if ( dev != NULL ) { if ( dev -> chip_id == BMA456_CHIP_ID ) { update_len ( & len , feature , enable ) ; rslt = bma4_read_regs ( BMA4_FEATURE_CONFIG_ADDR , feature_config , len , dev ) ; if ( rslt == BMA4_OK ) { if ( enable == TRUE ) { rslt |= feature_enable ( feature , len , feature_config , dev ) ; } else { rslt |= feature_disable ( feature , len , feature_config , dev ) ; } } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API enables/disables the features of the sensor.
@brief This API enables / disables the features of the sensor .
/* Update the length for read and write */ /* Enables the feature */ /* Disables the feature */