bma456.c
/*!
 *	@brief This API is used to select single/double tap
 *	feature in the sensor
 */
@brief This API is used to select single/double tap
feature in the sensor
@brief This API is used to select single / double tap feature in the sensor
uint16_t bma456_tap_selection(const uint8_t tap_select, struct bma4_dev *dev)
{
	uint16_t rslt = BMA4_OK;
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0,};
	uint8_t index = BMA456_WAKEUP_OFFSET;
	if (dev != NULL) {
		if (dev->chip_id == BMA456_CHIP_ID) {
			rslt = bma4_read_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config, BMA456_FEATURE_SIZE, dev);
			if (rslt == BMA4_OK) {
				feature_config[index] = BMA4_SET_BITSLICE(feature_config[index],
							BMA456_TAP_SEL, tap_select);
				rslt = bma4_write_regs(BMA4_FEATURE_CONFIG_ADDR, feature_config,
							BMA456_FEATURE_SIZE, dev);
			}
		} else {
			rslt = BMA4_E_INVALID_SENSOR;
		}
	} else {
		rslt = BMA4_E_NULL_PTR;
	}
	return rslt;
}
uint16_t bma456_tap_selection ( const uint8_t tap_select , struct bma4_dev * dev ) { uint16_t rslt = BMA4_OK ; uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 , } ; uint8_t index = BMA456_WAKEUP_OFFSET ; if ( dev != NULL ) { if ( dev -> chip_id == BMA456_CHIP_ID ) { rslt = bma4_read_regs ( BMA4_FEATURE_CONFIG_ADDR , feature_config , BMA456_FEATURE_SIZE , dev ) ; if ( rslt == BMA4_OK ) { feature_config [ index ] = BMA4_SET_BITSLICE ( feature_config [ index ] , BMA456_TAP_SEL , tap_select ) ; rslt = bma4_write_regs ( BMA4_FEATURE_CONFIG_ADDR , feature_config , BMA456_FEATURE_SIZE , dev ) ; } } else { rslt = BMA4_E_INVALID_SENSOR ; } } else { rslt = BMA4_E_NULL_PTR ; } return rslt ; }
@brief This API is used to select single/double tap
      feature in the sensor
@brief This API is used to select single / double tap feature in the sensor