bma456.c
uint16_t bma456_reset_step_counter(struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	/* Reset bit is 1 byte ahead of base address */
	uint8_t index = BMA456_STEP_CNTR_OFFSET + 1;
	uint16_t rslt = BMA4_OK;

	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_STEP_CNTR_RST, 1);
				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 resets the counted steps of step counter.
 */
@brief This API resets the counted steps of step counter.
@brief This API resets the counted steps of step counter .
uint16_t bma456_reset_step_counter(struct bma4_dev *dev)
{
	uint8_t feature_config[BMA456_FEATURE_SIZE] = {0};
	uint8_t index = BMA456_STEP_CNTR_OFFSET + 1;
	uint16_t rslt = BMA4_OK;
	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_STEP_CNTR_RST, 1);
				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_reset_step_counter ( struct bma4_dev * dev ) { uint8_t feature_config [ BMA456_FEATURE_SIZE ] = { 0 } ; uint8_t index = BMA456_STEP_CNTR_OFFSET + 1 ; uint16_t rslt = BMA4_OK ; 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_STEP_CNTR_RST , 1 ) ; 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 resets the counted steps of step counter.
@brief This API resets the counted steps of step counter .
/* Reset bit is 1 byte ahead of base address */